-
-
Notifications
You must be signed in to change notification settings - Fork 924
[IMP] product_supplierinfo_qty_multiplier: added logic for bypassing qty. multiplier #2944
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
Open
arielbarreiros96
wants to merge
1
commit into
OCA:18.0
Choose a base branch
from
BinhexTeam:18.0-imp-product_supplierinfo_qty_multiplier
base: 18.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| from . import product_supplierinfo | ||
| from . import purchase_order_line | ||
| from . import purchase_order |
15 changes: 15 additions & 0 deletions
15
product_supplierinfo_qty_multiplier/models/purchase_order.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # Copyright 2026 Binhex - Ariel Barreiros | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
|
||
| from odoo import fields, models | ||
|
|
||
|
|
||
| class PurchaseOrder(models.Model): | ||
| _inherit = "purchase.order" | ||
|
|
||
| bypass_supplierinfo_qty_multiplier = fields.Boolean( | ||
| string="Bypass vendor pricelist Qty. Multiplier", | ||
| help="If checked, the quantity multiplier defined in the " | ||
| "vendor pricelist will not be applied to the purchase order lines " | ||
| "of this purchase order.", | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,8 @@ | ||
| - Create a new purchase order. | ||
| - Assign it to the partner where the multiplier quantity was previously | ||
| set. | ||
| - Assign it to the partner where the multiplier quantity was previously set. | ||
| - Add a product line with the previously edited product. | ||
| - Quantity is set to 6.0. | ||
| - If you set 9.0 in the quantity field, the quantity will be rounded up | ||
| to 12.0 | ||
| - Quantity is set to 6.0 by default (based on the vendor multiplier). | ||
| - If you set 9.0 in the quantity field, the quantity will be rounded up to | ||
| 12.0 unless the 'Bypass vendor pricelist Qty. Multiplier' flag is enabled on the purchase order. | ||
|
|
||
|  | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
product_supplierinfo_qty_multiplier/views/purchase_order_view.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <?xml version="1.0" encoding="utf-8" ?> | ||
| <!-- License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> | ||
| <odoo> | ||
| <record id="purchase_order_form_view" model="ir.ui.view"> | ||
| <field name="model">purchase.order</field> | ||
| <field name="inherit_id" ref="purchase.purchase_order_form" /> | ||
| <field name="arch" type="xml"> | ||
| <field name="origin" position="after"> | ||
| <field name="bypass_supplierinfo_qty_multiplier" /> | ||
| </field> | ||
| </field> | ||
| </record> | ||
| </odoo> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Hi. Look great to me.
But I'd to explicit in which case it's interesting to by pass the setting ?
I mean, I developp this module to prevent user to buy one (or 2) bottle of milk, when supplier sell only by 6. In the use cases of my company, my users never said me they want to bypass the feature. Could you write some real use case in the USAGE.md (or DESCRIPTION.md file).
thanks !