-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[14.0] Mixed MR's #8
base: 14.0
Are you sure you want to change the base?
Conversation
thomaspaulb
commented
Sep 17, 2024
- serial number product combined with regular product - backorder created on serial number validation
Kit products (bom type = phantom) expand into several other products upon picking creation. Before this commit, this caused the module to find multiple destination moves per each move, since the matching was done on sale order - purchases order link only. Here we add matching on product also, which should fix this.
…o rebel module For product_supplierinfo_inter_company, this introduces a hard requirement to configure a pricelist on each supplier. This makes the tests of other modules fail because they do not set these. For stock_intercompany I don't know why it was set to rebel, it was done before but not updated in the copier template, so just updating copier to reflect reality.
When a return is actioned on the SO side, also process the return on PO side.
Currently when the sale order line has received a discount, and the SO is confirmed, the undiscounted price is copied over to the PO, leading to a price discrepancy between the SO and PO. With this commit, discount is respected.
By default picking state is forced to Done when SO picking is done, but if picking sync fails, eg if there is a mismatch in SO and PO move lines, user can't correct anything since the picking is already set to Done. This may be acceptable in cases where 100% of the syncs go OK but we make the setting configurable to support situations where manual corrections are needed.
f37c103
to
9aabd56
Compare
- 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.
raise UserError(_("PO does not exist or has no receipts")) | ||
ic_user = dest_company.intercompany_sale_user_id | ||
purchase.picking_ids.write({"intercompany_picking_id": pick.id}) | ||
ic_pick = pick.intercompany_picking_id.with_user(ic_user) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to add here with_company(dest_company)
for those cases where the destination user has access to more than one company.
ret = super()._action_done() | ||
|
||
# sync lots for move lines on returns | ||
# TODO: integrate with the non-return part just below this clause |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's best to already do this before merging. Maybe intercompany_picking_id
and intercompany_return_picking_id
can also be merged into one.