-
-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ADD] support update mode where we never try to create records #80
Conversation
Can you introduce a new value for mode, so that no confusion arises with the original modes from the Odoo method (I'm thinking Can you move that phrase 'will not try to create a record with partial data in case the record was removed in the database.' to the upper method docstring, so that it shows up in the documentation? |
if you update a record with the noupdate flag, it depends on the mode what happens: nothing in mode=update, an update in init. Or a create if the record doesn't exist, and that's what breaks here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
openupgradelib/openupgrade.py
Outdated
elif mode == 'init_no_create': | ||
for fp2 in _get_existing_records(cr, fp, module_name): | ||
tools.convert_xml_import( | ||
cr, module_name, fp2, idref, mode=mode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change this to init
. Please rebase also on latest branch for seeing Travis result.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good one. done
68e3393
to
3014713
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates!
CI is still broken. I'm restarting Travis. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like adding lxml to requirements.txt might help fix Travis.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, now green! @pedrobaeza are you happy as well?
df32f5f
to
522665b
Compare
Yes, sorry, I'm in the travel back with limited access. Holger, squash at your taste and please merge. |
Thanks @pedrobaeza, have a good journey! |
this is meant to allow loading
noupdate="1"
records and being sure nothing bad happens when doing this.Currently, if you
load_data
with records that were noupdate, forcecreate=False and deleted, odoo will generate acreate
, which fails if there are any required fields that are not included in the xmlcc @pedrobaeza