Sale stock exception
sale_exception_nostock · OCA/sale-workflow
-
Security25/25No findings
-
Activity0/25Last human commit 51 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
SaleOrderLine— Migrating to 13.0: `@api.multi`/`@api.one` were removed (multi is the default): drop them, looping over `self` where `@api.one` was used. (8 methods) migration-api-multi-one · source- Since 10.0: the `openerp` namespace was renamed to `odoo`; only a deprecated `openerp.addons` alias remained. (`openerp`) (2 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
Sale stock exception
This addon adds two new sales exceptions to be used by the sale_exception
addon:
-
The first one ensures that an order line can be delivered on the delivery date if it is in MTS. Validation is done by using the order line location via related shop and using the line delay.
-
The second one will create a sales exception if the current SO will break a sales order already placed in the future.
The second test will only look for stock moves that pass by the line location, so if your stock have children or if you have configured automated stock actions they must pass by the location related to the SO line, else they will be ignored.
If the module sale_owner_stock_sourcing is installed, each sale order line can specify a stock owner. In that case, the owner will be used when computing the virtual stock availability. For this to work correctly, https://github.com/odoo/odoo/issues/5814 needs to be fixed (fixes are proposed both for odoo and OCB).
Warning:
The second test is a workaround to compensate the lack of stock reservation process in OpenERP. This can be a performance killer and should not be be used if you have hundreds of simultaneous open SO.
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 (2)-
can_command_at_delivery_date(self)@api.multiPredicate that checks whether a SO line can be delivered at delivery date. The delivery date is computed using date of the order + line delay. The source location is predicted with a logic similar to the one that will be used for real. :return: True if line can be delivered on time -
future_orders_are_affected(self)@api.multiPredicate function that is a naive workaround for the lack of stock reservation. This can be a performance killer, you should not use it if you have constantly a lot of running Orders :return: True if future order are affected by current command line
Loading…
Loading…
Loading…