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] [ADD] purchase_sale_inter_company: Support returns #653

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

Conversation

thomaspaulb
Copy link
Contributor

When a return is actioned on the SO side, also process the return on PO side.

@thomaspaulb thomaspaulb marked this pull request as draft June 29, 2024 17:02
@OCA-git-bot
Copy link
Contributor

Hi @aleuffre, @renda-dev,
some modules you are maintaining are being modified, check this out!

@thomaspaulb thomaspaulb marked this pull request as ready for review June 30, 2024 11:32
@thomaspaulb thomaspaulb force-pushed the 14.0-10738-support-returns branch 2 times, most recently from 1863dca to 517f38b Compare June 30, 2024 13:04
Copy link
Contributor

@Christian-RB Christian-RB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @thomaspaulb,
Thanks for your work! Could you please review my comments? I'm working in a multicompany environment where each user only has access to one company. With my suggested changes, everything works perfectly.
Thanks again!

@thomaspaulb thomaspaulb force-pushed the 14.0-10738-support-returns branch 2 times, most recently from 67e665e to e97dad7 Compare September 25, 2024 13:28
- serial number product combined with regular product
- backorder created on serial number validation
…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.
@thomaspaulb
Copy link
Contributor Author

@Christian-RB Done.

Note that in order to solve a number of other bugs I ended up refactoring and simplifying the module:

sunflowerit#8

Still pondering how best to contribute this back to OCA, since it's a whole bunch of stuff, and there's a number of other things that have to be brought from 14.0 to 16.0 as well.

@Christian-RB
Copy link
Contributor

I think the best way (To make it easier to review) is splitting the changes in a logical way, by feature or refactor done.

Comment on lines +16 to +23
# dont trigger on returns of incoming pickings
if pick.picking_type_code == "incoming":
return res

# only trigger in case there is a coupled picking on the other side
ic_pick = pick.intercompany_picking_id
if not ic_pick:
return res
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have been working for a couple of weeks with a customer using this PR and it seems like the return of a return make sense in some cases. Is there any reason why this shouldn't be applied?

Suggested change
# dont trigger on returns of incoming pickings
if pick.picking_type_code == "incoming":
return res
# only trigger in case there is a coupled picking on the other side
ic_pick = pick.intercompany_picking_id
if not ic_pick:
return res
# dont trigger on returns of incoming pickings
if pick.picking_type_code == "incoming" and not pick.intercompany_return_picking_id:
return res
# only trigger in case there is a coupled picking on the other side
ic_pick = pick.intercompany_picking_id or pick.intercompany_return_picking_id
if not ic_pick:
return res

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.

3 participants