Skip to content

Conversation

@utpat-odoo
Copy link

@utpat-odoo utpat-odoo commented Dec 2, 2025

Purpose:
When you have a big RFQ (with a lot of lines) and you receive a Quote from the
vendor with a global discount (% or amount), it's very time consuming to apply
it to all lines.

Technical changes:
Add discount_type, discount_in_value and computed discount_in_percentage fields
on purchase.order.
Add constraints for validate discount percentage.
Add discount button in purchase order view form.
Add action_discount to open a popup and apply_discount to apply the global
discount on all order lines.
Discount can be entered either as a percentage or as a fixed amount.

task-5366796

@robodoo
Copy link

robodoo commented Dec 2, 2025

Pull request status dashboard

@utpat-odoo utpat-odoo force-pushed the 19.0-purchase_discount-utpat branch 2 times, most recently from 00730b3 to acf51e9 Compare December 3, 2025 04:39
Copy link

@bit-odoo bit-odoo left a comment

Choose a reason for hiding this comment

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

Hello,
i have added some suggestions.
I think we can do it without creating a new model.

edit- Can you please update your commit message?

Copy link

Choose a reason for hiding this comment

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

Unceccary change.

@@ -0,0 +1,13 @@
{
'author': 'Odoo S.A.',
'name': 'Purchase Discount',
Copy link

Choose a reason for hiding this comment

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

Please add the description.

<group>
<field name="discount_type"/>
<field name="discount_in_value"/>
<field name="discount_in_percentage"/>
Copy link

Choose a reason for hiding this comment

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

It should be only visible when the discount is in the amount.

</sheet>
<footer>
<button name="apply_discount" type="object" string="Apply" class="oe_highlight" confirm="Are you sure?"/>
<button name="apply_cancle" type="object" string="Cancle"/>
Copy link

Choose a reason for hiding this comment

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

No need to define the name.

self.discount_id = new_data.id
return {
"type": "ir.actions.act_window",
"name": "Discount",
Copy link

Choose a reason for hiding this comment

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

I think it should be translatable.

Copy link

Choose a reason for hiding this comment

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

Can you please adapt the view as mentioned in the Excelidraw

@utpat-odoo utpat-odoo force-pushed the 19.0-purchase_discount-utpat branch 2 times, most recently from d242bbd to 428452f Compare December 5, 2025 03:29
…e order

Purpose:
When you have a big RFQ (with a lot of lines) and you receive a Quote from the
vendor with a global discount (% or amount), it's very time consuming to apply
it to all lines.

Technical changes:
Add discount_type, discount_in_value and computed discount_in_percentage fields
on purchase.order.
Add constraints for validate discount percentage.
Add discount button in purchase order view form.
Add action_discount to open a popup and apply_discount to apply the global
discount on all order lines.
Discount can be entered either as a percentage or as a fixed amount.

task-5366796
@utpat-odoo utpat-odoo force-pushed the 19.0-purchase_discount-utpat branch from 428452f to 4613856 Compare December 5, 2025 04:59
@utpat-odoo
Copy link
Author

Hello sir,
All the suggested changes have been completed.

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