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][FIX] sale_commission_product_criteria_domain #541

Open
wants to merge 3 commits into
base: 16.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion sale_commission_product_criteria/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@
for line in self:
if line.commission_id and line.commission_id.commission_type == "product":
inv_line = line.object_id
line.amount = line._get_single_commission_amount(
amount = line._get_single_commission_amount(
line.commission_id,
inv_line.price_subtotal,
inv_line.product_id,
inv_line.quantity,
)
if line.invoice_id.move_type == "out_refund":
line.amount = -amount

Check warning on line 29 in sale_commission_product_criteria/models/account_move.py

View check run for this annotation

Codecov / codecov/patch

sale_commission_product_criteria/models/account_move.py#L29

Added line #L29 was not covered by tests
else:
line.amount = amount
else:
res = super(AccountInvoiceLineAgent, line)._compute_amount()
return res
17 changes: 13 additions & 4 deletions sale_commission_product_criteria_domain/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,19 @@ promote its widespread use.
.. |maintainer-ilyasProgrammer| image:: https://github.com/ilyasProgrammer.png?size=40px
:target: https://github.com/ilyasProgrammer
:alt: ilyasProgrammer

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-ilyasProgrammer|
.. |maintainer-aleuffre| image:: https://github.com/aleuffre.png?size=40px
:target: https://github.com/aleuffre
:alt: aleuffre
.. |maintainer-renda-dev| image:: https://github.com/renda-dev.png?size=40px
:target: https://github.com/renda-dev
:alt: renda-dev
.. |maintainer-PicchiSeba| image:: https://github.com/PicchiSeba.png?size=40px
:target: https://github.com/PicchiSeba
:alt: PicchiSeba

Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-ilyasProgrammer| |maintainer-aleuffre| |maintainer-renda-dev| |maintainer-PicchiSeba|

This module is part of the `OCA/commission <https://github.com/OCA/commission/tree/16.0/sale_commission_product_criteria_domain>`_ project on GitHub.

Expand Down
2 changes: 1 addition & 1 deletion sale_commission_product_criteria_domain/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"version": "16.0.1.0.2",
"author": "Ilyas," "Ooops404," "Odoo Community Association (OCA)",
"contributors": ["Ilyas"],
"maintainers": ["ilyasProgrammer"],
"maintainers": ["ilyasProgrammer", "aleuffre", "renda-dev", "PicchiSeba"],
"website": "https://github.com/OCA/commission",
"category": "Sales Management",
"license": "AGPL-3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@
and line.commission_id.commission_type == "product_restricted"
):
inv_line = line.object_id
line.amount = line._get_single_commission_amount(
amount = line._get_single_commission_amount(
line.commission_id,
inv_line.price_subtotal,
inv_line.product_id,
inv_line.quantity,
)
if line.invoice_id.move_type == "out_refund":
line.amount = -amount

Check warning on line 29 in sale_commission_product_criteria_domain/models/account_invoice_line_agent.py

View check run for this annotation

Codecov / codecov/patch

sale_commission_product_criteria_domain/models/account_invoice_line_agent.py#L29

Added line #L29 was not covered by tests
else:
line.amount = amount
else:
res = super(AccountInvoiceLineAgent, line)._compute_amount()
return res
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,8 @@ <h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/ilyasProgrammer"><img alt="ilyasProgrammer" src="https://github.com/ilyasProgrammer.png?size=40px" /></a></p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/ilyasProgrammer"><img alt="ilyasProgrammer" src="https://github.com/ilyasProgrammer.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/aleuffre"><img alt="aleuffre" src="https://github.com/aleuffre.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/renda-dev"><img alt="renda-dev" src="https://github.com/renda-dev.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/PicchiSeba"><img alt="PicchiSeba" src="https://github.com/PicchiSeba.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/commission/tree/16.0/sale_commission_product_criteria_domain">OCA/commission</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
Expand Down
Loading