[19.0][MIG] purchase_order_import: Migration to 19.0#1335
Conversation
99c0744 to
deccd3f
Compare
deccd3f to
22d3f77
Compare
|
Hello @vvrossem @ivantodorovich |
22d3f77 to
5dc53fb
Compare
5dc53fb to
1fca1af
Compare
|
Hello @OCA/edi-maintainers can you pls take a look and possibly trigger merge? |
| @@ -0,0 +1,2 @@ | |||
| from . import common | |||
There was a problem hiding this comment.
never import common files here
| @classmethod | ||
| def setUpClass(cls): | ||
| super().setUpClass() | ||
| cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True)) |
There was a problem hiding this comment.
BaseCommon already disables tracking if I'm not wrong
|
|
||
|
|
||
| class OrderResponseImportWizard(models.TransientModel): | ||
| _name = "order.response.import.wizard" |
There was a problem hiding this comment.
| _name = "order.response.import.wizard" | |
| _name = "purchase.order.response.import.wizard" |
| purchase_order.button_approve() | ||
|
|
||
| @api.model | ||
| def _process_conditional( |
| vals["incoterm_id"] = incoterm.id | ||
| return vals | ||
|
|
||
| def update_order_lines( |
| "product_qty": import_line.get("qty") or 1.0, | ||
| "product_uom_id": uom.id, | ||
| } | ||
| vals.update(polo.play_onchanges(vals, ["product_id"])) |
There was a problem hiding this comment.
| vals.update(polo.play_onchanges(vals, ["product_id"])) |
I believe we can drop this, as all relevant fields have been moved to computed fields in core.
Then, we can drop the onchange_helper dependency
There was a problem hiding this comment.
I see your point and agree.
onchange_helperas dependency is only needed for this callvals.update(polo.play_onchanges(vals, ["product_id"]))- In Odoo 19,
pucrhase.order.line::createcalls_prepare_add_missing_fieldswhich is doing the same:
@api.model
def _prepare_add_missing_fields(self, values):
""" Deduce missing required fields from the onchange """
res = {}
onchange_fields = ['name', 'price_unit', 'product_qty', 'product_uom_id', 'tax_ids', 'date_planned']
if values.get('order_id') and values.get('product_id') and any(f not in values for f in onchange_fields):
line = self.new(values)
line.onchange_product_id()
for field in onchange_fields:
if field not in values:
res[field] = line._fields[field].convert_to_write(line[field], line)
return res
- Leave imported
price_unit,product_qtyandproduct_uom_id.
…ort_ubl and purchase_order_ubl
because we want to have access to the code of the modules that inherit business.document.import
Add support for partner bank matching on invoice update (before, it was only supported on invoice creation)
Rename __openerp__.py to __manifest__.py and set installable to False
… module Fix spelling mistake and other remarks on README by Tarteo
Add ubl invoice generation option in accounting config page
… has visible discounts Code improvements in sale_order_import Add unit tests in sale_order_import Use display_name instead of name_get()[0][1]
…iness document is imported in the right company
Updated by Actualizar ficheiros PO com o novo POT (msgmerge) hook in Weblate.
the method play_onchange in server-tools/onchange_helper only returns the changed keys in the dictionary it receives as first arguement. The code in account_invoice_import, purchase_order_import and sale_order_import was written as if all the keys were returned. Maybe the behavior of play_onchange was updated in a recent version, but this nevertheless needs fixing in this module. This should fix the unit tests which are red on this branch.
The ORderResponce document allows a supplier to communicate the ack and the confirmation of an Order documnet. Depending of its content, the PO will be cancelled or confirmed. If the OrderResponse document contains some amended line, the import process will update the picking to reflect the changes
0e4d197 to
9321421
Compare
|
Hello @simahawk @ivantodorovich your suggestions are applied. |
jbaudoux
left a comment
There was a problem hiding this comment.
LG but I wouldn't rename the wizard files as it prevents to see the migration changes and won't be convenient for later porting imp/fixes
Can you pls check if this is ok for you now? |
|
hi @jbaudoux can i ask you a quick review :P |
Depends on: