forked from OCA/multi-company
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RFR] Refactor in order to solve bugs
- One bug in particular related to the amount of stock.move.line records on PO picking being unequal to those on the SO picking side, and the resulting mismatch prevented the confirm to continue. This is actually a common case that happens when you confirm early and want to make a backorder; in such a case the PO side will still a higher reserved qty and a matching number of move lines. Solve for this case by removing any excess PO-side stock.move.line records upon sync. - Another bug was that if for whatever reason a certain move could not be synced, it would still continue to set qty_done for that move, instead of skipping it. This led to errors. Furthermore, in such a case it would still create the serial numbers in the destination company but not actually link them to the move lines, leading to errors about the serial number already existing if people want to solve the situation manually by typing in the serial numbers on the picking. In order to solve this, I had to merge the 'button_validate' and '_action_done' overrides into one single unified function override. Because the '_action_done' override dealt with the syncing of lot numbers, and the 'button_validate' override dealt with the syncing of 'qty_done', but if the first fails, you want to also skip the other, which is difficult if they are executed in different functions.
- Loading branch information
1 parent
9aabd56
commit 6db845e
Showing
2 changed files
with
198 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.