-
-
Notifications
You must be signed in to change notification settings - Fork 353
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] [ADD] sale_commission_margin: Deduct commission from margin #591
base: 16.0
Are you sure you want to change the base?
Conversation
Hi @pedrobaeza, |
cd26f5f
to
20753b2
Compare
@OCA/crm-sales-marketing-maintainers |
20753b2
to
2fa6b43
Compare
2fa6b43
to
8bed888
Compare
@@ -4,6 +4,8 @@ | |||
<field name="name">sale.agent.order.inherit.form</field> | |||
<field name="model">sale.order</field> | |||
<field name="inherit_id" ref="sale.view_order_form" /> | |||
<field name="priority" eval="15" /> | |||
<field name="mode">primary</field> |
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.
Why primary?
You should add the change directly in your module
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.
Because in that case, it has no effect. I looked into the Odoo documentation and supposed it is due to the following:
View matching
if a view is requested by (model, type), the view with the right model and type, mode=primary and the lowest priority is matched.when a view is requested by id, if its mode is not primary its closest parent with mode primary is matched.
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.
This is not correct. Please don't change it.
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.
Due to your suggestions and after several attempts with different approaches, I think the cleanest solution to show the commission total before the margin, without completely changing the view logic and while keeping it within my module, is to use the position attribute to move the field to a different node. WDY?
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 have also squashed all commits into one because it is all about my module.
8bed888
to
2e62d68
Compare
This addon allows commissions to be deducted from the margin.
Because precomputed fields must depend on other precomputed fields, some computed fields in the commission module have been established as precomputed.
Issue #153