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][MIG] purchase_operating_unit [WIP] #343

Merged
merged 23 commits into from
May 30, 2021

Conversation

kittiu
Copy link
Member

@kittiu kittiu commented Dec 4, 2020

Depends

Note: test locally ok.

@kittiu kittiu changed the title [14.0][MIG] purchase_operating_unit [14.0][MIG] purchase_operating_unit [WIP] Dec 4, 2020
@kittiu kittiu mentioned this pull request Dec 4, 2020
16 tasks
@kittiu kittiu force-pushed the 14.0-mig-purchase_operating_unit branch from 76b287f to a1e91e4 Compare December 8, 2020 10:56
@alan196
Copy link
Contributor

alan196 commented Dec 23, 2020

@kittiu this PR it's still on WIP?

@kittiu
Copy link
Member Author

kittiu commented Dec 24, 2020

Itself no. But it is waiting for stock_operating_unit

Copy link
Member

@feketemihai feketemihai left a comment

Choose a reason for hiding this comment

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

Tested locally with stock_operating_unit and it works fine.

Copy link
Member

@Saran440 Saran440 left a comment

Choose a reason for hiding this comment

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

Please update your travis.
Functional Test 👍

@Saran440
Copy link
Member

Functional Test:
Error when you have many ou and select po without default ou.

My login:
2 ou (ou1, ou2)
default with ou1

step to error

  1. Create PO and change Operating Unit and Requesting Operating Unit to ou2
  2. Received Product > Create bills
  3. it throw error The operating unit of the purchase order must be the same as in the associated invoices.

picking_vals = super(PurchaseOrder, self)._prepare_picking()
picking_vals["operating_unit_id"] = self.operating_unit_id.id
return picking_vals

Copy link
Member

Choose a reason for hiding this comment

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

def action_create_invoice(self):
    ctx = self._context.copy()
    for order in self:
        ctx["default_operating_unit_id"] = order.operating_unit_id.id or False
    return super(PurchaseOrder, self.with_context(ctx)).action_create_invoice()

I think we should add context default ou to invoice for fix it.

@kittiu kittiu force-pushed the 14.0-mig-purchase_operating_unit branch from a1e91e4 to a472524 Compare May 9, 2021 05:09
@kittiu kittiu force-pushed the 14.0-mig-purchase_operating_unit branch from a472524 to 0aa2d83 Compare May 9, 2021 05:13
@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@kittiu
Copy link
Member Author

kittiu commented May 30, 2021

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 14.0-ocabot-merge-pr-343-by-kittiu-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 6519be8 into OCA:14.0 May 30, 2021
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 9c318b6. Thanks a lot for contributing to OCA. ❤️

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

Successfully merging this pull request may close these issues.