Skip to content
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

Open
wants to merge 14 commits into
base: 14.0
Choose a base branch
from
Open

[14.0] Mixed MR's #8

wants to merge 14 commits into from

Conversation

thomaspaulb
Copy link
Member

    # 10692 dont lock target invoices
    - curl -L https://github.com/OCA/multi-company/pull/644.patch | git am
    # 10692 support returns
    - curl -L https://github.com/OCA/multi-company/pull/653.patch | git am
    # 10770 support discount
    - curl -L https://github.com/OCA/multi-company/pull/662.patch | git am
    # 10976 dont force done state 
    - curl -L https://github.com/sunflowerit/multi-company/pull/7.patch | git am

thomaspaulb and others added 12 commits September 18, 2024 10:30
- 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.
- 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)
Copy link
Member Author

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
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants