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

[16.0] account_invoice_supplierinfo_update: fix updating the right supplierinfo #1697

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

sebastienbeau
Copy link
Member

@sebastienbeau sebastienbeau commented Mar 28, 2024

If you have variant of price per qty the module is not going to update the right supplierinfo

Reuse the native _sellect_seller to pick the right supplierinfo + add test

@legalsylvain

@OCA-git-bot
Copy link
Contributor

Hi @legalsylvain,
some modules you are maintaining are being modified, check this out!

@sebastienbeau sebastienbeau changed the title account_invoice_supplierinfo_update: fix updating the right supplierinfo [16.0] account_invoice_supplierinfo_update: fix updating the right supplierinfo Mar 28, 2024
Copy link
Contributor

@legalsylvain legalsylvain left a comment

Choose a reason for hiding this comment

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

Nice catch !
Thanks !
(I personnaly don't use many supplier info for the same product and partner, so I never faced such issue).

Comment on lines +51 to +53
(
0,
0,
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpicking, could be replaced by Command.create

Comment on lines +59 to +61
(
6,
0,
Copy link
Contributor

Choose a reason for hiding this comment

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

same here ( Command.set([...]))

lambda seller: seller.partner_id == self.move_id.supplier_partner_id
supplierinfos = self.product_id._select_seller(
partner_id=self.move_id.supplier_partner_id,
quantity=self.quantity,
Copy link
Member

@rvalyi rvalyi Mar 28, 2024

Choose a reason for hiding this comment

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

"Information is a mass noun. It has no plural form"* so infos looks like informations which would be Frenglish and looks TinyERP. Better change that to supplier_info or supplier_data as you want.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi.

@rvalyi. We already talk about that in another PR. summary of the previous comments :

what you mention is not an OCA rule.

  • "infos" is used in many OCA repo. (12 occurences in V16, only in the repos I cloned for GRAP project)
  • "datas" is used in many OCA repo. (19 occurences in V16, only in the repos I cloned for GRAP project)

So if you want to introduce that new rule, please create a dedicated PR here https://github.com/OCA/odoo-community.org/tree/master/website/Contribution

In the meantime, please avoid to block valid PR.

Thanks !

Copy link
Member

Choose a reason for hiding this comment

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

I didn't block, only suggest to use better variable names. When native English speakers read that they feel it's cheap while it's easy to improve.

Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't block

You set "changes requested". Could you remove it ?

  1. as said not the place to create new rules. Please create a dedicated issue.

Thanks !

@rafaelbn rafaelbn added this to the 16.0 milestone Mar 30, 2024
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.

None yet

5 participants