-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[ADD] purchase_discount: add global discount functionality. #1043
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
base: 19.0
Are you sure you want to change the base?
Conversation
00730b3 to
acf51e9
Compare
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.
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?
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.
Unceccary change.
| @@ -0,0 +1,13 @@ | |||
| { | |||
| 'author': 'Odoo S.A.', | |||
| 'name': 'Purchase Discount', | |||
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.
Please add the description.
| <group> | ||
| <field name="discount_type"/> | ||
| <field name="discount_in_value"/> | ||
| <field name="discount_in_percentage"/> |
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.
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"/> |
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.
No need to define the name.
| self.discount_id = new_data.id | ||
| return { | ||
| "type": "ir.actions.act_window", | ||
| "name": "Discount", |
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.
I think it should be translatable.
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.
Can you please adapt the view as mentioned in the Excelidraw
d242bbd to
428452f
Compare
…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
428452f to
4613856
Compare
|
Hello sir, |

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