The scheduler cron will now only call `run_scheduler`. We refactore this
method to extract `_run_scheduler_tasks` and place a call to
`_merge_quant` a the end.
We override `_run_scheduler_tasks` in stock_account to run the fifo
vacuum when the scheduler cron is executed.
Commit 0e4f3bb959 turn scheduler
cron to inactive though it should not.
It also rename the MRP in the name since the scheduler is not
only relative to mrp.
It could exist issue with concurency. If the user try to
open the inventory menu but the database can't obtain the lock
for quants to modify/delete. It could raise a traceback to the
end user.
In order to prevent that we use a try catch and pass the exception
it's okay if all the quants are not merged for the user, it will
probably be the next time. It also use a savepoint in order to not
rollback the whole transaction.
The merge quants was only used once the user click on inventory
menu. But if the user only do it once every 2-3 years, there could
be too much quants to merge in only one transaction. In order to
avoit it, we also deduplicate quants in the scheduler cron.
This removes the procurement.order model. To fufill their needs SO, PO, MO and
stock moves now call the _run method of the relevant procurement.group.
This mecanism is now only used for stockable product, tasks now uses their own
independent mecanism.
The _run method will check all the applicable rules and create directly the
needed model to fufill the need.
The modules stock, purchase, mrp, extends the _run method to implement their
specific strategy relevant for the rule type they define.
If an exception happens the message will be logged as a mail messsage on the
source model, for example, if a sales order cannot be fufilled the salesperson
will now see directly the reason.
OLD commit messages:
[WIP] procurement: removing procurement.order in stock, sale, purchase, sale_stock. WIP
fixup! [WIP] procurement: removing procurement.order in stock, sale, purchase, sale_stock. WIP
[IMP] Basic tests
[FIX] test not necessary anymore
[FIX] remove unnecessary print statement
[FIX] unnecessary test + why passing warehouse worked before?
[IMP] purchase: one move by purchase order line
[FIX] purchase: correct inventory tests and pass move_dest_ids among procurements
[FIX] because of bad cherry-pick merge
[IMP] make mrp pass by adding move_dest_ids there too
[IMP] tests of sale_mrp, no need for cancelpropagation then
[IMP] better to consistently use recordsets also for one2many
[FIX] purchase_requisition
[FIX] Exceptions should trigger errors, which should be caught in the tests
[FIX] sale_mrp: remove usage of procurement.order and use sale order name instead of sol
[FIX] stock_dropshipping: add sale_line_id on purchase_line_id
[FIX] Remove pdb
[IMP] add stock_dropshipping files
[IMP] stock: search carrier through sale line instead of procurement group
[IMP] add procrule test and preision needed when updating sol
[FIX] sale_order_dates + [IMP] procurement exceptions by scheduler
[FIX] No need to return task
[IMP] move file as name changes and add corrections
[FIX] Continue Run Schedulers wizard fix
[FIX] name issues of takss
[FIX] updating sale order line, but there is still a problem with the recompute
Moves performed
- data and demo files are now located inside the data directory
- data and demo files name updated
- report views moved inside report directory instead of views
- main stock menus declarations moved from stock.xml to stock_menu_views.xml
in order to have all main menus in a single file, extracted from model
specific views
- data section of __openerp__.py file reorganized accordingly
No change done in this commit.