Add hooks to the merge PO feature.
purchase_group_hooks · OCA/purchase-workflow
-
Security25/25No findings
-
Activity0/25Last human commit 121 months ago
-
Required by5/250 modules depend on it
-
Maturity25/25In 4 Odoo series since 7.0
Heuristic over the facts below, not an audit · How it's computed
Migration considerations
- Migrating to 11.0: the workflow engine (`trg_validate`) was removed: rewrite as state-field transitions. migration-workflow-call · source
- Since 10.0: the `openerp` namespace was renamed to `odoo`; only a deprecated `openerp.addons` alias remained. (`openerp.osv.orm`) (3 occurrences in this file) migration-openerp-import · source
Migration review checklist, not a compatibility verdict. "Migrating to X.0" applies once you upgrade to that version; "Since X.0" means this version already ignores or rejects that code. Methodology
Description
In the core OpenERP purchase module, there is a wizard to merge purchase orders. That feature is convenient, but as soon as a field is added to the purchase order, it does not work anymore and needs to be patched. The original implementation does not provide any hooks for extension, and modules can only reimplement a method completely. This required a lot of copy and paste, and worse, it breaks if two modules attempt to do that.
Therefore, this module reimplements the feature, with the same basic result in the standard case. Hooks are provided for extra modules that add fields or change the logic.
Dependencies
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 0
No views found for this module.
HTTP endpoints 0
No HTTP endpoints found for this module.
Models touched 1
No new fields.
Public methods (1)-
do_merge(self, cr, uid, input_order_ids, context=None)Merge Purchase Orders. This method replaces the original one in the purchase module because it did not provide any hooks for customization. Receive a list of order ids, and return a dictionary where each element is in the form: new_order_id: [old_order_1_id, old_order_2_id] New orders are created, and old orders are deleted.
Loading…
Loading…
Loading…