From 42e991443d190ee47223ae916d3fe57129846a71 Mon Sep 17 00:00:00 2001 From: "matteo.tognini" Date: Fri, 1 Dec 2023 16:43:47 +0100 Subject: [PATCH 01/12] [ADD]sale_commission_partial_payment: Commission based on payment amount --- sale_commission_partial_settlement/README.rst | 96 ++++ .../__init__.py | 2 + .../__manifest__.py | 15 + .../models/__init__.py | 4 + .../models/account_move.py | 109 +++++ .../models/account_partial_reconcile.py | 7 + .../models/sale_commission.py | 14 + .../models/settlement.py | 26 + .../readme/CONTRIBUTORS.rst | 11 + .../readme/DESCRIPTION.rst | 1 + .../readme/USAGE.rst | 5 + .../security/ir.model.access.csv | 3 + .../static/description/icon.png | Bin 0 -> 19238 bytes .../static/description/index.html | 452 ++++++++++++++++++ .../tests/__init__.py | 1 + .../tests/test_partial_settlement.py | 266 +++++++++++ .../views/sale_commission_view.xml | 16 + .../wizard/__init__.py | 1 + .../wizard/wizard_settle.py | 100 ++++ 19 files changed, 1129 insertions(+) create mode 100644 sale_commission_partial_settlement/README.rst create mode 100644 sale_commission_partial_settlement/__init__.py create mode 100644 sale_commission_partial_settlement/__manifest__.py create mode 100644 sale_commission_partial_settlement/models/__init__.py create mode 100644 sale_commission_partial_settlement/models/account_move.py create mode 100644 sale_commission_partial_settlement/models/account_partial_reconcile.py create mode 100644 sale_commission_partial_settlement/models/sale_commission.py create mode 100644 sale_commission_partial_settlement/models/settlement.py create mode 100644 sale_commission_partial_settlement/readme/CONTRIBUTORS.rst create mode 100644 sale_commission_partial_settlement/readme/DESCRIPTION.rst create mode 100644 sale_commission_partial_settlement/readme/USAGE.rst create mode 100644 sale_commission_partial_settlement/security/ir.model.access.csv create mode 100644 sale_commission_partial_settlement/static/description/icon.png create mode 100644 sale_commission_partial_settlement/static/description/index.html create mode 100644 sale_commission_partial_settlement/tests/__init__.py create mode 100644 sale_commission_partial_settlement/tests/test_partial_settlement.py create mode 100644 sale_commission_partial_settlement/views/sale_commission_view.xml create mode 100644 sale_commission_partial_settlement/wizard/__init__.py create mode 100644 sale_commission_partial_settlement/wizard/wizard_settle.py diff --git a/sale_commission_partial_settlement/README.rst b/sale_commission_partial_settlement/README.rst new file mode 100644 index 000000000..c6fc54a25 --- /dev/null +++ b/sale_commission_partial_settlement/README.rst @@ -0,0 +1,96 @@ +====================================== +Sales commissions based on paid amount +====================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:2a9857c3cff391b9ed98fd4916c0b50b68872332e34bf4937b6d3705dbf2510d + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcommission-lightgray.png?logo=github + :target: https://github.com/OCA/commission/tree/14.0/sale_commission_partial_settlement + :alt: OCA/commission +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/commission-14-0/commission-14-0-sale_commission_partial_settlement + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/commission&target_branch=14.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows to settle commissions based on paid amount. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +* Go to Sales > Commissions Management > Commission Types > create or open a record +* Select Invoice Status: Payment Based +* Select Payment Amount Type: Paid Amount + +Behavior for commission settlements will be as per module description. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Nextev Srl +* Ooops + +Contributors +~~~~~~~~~~~~ + +* Nextev : + + * Matteo Tognini + +* PyTech SRL : + + * Alessandro Uffreduzzi + +* Ooops404 : + + * Francesco Foresti + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +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. + +This module is part of the `OCA/commission `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/sale_commission_partial_settlement/__init__.py b/sale_commission_partial_settlement/__init__.py new file mode 100644 index 000000000..9b4296142 --- /dev/null +++ b/sale_commission_partial_settlement/__init__.py @@ -0,0 +1,2 @@ +from . import models +from . import wizard diff --git a/sale_commission_partial_settlement/__manifest__.py b/sale_commission_partial_settlement/__manifest__.py new file mode 100644 index 000000000..0ba779b5e --- /dev/null +++ b/sale_commission_partial_settlement/__manifest__.py @@ -0,0 +1,15 @@ +# Copyright 2023 Nextev +{ + "name": "Sales commissions based on paid amount", + "version": "14.0.1.0.0", + "author": "Nextev Srl," "Ooops," "Odoo Community Association (OCA)", + "category": "Sales Management", + "license": "AGPL-3", + "depends": ["sale_commission"], + "website": "https://github.com/OCA/commission", + "data": [ + "security/ir.model.access.csv", + "views/sale_commission_view.xml", + ], + "installable": True, +} diff --git a/sale_commission_partial_settlement/models/__init__.py b/sale_commission_partial_settlement/models/__init__.py new file mode 100644 index 000000000..4e17db438 --- /dev/null +++ b/sale_commission_partial_settlement/models/__init__.py @@ -0,0 +1,4 @@ +from . import sale_commission +from . import account_move +from . import account_partial_reconcile +from . import settlement diff --git a/sale_commission_partial_settlement/models/account_move.py b/sale_commission_partial_settlement/models/account_move.py new file mode 100644 index 000000000..4ba56f54c --- /dev/null +++ b/sale_commission_partial_settlement/models/account_move.py @@ -0,0 +1,109 @@ +# Copyright 2023 Nextev +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class AccountInvoiceLineAgent(models.Model): + _inherit = "account.invoice.line.agent" + + partial_settled = fields.Monetary(string="Partial Commission Amount Settled") + + def _compute_settled(self): + filtered_lines = self.filtered( + lambda x: x.commission_id.payment_amount_type != "paid" + ) + super(AccountInvoiceLineAgent, filtered_lines)._compute_settled() + + def _partial_commissions(self, date_payment_to): + """ + This method iterates through agent invoice lines and calculates + partial commissions based on the payment amount. + If the partial payment amount is greater than the invoice line + amount, it fully settles the corresponding agent line. + Otherwise, it calculates the partial commission proportionally to + the amount paid, invoice amount and total commissions. + """ + partial_lines_to_settle = [] + partial_payment_remaining = {} + lines_to_update = {} + for line in self: + line_total_amount = line.amount + for ( + partial, + amount, + counterpart_line, + ) in line.invoice_id._get_reconciled_invoices_partials(): + if partial.partial_commission_settled: + continue + elif date_payment_to and date_payment_to < counterpart_line.date: + break + if partial.id in partial_payment_remaining: + payment_amount = partial_payment_remaining[partial.id][ + "remaining_amount" + ] + else: + payment_amount = amount + partial_payment_remaining[partial.id] = {"remaining_amount": amount} + if line.object_id.price_total <= payment_amount: + partial_lines_to_settle.append( + { + "invoice_line_agent_id": line.id, + "currency_id": line.currency_id.id, + "amount": line_total_amount, + } + ) + lines_to_update[line.id] = { + "partial_settled": line_total_amount, + "settled": True, + } + partial_payment_remaining[partial.id] = { + "remaining_amount": amount - line.object_id.price_total + } + break + + paid_in_proportion = payment_amount / line.invoice_id.amount_total + partial_commission = ( + line.invoice_id.commission_total * paid_in_proportion + ) + partial_lines_to_settle.append( + { + "invoice_line_agent_id": line.id, + "currency_id": line.currency_id.id, + "amount": partial_commission, + } + ) + if line.id in lines_to_update: + lines_to_update[line.id]["partial_settled"] += partial_commission + else: + lines_to_update[line.id] = {"partial_settled": partial_commission} + + if lines_to_update[line.id]["partial_settled"] >= line_total_amount: + lines_to_update[line.id].update({"settled": True}) + break + partial.partial_commission_settled = True + partial_agent_lines = self.env["account.invoice.line.agent.partial"].create( + partial_lines_to_settle + ) + return partial_agent_lines, lines_to_update + + +class AccountInvoiceLineAgentPartial(models.Model): + _name = "account.invoice.line.agent.partial" + _description = "Partial agent commissions" + + invoice_line_agent_id = fields.Many2one("account.invoice.line.agent", required=True) + agent_line = fields.Many2many( + comodel_name="sale.commission.settlement.line", + relation="settlement_agent_line_partial_rel", + column1="agent_line_partial_id", + column2="settlement_id", + copy=False, + ) + amount = fields.Monetary( + string="Commission Amount", + ) + currency_id = fields.Many2one( + related="invoice_line_agent_id.currency_id", + ) + settled = fields.Boolean() diff --git a/sale_commission_partial_settlement/models/account_partial_reconcile.py b/sale_commission_partial_settlement/models/account_partial_reconcile.py new file mode 100644 index 000000000..7c1714d4d --- /dev/null +++ b/sale_commission_partial_settlement/models/account_partial_reconcile.py @@ -0,0 +1,7 @@ +from odoo import fields, models + + +class AccountPartialReconcile(models.Model): + _inherit = "account.partial.reconcile" + + partial_commission_settled = fields.Boolean() diff --git a/sale_commission_partial_settlement/models/sale_commission.py b/sale_commission_partial_settlement/models/sale_commission.py new file mode 100644 index 000000000..68f03aea9 --- /dev/null +++ b/sale_commission_partial_settlement/models/sale_commission.py @@ -0,0 +1,14 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class SaleCommission(models.Model): + _inherit = "sale.commission" + + payment_amount_type = fields.Selection( + [("full", "Full amount"), ("paid", "Paid amount")], + string="Payment amount type", + required=True, + default="full", + ) diff --git a/sale_commission_partial_settlement/models/settlement.py b/sale_commission_partial_settlement/models/settlement.py new file mode 100644 index 000000000..f25ba11e0 --- /dev/null +++ b/sale_commission_partial_settlement/models/settlement.py @@ -0,0 +1,26 @@ +from odoo import api, fields, models + + +class SettlementLine(models.Model): + _inherit = "sale.commission.settlement.line" + + agent_line_partial_ids = fields.Many2many( + comodel_name="account.invoice.line.agent.partial", + relation="settlement_agent_line_partial_rel", + column1="settlement_id", + column2="agent_line_partial_id", + ) + settled_amount = fields.Monetary( + compute="_compute_settled_amount", + related=False, + readonly=True, + store=True, + ) + + @api.depends("commission_id.payment_amount_type") + def _compute_settled_amount(self): + for rec in self: + if rec.commission_id.payment_amount_type == "paid": + rec.settled_amount = rec.agent_line_partial_ids[:1].amount + else: + rec.settled_amount = rec.agent_line[:1].amount diff --git a/sale_commission_partial_settlement/readme/CONTRIBUTORS.rst b/sale_commission_partial_settlement/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..598e7ac77 --- /dev/null +++ b/sale_commission_partial_settlement/readme/CONTRIBUTORS.rst @@ -0,0 +1,11 @@ +* Nextev : + + * Matteo Tognini + +* PyTech SRL : + + * Alessandro Uffreduzzi + +* Ooops404 : + + * Francesco Foresti diff --git a/sale_commission_partial_settlement/readme/DESCRIPTION.rst b/sale_commission_partial_settlement/readme/DESCRIPTION.rst new file mode 100644 index 000000000..b88a8a16c --- /dev/null +++ b/sale_commission_partial_settlement/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module allows to settle commissions based on paid amount. diff --git a/sale_commission_partial_settlement/readme/USAGE.rst b/sale_commission_partial_settlement/readme/USAGE.rst new file mode 100644 index 000000000..bdf194f9f --- /dev/null +++ b/sale_commission_partial_settlement/readme/USAGE.rst @@ -0,0 +1,5 @@ +* Go to Sales > Commissions Management > Commission Types > create or open a record +* Select Invoice Status: Payment Based +* Select Payment Amount Type: Paid Amount + +Behavior for commission settlements will be as per module description. diff --git a/sale_commission_partial_settlement/security/ir.model.access.csv b/sale_commission_partial_settlement/security/ir.model.access.csv new file mode 100644 index 000000000..4c54861bb --- /dev/null +++ b/sale_commission_partial_settlement/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_account_invoice_line_agent_partial,access_account_invoice_line_agent_partial,model_account_invoice_line_agent_partial,sales_team.group_sale_salesman,1,1,1,1 +access_account_invoice_line_agent_partial_user,access_account_invoice_line_agent_partial_user,model_account_invoice_line_agent_partial,base.group_user,1,0,0,0 diff --git a/sale_commission_partial_settlement/static/description/icon.png b/sale_commission_partial_settlement/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..0539927894add59cc8db869b17fb5490c765a9b6 GIT binary patch literal 19238 zcmXtf1ymf(6X)WKy9R>8;+o*@5Zsp_i@UqKyE_C81SbS{cMSwxT!K3UJHG$j&3irl zW~RF8S3TX+Rb4evDoQfwC?qHV003Q1R#NS~4*ahG5#P`K!jSRz3f@IrP6POU_ySEM z->;D!Wp!QN>6iX1Fyf#b&-a_eu2MR#>JH|v9uQ|UfQN?%tChWtiwVThjMc%}BIity ziiFbgQJ(Tm4&4%Kth6@LdDJ4*2;uJ z(!mb$4qDR8^j)X_A^cD5yHu0^A$B)2aj>&zE#1twX^f?Z%vKCLUlSkb-hh9LId~rrap9g2SXl36oR<+t@(4pP^tig>^6qmYPE6k4hUapR@Wk zpO@jdk-g4|s>%%-{C|04DY|S_)Kok7o!!v;=Cu#O-C0yM#^m=^hJ(MOj9zcs;Leqg zHUrd4+LBOa_S%^Z(|CJe5kX@ftJ=83=cQ7_Z=NFyKj(K5foq)2yc( z;SBCGG1C$Z!v*|>MNc=t0L>Qg2?P3k@VCtY;7(uTbk&6EOYd0H(N#N+hAj$w&gd~@ zf0CZ^G3z0RtA&e)L!MvUUQWk)s76@2ciKb>Tpjc4W<`>Ol?f8rT)_*t_|&5pClExN z|G}m(aEa6I8=WD;#TyJ1Gk5=(U^7v+qwnMX5ktV$twoOqz(%m00?V`DZ3(qzk8<-M z(1GFpC1+r-286>KbAK?Mdi7&zI8b|2tT4ayc&SI3wI%%Hg+R~!Hp^P08<}B>T3o)e zqnR1F5c33}CwkA=wG#-1>%zCZoN$3fUPJpy`1RVaM+7cEf&Q1W&5fZ$m&BICR5SCR zVVG4<+$WGDGG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nNT2+O5er#1S_wHM|o;mNroG zJ0~!dr8m`RW%8C{v{Xg&o;9rpn|s!>yhB51t**T;EY#YzGh101Xxol$He0vdOh0`Z zICbijb*b>%XXf8#`Zxn%o6NQ=Kydo>X*zZ46waJEvki#j$AP+DrpuQHRM+oNS@vml zb)CGg$qzSaR91B005BR&2-uJDctSuvf_uHY#$eDlU=53leOp}x78mE%whMNkomqQe z*_vizv)MsAdUR~(&H?M|>-N9{SMB=sV+H`{&!4x<@JzIw#Q1pACjtOB&@Roe1qcAh zpa6iCmGcBViVGJm(DCEI#fw)7IEDuS;6dQ><+pEI_tB$w833F+m;b)+zI6kD&CLh8 zi~T3In7voRyPNuiF#JaPBm&?@%D=qr{q0YmKE1uR43JD`&K$etnopiQX~603`#bON lX7tu2x4gIydCwmk`d_A + + + + + +Sales commissions based on paid amount + + + +

+

Sales commissions based on paid amount

+ + +

Beta License: AGPL-3 OCA/commission Translate me on Weblate Try me on Runboat

+

This module allows to settle commissions based on paid amount.

+

Table of contents

+ +
+

Usage

+
    +
  • Go to Sales > Commissions Management > Commission Types > create or open a record
  • +
  • Select Invoice Status: Payment Based
  • +
  • Select Payment Amount Type: Paid Amount
  • +
+

Behavior for commission settlements will be as per module description.

+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Nextev Srl
  • +
  • Ooops
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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.

+

This module is part of the OCA/commission project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/sale_commission_partial_settlement/tests/__init__.py b/sale_commission_partial_settlement/tests/__init__.py new file mode 100644 index 000000000..24d61ccf8 --- /dev/null +++ b/sale_commission_partial_settlement/tests/__init__.py @@ -0,0 +1 @@ +from . import test_partial_settlement diff --git a/sale_commission_partial_settlement/tests/test_partial_settlement.py b/sale_commission_partial_settlement/tests/test_partial_settlement.py new file mode 100644 index 000000000..66ba38ea4 --- /dev/null +++ b/sale_commission_partial_settlement/tests/test_partial_settlement.py @@ -0,0 +1,266 @@ +# Copyright 2023 Nextev +# License AGPL-3 - See https://www.gnu.org/licenses/agpl-3.0.html + +from datetime import datetime + +from dateutil.relativedelta import relativedelta + +from odoo import fields +from odoo.tests.common import SavepointCase + + +class TestPartialSettlement(SavepointCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.commission_model = cls.env["sale.commission"] + cls.partial_commission_net_paid = cls.commission_model.create( + { + "name": "20% fixed commission (Net amount) - Payment Based - Partial", + "fix_qty": 20.0, + "invoice_state": "paid", + "amount_base_type": "net_amount", + "payment_amount_type": "paid", + } + ) + cls.company = cls.env.ref("base.main_company") + cls.res_partner_model = cls.env["res.partner"] + cls.partner = cls.env.ref("base.res_partner_2") + cls.partner.write({"agent": False}) + cls.sale_order_model = cls.env["sale.order"] + cls.advance_inv_model = cls.env["sale.advance.payment.inv"] + cls.settle_model = cls.env["sale.commission.settlement"] + cls.make_settle_model = cls.env["sale.commission.make.settle"] + cls.make_inv_model = cls.env["sale.commission.make.invoice"] + cls.product = cls.env.ref("product.product_product_5") + cls.product.list_price = 5 # for testing specific commission section + cls.commission_product = cls.env["product.product"].create( + {"name": "Commission test product", "type": "service"} + ) + cls.product.write({"invoice_policy": "order"}) + cls.journal = cls.env["account.journal"].search( + [("type", "=", "purchase")], limit=1 + ) + cls.agent_monthly = cls.res_partner_model.create( + { + "name": "Test Agent - Monthly", + "agent": True, + "settlement": "monthly", + "lang": "en_US", + "commission_id": cls.partial_commission_net_paid.id, + } + ) + cls.income_account = cls.env["account.account"].search( + [ + ("company_id", "=", cls.company.id), + ("user_type_id.name", "=", "Income"), + ], + limit=1, + ) + cls.commission_net_invoice = cls.commission_model.create( + { + "name": "10% fixed commission (Net amount) - Invoice Based", + "fix_qty": 10.0, + "amount_base_type": "net_amount", + } + ) + cls.agent_biweekly = cls.res_partner_model.create( + { + "name": "Test Agent - Bi-weekly", + "agent": True, + "settlement": "biweekly", + "lang": "en_US", + "commission_id": cls.commission_net_invoice.id, + } + ) + + def _create_multi_line_sale_order(self, agent, commission): + return self.sale_order_model.create( + { + "partner_id": self.partner.id, + "order_line": [ + ( + 0, + 0, + { + "name": self.product.name, + "product_id": self.product.id, + "product_uom_qty": 1.0, + "product_uom": self.ref("uom.product_uom_unit"), + "price_unit": self.product.lst_price, + "agent_ids": [ + ( + 0, + 0, + { + "agent_id": agent.id, + "commission_id": commission.id, + }, + ) + ], + }, + ), + ( + 0, + 0, + { + "name": self.product.name, + "product_id": self.product.id, + "product_uom_qty": 5.0, + "product_uom": self.ref("uom.product_uom_unit"), + "price_unit": self.product.lst_price, + "agent_ids": [ + ( + 0, + 0, + { + "agent_id": self.agent_monthly.id, + "commission_id": self.partial_commission_net_paid.id, + }, + ) + ], + }, + ), + ], + } + ) + + def _invoice_sale_order(self, sale_order, date=None): + old_invoices = sale_order.invoice_ids + wizard = self.advance_inv_model.create({"advance_payment_method": "delivered"}) + wizard.with_context( + { + "active_model": "sale.order", + "active_ids": [sale_order.id], + "active_id": sale_order.id, + } + ).create_invoices() + invoice = sale_order.invoice_ids - old_invoices + invoice.flush() + return invoice + + def _settle_agent(self, agent=None, period=None, date=None, date_payment_to=None): + vals = { + "date_to": ( + fields.Datetime.from_string(fields.Datetime.now()) + + relativedelta(months=period) + ) + if period + else date, + "date_payment_to": date_payment_to, + } + if agent: + vals["agent_ids"] = [(4, agent.id)] + wizard = self.make_settle_model.create(vals) + wizard.action_settle() + + def register_payment( + self, + invoice, + payment_date, + amount=None, + payment_difference_handling="reconcile", + ): + payment_model = self.env["account.payment.register"] + invoice.action_post() + if not amount: + amount = invoice.amount_total + ctx = { + "active_model": "account.move", + "active_ids": [invoice.id], + } + return ( + payment_model.with_context(ctx) + .create( + { + "payment_date": payment_date, + "amount": amount, + "journal_id": self.env["account.journal"] + .search([("type", "=", "bank")], limit=1) + .id, + "payment_method_id": self.env.ref( + "account.account_payment_method_manual_out" + ).id, + "payment_difference_handling": payment_difference_handling, + } + ) + .action_create_payments() + ) + + def test_partial_payment_amount_settlement(self): + sale_order = self._create_multi_line_sale_order( + self.agent_monthly, self.partial_commission_net_paid + ) + sale_order.action_confirm() + date = fields.Date.today() + invoice = self._invoice_sale_order(sale_order) + partial_amount = invoice.amount_total / 3 + self.register_payment( + invoice, + date + relativedelta(days=-2), + amount=partial_amount, + payment_difference_handling="open", + ) + self.assertTrue(invoice._get_reconciled_invoices_partials()) + self._settle_agent(self.agent_monthly, 1, date_payment_to=datetime.now()) + settlements = self.env["sale.commission.settlement"].search( + [ + ( + "agent_id", + "=", + self.agent_monthly.id, + ), + ("state", "=", "settled"), + ] + ) + self.assertEqual(1, len(settlements)) + self.assertEqual(2, len(settlements.line_ids)) + self.assertEqual(2, len(invoice.line_ids.agent_ids)) + + def test_skip_partial_future_payment(self): + sale_order = self._create_multi_line_sale_order( + self.agent_monthly, self.partial_commission_net_paid + ) + sale_order.action_confirm() + date = fields.Date.today() + invoice = self._invoice_sale_order(sale_order) + self.register_payment( + invoice, + date + relativedelta(days=2), + ) + self._settle_agent(self.agent_monthly, 1, date_payment_to=datetime.now()) + settlements = self.env["sale.commission.settlement"].search( + [ + ( + "agent_id", + "=", + self.agent_monthly.id, + ), + ("state", "=", "settled"), + ] + ) + self.assertEqual(0, len(settlements)) + + def test_multi_agents_settlement(self): + agent_net = self.agent_biweekly + commission_net = self.commission_net_invoice + agent_partial = self.agent_monthly + commission_partial = self.partial_commission_net_paid + sale_order = self._create_multi_line_sale_order(agent_net, commission_net) + sale_order.action_confirm() + invoice = self._invoice_sale_order(sale_order) + invoice.action_post() + sale_order2 = self._create_multi_line_sale_order( + agent_partial, commission_partial + ) + sale_order2.action_confirm() + invoice2 = self._invoice_sale_order(sale_order2) + self.register_payment( + invoice2, + fields.Date.today() + relativedelta(days=-2), + ) + self._settle_agent(period=1) + settlements = self.settle_model.search( + [("agent_id", "in", [agent_net.id, agent_partial.id])] + ) + self.assertEqual(len(settlements), 2) diff --git a/sale_commission_partial_settlement/views/sale_commission_view.xml b/sale_commission_partial_settlement/views/sale_commission_view.xml new file mode 100644 index 000000000..b82c7b9d1 --- /dev/null +++ b/sale_commission_partial_settlement/views/sale_commission_view.xml @@ -0,0 +1,16 @@ + + + + sale.commission.payment.amount.form + sale.commission + + + + + + + + diff --git a/sale_commission_partial_settlement/wizard/__init__.py b/sale_commission_partial_settlement/wizard/__init__.py new file mode 100644 index 000000000..4cea8c746 --- /dev/null +++ b/sale_commission_partial_settlement/wizard/__init__.py @@ -0,0 +1 @@ +from . import wizard_settle diff --git a/sale_commission_partial_settlement/wizard/wizard_settle.py b/sale_commission_partial_settlement/wizard/wizard_settle.py new file mode 100644 index 000000000..5c271e5e1 --- /dev/null +++ b/sale_commission_partial_settlement/wizard/wizard_settle.py @@ -0,0 +1,100 @@ +# Copyright 2023 Nextev +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from datetime import date + +from dateutil.relativedelta import relativedelta + +from odoo import _, models + + +class SaleCommissionMakeSettle(models.TransientModel): + _inherit = "sale.commission.make.settle" + + def action_settle(self): + partial_res = self.action_settle_partial() + res = super().action_settle() + if partial_res and res: + partial_res["domain"][0][2] += res["domain"][0][2] + return partial_res + return res if res else partial_res + + def action_settle_partial(self): + self.ensure_one() + settlement_obj = self.env["sale.commission.settlement"] + settlement_line_obj = self.env["sale.commission.settlement.line"] + settlement_ids = [] + + if self.agent_ids: + agents = self.agent_ids + else: + agents = self.env["res.partner"].search([("agent", "=", True)]) + date_to = self.date_to + for agent in agents: + date_to_agent = self._get_period_start(agent, date_to) + main_agent_line = self.get_partial_agent_lines(agent, date_to_agent) + ( + partial_agent_lines, + agent_lines_to_update, + ) = main_agent_line._partial_commissions(self.date_payment_to) + for line_id in agent_lines_to_update: + self.env["account.invoice.line.agent"].browse(line_id).update( + agent_lines_to_update[line_id] + ) + for company in partial_agent_lines.mapped( + "invoice_line_agent_id.company_id" + ): + agent_lines_company = partial_agent_lines.filtered( + lambda r: r.invoice_line_agent_id.object_id.company_id == company + ) + sett_to = date.min + for line in agent_lines_company: + if line.invoice_line_agent_id.invoice_date > sett_to: + sett_from = self._get_period_start( + agent, line.invoice_line_agent_id.invoice_date + ) + sett_to = self._get_next_period_date( + agent, + sett_from, + ) - relativedelta(days=1) + settlement = self._get_settlement( + agent, company, sett_from, sett_to + ) + if not settlement: + settlement = settlement_obj.create( + self._prepare_settlement_vals( + agent, company, sett_from, sett_to + ) + ) + settlement_ids.append(settlement.id) + settlement_line_obj.create( + { + "settlement_id": settlement.id, + "agent_line_partial_ids": [(6, 0, [line.id])], + "agent_line": [(6, 0, [line.invoice_line_agent_id.id])], + } + ) + if len(settlement_ids): + return { + "name": _("Created Settlements"), + "type": "ir.actions.act_window", + "view_type": "form", + "view_mode": "tree,form", + "res_model": "sale.commission.settlement", + "domain": [["id", "in", settlement_ids]], + } + + def _get_agent_lines(self, agent, date_to_agent): + aila = super()._get_agent_lines(agent, date_to_agent) + return aila.filtered(lambda x: x.commission_id.payment_amount_type != "paid") + + def get_partial_agent_lines(self, agent, date_to_agent): + main_agent_line = self.env["account.invoice.line.agent"].search( + [ + ("invoice_date", "<", date_to_agent), + ("agent_id", "=", agent.id), + ("settled", "=", False), + ("commission_id.payment_amount_type", "=", "paid"), + ], + order="invoice_date", + ) + return main_agent_line From 04722e83df804bb1d4af9b480b4e2c9be064e614 Mon Sep 17 00:00:00 2001 From: oca-ci Date: Wed, 13 Dec 2023 11:26:04 +0000 Subject: [PATCH 02/12] [UPD] Update sale_commission_partial_settlement.pot --- .../sale_commission_partial_settlement.pot | 160 ++++++++++++++++++ 1 file changed, 160 insertions(+) create mode 100644 sale_commission_partial_settlement/i18n/sale_commission_partial_settlement.pot diff --git a/sale_commission_partial_settlement/i18n/sale_commission_partial_settlement.pot b/sale_commission_partial_settlement/i18n/sale_commission_partial_settlement.pot new file mode 100644 index 000000000..f0c1cd2ab --- /dev/null +++ b/sale_commission_partial_settlement/i18n/sale_commission_partial_settlement.pot @@ -0,0 +1,160 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_commission_partial_settlement +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__agent_line +msgid "Agent Line" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_settlement_line__agent_line_partial_ids +msgid "Agent Line Partial" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model,name:sale_commission_partial_settlement.model_account_invoice_line_agent +msgid "Agent detail of commission line in invoice lines" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__amount +msgid "Commission Amount" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model,name:sale_commission_partial_settlement.model_sale_commission +msgid "Commission in sales" +msgstr "" + +#. module: sale_commission_partial_settlement +#: code:addons/sale_commission_partial_settlement/wizard/wizard_settle.py:0 +#, python-format +msgid "Created Settlements" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__create_uid +msgid "Created by" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__create_date +msgid "Created on" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__currency_id +msgid "Currency" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent__display_name +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__display_name +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_partial_reconcile__display_name +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission__display_name +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_make_settle__display_name +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_settlement_line__display_name +msgid "Display Name" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields.selection,name:sale_commission_partial_settlement.selection__sale_commission__payment_amount_type__full +msgid "Full amount" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent__id +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__id +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_partial_reconcile__id +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission__id +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_make_settle__id +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_settlement_line__id +msgid "ID" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__invoice_line_agent_id +msgid "Invoice Line Agent" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent____last_update +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial____last_update +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_partial_reconcile____last_update +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission____last_update +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_make_settle____last_update +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_settlement_line____last_update +msgid "Last Modified on" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__write_date +msgid "Last Updated on" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model,name:sale_commission_partial_settlement.model_sale_commission_settlement_line +msgid "Line of a commission settlement" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields.selection,name:sale_commission_partial_settlement.selection__sale_commission__payment_amount_type__paid +msgid "Paid amount" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent__partial_settled +msgid "Partial Commission Amount Settled" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_partial_reconcile__partial_commission_settled +msgid "Partial Commission Settled" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model,name:sale_commission_partial_settlement.model_account_partial_reconcile +msgid "Partial Reconcile" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model,name:sale_commission_partial_settlement.model_account_invoice_line_agent_partial +msgid "Partial agent commissions" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission__payment_amount_type +msgid "Payment amount type" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__settled +msgid "Settled" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_settlement_line__settled_amount +msgid "Settled Amount" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model,name:sale_commission_partial_settlement.model_sale_commission_make_settle +msgid "Wizard for settling commissions in invoices" +msgstr "" From 1688f609a3d24c16f5e8f55331bf263989a7621c Mon Sep 17 00:00:00 2001 From: Ivorra78 Date: Wed, 13 Dec 2023 12:34:35 +0000 Subject: [PATCH 03/12] Added translation using Weblate (Spanish) --- sale_commission_partial_settlement/i18n/es.po | 161 ++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 sale_commission_partial_settlement/i18n/es.po diff --git a/sale_commission_partial_settlement/i18n/es.po b/sale_commission_partial_settlement/i18n/es.po new file mode 100644 index 000000000..0c6f0b389 --- /dev/null +++ b/sale_commission_partial_settlement/i18n/es.po @@ -0,0 +1,161 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_commission_partial_settlement +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__agent_line +msgid "Agent Line" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_settlement_line__agent_line_partial_ids +msgid "Agent Line Partial" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model,name:sale_commission_partial_settlement.model_account_invoice_line_agent +msgid "Agent detail of commission line in invoice lines" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__amount +msgid "Commission Amount" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model,name:sale_commission_partial_settlement.model_sale_commission +msgid "Commission in sales" +msgstr "" + +#. module: sale_commission_partial_settlement +#: code:addons/sale_commission_partial_settlement/wizard/wizard_settle.py:0 +#, python-format +msgid "Created Settlements" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__create_uid +msgid "Created by" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__create_date +msgid "Created on" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__currency_id +msgid "Currency" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent__display_name +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__display_name +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_partial_reconcile__display_name +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission__display_name +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_make_settle__display_name +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_settlement_line__display_name +msgid "Display Name" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields.selection,name:sale_commission_partial_settlement.selection__sale_commission__payment_amount_type__full +msgid "Full amount" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent__id +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__id +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_partial_reconcile__id +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission__id +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_make_settle__id +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_settlement_line__id +msgid "ID" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__invoice_line_agent_id +msgid "Invoice Line Agent" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent____last_update +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial____last_update +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_partial_reconcile____last_update +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission____last_update +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_make_settle____last_update +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_settlement_line____last_update +msgid "Last Modified on" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__write_date +msgid "Last Updated on" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model,name:sale_commission_partial_settlement.model_sale_commission_settlement_line +msgid "Line of a commission settlement" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields.selection,name:sale_commission_partial_settlement.selection__sale_commission__payment_amount_type__paid +msgid "Paid amount" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent__partial_settled +msgid "Partial Commission Amount Settled" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_partial_reconcile__partial_commission_settled +msgid "Partial Commission Settled" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model,name:sale_commission_partial_settlement.model_account_partial_reconcile +msgid "Partial Reconcile" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model,name:sale_commission_partial_settlement.model_account_invoice_line_agent_partial +msgid "Partial agent commissions" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission__payment_amount_type +msgid "Payment amount type" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__settled +msgid "Settled" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_settlement_line__settled_amount +msgid "Settled Amount" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model,name:sale_commission_partial_settlement.model_sale_commission_make_settle +msgid "Wizard for settling commissions in invoices" +msgstr "" From 5eed4cbf76ed3d525a8198cd482f879d01258228 Mon Sep 17 00:00:00 2001 From: Ivorra78 Date: Wed, 13 Dec 2023 12:34:54 +0000 Subject: [PATCH 04/12] Translated using Weblate (Spanish) Currently translated at 11.5% (3 of 26 strings) Translation: commission-14.0/commission-14.0-sale_commission_partial_settlement Translate-URL: https://translation.odoo-community.org/projects/commission-14-0/commission-14-0-sale_commission_partial_settlement/es/ --- sale_commission_partial_settlement/i18n/es.po | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sale_commission_partial_settlement/i18n/es.po b/sale_commission_partial_settlement/i18n/es.po index 0c6f0b389..43b5dc5c2 100644 --- a/sale_commission_partial_settlement/i18n/es.po +++ b/sale_commission_partial_settlement/i18n/es.po @@ -6,28 +6,30 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2023-12-13 12:35+0000\n" +"Last-Translator: Ivorra78 \n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__agent_line msgid "Agent Line" -msgstr "" +msgstr "Línea de Agente" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_settlement_line__agent_line_partial_ids msgid "Agent Line Partial" -msgstr "" +msgstr "Agente Línea Parcial" #. module: sale_commission_partial_settlement #: model:ir.model,name:sale_commission_partial_settlement.model_account_invoice_line_agent msgid "Agent detail of commission line in invoice lines" -msgstr "" +msgstr "Detalle de agente de línea de comisión en líneas de pedido" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__amount From 686fddce688023064f3c629db477aa481b4aaaee Mon Sep 17 00:00:00 2001 From: Ivorra78 Date: Wed, 13 Dec 2023 12:35:48 +0000 Subject: [PATCH 05/12] Translated using Weblate (Spanish) Currently translated at 100.0% (26 of 26 strings) Translation: commission-14.0/commission-14.0-sale_commission_partial_settlement Translate-URL: https://translation.odoo-community.org/projects/commission-14-0/commission-14-0-sale_commission_partial_settlement/es/ --- sale_commission_partial_settlement/i18n/es.po | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/sale_commission_partial_settlement/i18n/es.po b/sale_commission_partial_settlement/i18n/es.po index 43b5dc5c2..d260ab6af 100644 --- a/sale_commission_partial_settlement/i18n/es.po +++ b/sale_commission_partial_settlement/i18n/es.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2023-12-13 12:35+0000\n" +"PO-Revision-Date: 2023-12-13 15:35+0000\n" "Last-Translator: Ivorra78 \n" "Language-Team: none\n" "Language: es\n" @@ -34,33 +34,33 @@ msgstr "Detalle de agente de línea de comisión en líneas de pedido" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__amount msgid "Commission Amount" -msgstr "" +msgstr "Importe de la Comisión" #. module: sale_commission_partial_settlement #: model:ir.model,name:sale_commission_partial_settlement.model_sale_commission msgid "Commission in sales" -msgstr "" +msgstr "Comisión en ventas" #. module: sale_commission_partial_settlement #: code:addons/sale_commission_partial_settlement/wizard/wizard_settle.py:0 #, python-format msgid "Created Settlements" -msgstr "" +msgstr "Liquidaciones Creadas" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__create_uid msgid "Created by" -msgstr "" +msgstr "Creado por" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__create_date msgid "Created on" -msgstr "" +msgstr "Creado el" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__currency_id msgid "Currency" -msgstr "" +msgstr "Divisa" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent__display_name @@ -70,12 +70,12 @@ msgstr "" #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_make_settle__display_name #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_settlement_line__display_name msgid "Display Name" -msgstr "" +msgstr "Nombre a Mostrar" #. module: sale_commission_partial_settlement #: model:ir.model.fields.selection,name:sale_commission_partial_settlement.selection__sale_commission__payment_amount_type__full msgid "Full amount" -msgstr "" +msgstr "Importe total" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent__id @@ -85,12 +85,12 @@ msgstr "" #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_make_settle__id #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_settlement_line__id msgid "ID" -msgstr "" +msgstr "ID" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__invoice_line_agent_id msgid "Invoice Line Agent" -msgstr "" +msgstr "Agente de Línea de Facturación" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent____last_update @@ -100,64 +100,64 @@ msgstr "" #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_make_settle____last_update #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_settlement_line____last_update msgid "Last Modified on" -msgstr "" +msgstr "Última Modificación el" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__write_uid msgid "Last Updated by" -msgstr "" +msgstr "Última Actualización por" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__write_date msgid "Last Updated on" -msgstr "" +msgstr "Última Actualización el" #. module: sale_commission_partial_settlement #: model:ir.model,name:sale_commission_partial_settlement.model_sale_commission_settlement_line msgid "Line of a commission settlement" -msgstr "" +msgstr "Línea de liquidación de comisión" #. module: sale_commission_partial_settlement #: model:ir.model.fields.selection,name:sale_commission_partial_settlement.selection__sale_commission__payment_amount_type__paid msgid "Paid amount" -msgstr "" +msgstr "Importe pagado" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent__partial_settled msgid "Partial Commission Amount Settled" -msgstr "" +msgstr "Comisión Parcial Importe liquidado" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_partial_reconcile__partial_commission_settled msgid "Partial Commission Settled" -msgstr "" +msgstr "Comisión Parcial Liquidada" #. module: sale_commission_partial_settlement #: model:ir.model,name:sale_commission_partial_settlement.model_account_partial_reconcile msgid "Partial Reconcile" -msgstr "" +msgstr "Conciliación Parcial" #. module: sale_commission_partial_settlement #: model:ir.model,name:sale_commission_partial_settlement.model_account_invoice_line_agent_partial msgid "Partial agent commissions" -msgstr "" +msgstr "Comisiones parciales de agente" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission__payment_amount_type msgid "Payment amount type" -msgstr "" +msgstr "Tipo de importe del pago" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__settled msgid "Settled" -msgstr "" +msgstr "Liquidado" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_settlement_line__settled_amount msgid "Settled Amount" -msgstr "" +msgstr "Importe Liquidado" #. module: sale_commission_partial_settlement #: model:ir.model,name:sale_commission_partial_settlement.model_sale_commission_make_settle msgid "Wizard for settling commissions in invoices" -msgstr "" +msgstr "Asistente para liquidar comisiones en facturas" From 6991d40a82a6cc34bddca18f541063f315247470 Mon Sep 17 00:00:00 2001 From: Francesco Foresti Date: Thu, 14 Dec 2023 09:08:09 +0000 Subject: [PATCH 06/12] Added translation using Weblate (Italian) --- sale_commission_partial_settlement/i18n/it.po | 161 ++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 sale_commission_partial_settlement/i18n/it.po diff --git a/sale_commission_partial_settlement/i18n/it.po b/sale_commission_partial_settlement/i18n/it.po new file mode 100644 index 000000000..6709db463 --- /dev/null +++ b/sale_commission_partial_settlement/i18n/it.po @@ -0,0 +1,161 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_commission_partial_settlement +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__agent_line +msgid "Agent Line" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_settlement_line__agent_line_partial_ids +msgid "Agent Line Partial" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model,name:sale_commission_partial_settlement.model_account_invoice_line_agent +msgid "Agent detail of commission line in invoice lines" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__amount +msgid "Commission Amount" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model,name:sale_commission_partial_settlement.model_sale_commission +msgid "Commission in sales" +msgstr "" + +#. module: sale_commission_partial_settlement +#: code:addons/sale_commission_partial_settlement/wizard/wizard_settle.py:0 +#, python-format +msgid "Created Settlements" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__create_uid +msgid "Created by" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__create_date +msgid "Created on" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__currency_id +msgid "Currency" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent__display_name +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__display_name +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_partial_reconcile__display_name +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission__display_name +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_make_settle__display_name +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_settlement_line__display_name +msgid "Display Name" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields.selection,name:sale_commission_partial_settlement.selection__sale_commission__payment_amount_type__full +msgid "Full amount" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent__id +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__id +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_partial_reconcile__id +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission__id +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_make_settle__id +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_settlement_line__id +msgid "ID" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__invoice_line_agent_id +msgid "Invoice Line Agent" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent____last_update +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial____last_update +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_partial_reconcile____last_update +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission____last_update +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_make_settle____last_update +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_settlement_line____last_update +msgid "Last Modified on" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__write_date +msgid "Last Updated on" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model,name:sale_commission_partial_settlement.model_sale_commission_settlement_line +msgid "Line of a commission settlement" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields.selection,name:sale_commission_partial_settlement.selection__sale_commission__payment_amount_type__paid +msgid "Paid amount" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent__partial_settled +msgid "Partial Commission Amount Settled" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_partial_reconcile__partial_commission_settled +msgid "Partial Commission Settled" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model,name:sale_commission_partial_settlement.model_account_partial_reconcile +msgid "Partial Reconcile" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model,name:sale_commission_partial_settlement.model_account_invoice_line_agent_partial +msgid "Partial agent commissions" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission__payment_amount_type +msgid "Payment amount type" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__settled +msgid "Settled" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_settlement_line__settled_amount +msgid "Settled Amount" +msgstr "" + +#. module: sale_commission_partial_settlement +#: model:ir.model,name:sale_commission_partial_settlement.model_sale_commission_make_settle +msgid "Wizard for settling commissions in invoices" +msgstr "" From 08e15d448182e393f7740892cf9a91c707c4bb08 Mon Sep 17 00:00:00 2001 From: Francesco Foresti Date: Thu, 14 Dec 2023 09:08:31 +0000 Subject: [PATCH 07/12] Translated using Weblate (Italian) Currently translated at 100.0% (26 of 26 strings) Translation: commission-14.0/commission-14.0-sale_commission_partial_settlement Translate-URL: https://translation.odoo-community.org/projects/commission-14-0/commission-14-0-sale_commission_partial_settlement/it/ --- sale_commission_partial_settlement/i18n/it.po | 56 ++++++++++--------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/sale_commission_partial_settlement/i18n/it.po b/sale_commission_partial_settlement/i18n/it.po index 6709db463..0e2641540 100644 --- a/sale_commission_partial_settlement/i18n/it.po +++ b/sale_commission_partial_settlement/i18n/it.po @@ -6,59 +6,61 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2023-12-14 11:35+0000\n" +"Last-Translator: Francesco Foresti \n" "Language-Team: none\n" "Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__agent_line msgid "Agent Line" -msgstr "" +msgstr "Riga agente" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_settlement_line__agent_line_partial_ids msgid "Agent Line Partial" -msgstr "" +msgstr "Riga agente parziale" #. module: sale_commission_partial_settlement #: model:ir.model,name:sale_commission_partial_settlement.model_account_invoice_line_agent msgid "Agent detail of commission line in invoice lines" -msgstr "" +msgstr "Dettaglio riga provvigione agente nelle righe fattura" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__amount msgid "Commission Amount" -msgstr "" +msgstr "Importo provvigione" #. module: sale_commission_partial_settlement #: model:ir.model,name:sale_commission_partial_settlement.model_sale_commission msgid "Commission in sales" -msgstr "" +msgstr "Provvigione nelle vendite" #. module: sale_commission_partial_settlement #: code:addons/sale_commission_partial_settlement/wizard/wizard_settle.py:0 #, python-format msgid "Created Settlements" -msgstr "" +msgstr "Regolazioni create" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__create_uid msgid "Created by" -msgstr "" +msgstr "Creato da" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__create_date msgid "Created on" -msgstr "" +msgstr "Creato il" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__currency_id msgid "Currency" -msgstr "" +msgstr "Valuta" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent__display_name @@ -68,12 +70,12 @@ msgstr "" #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_make_settle__display_name #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_settlement_line__display_name msgid "Display Name" -msgstr "" +msgstr "Nome visualizzato" #. module: sale_commission_partial_settlement #: model:ir.model.fields.selection,name:sale_commission_partial_settlement.selection__sale_commission__payment_amount_type__full msgid "Full amount" -msgstr "" +msgstr "Importo totale" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent__id @@ -83,12 +85,12 @@ msgstr "" #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_make_settle__id #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_settlement_line__id msgid "ID" -msgstr "" +msgstr "ID" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__invoice_line_agent_id msgid "Invoice Line Agent" -msgstr "" +msgstr "Riga fattura agente" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent____last_update @@ -98,64 +100,64 @@ msgstr "" #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_make_settle____last_update #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_settlement_line____last_update msgid "Last Modified on" -msgstr "" +msgstr "Ultima modifica il" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__write_uid msgid "Last Updated by" -msgstr "" +msgstr "Ultimo aggiornamento di" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__write_date msgid "Last Updated on" -msgstr "" +msgstr "Ultimo aggiornamento il" #. module: sale_commission_partial_settlement #: model:ir.model,name:sale_commission_partial_settlement.model_sale_commission_settlement_line msgid "Line of a commission settlement" -msgstr "" +msgstr "Riga di regolazione provvigione" #. module: sale_commission_partial_settlement #: model:ir.model.fields.selection,name:sale_commission_partial_settlement.selection__sale_commission__payment_amount_type__paid msgid "Paid amount" -msgstr "" +msgstr "Importo pagato" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent__partial_settled msgid "Partial Commission Amount Settled" -msgstr "" +msgstr "Importo parziale provvigione regolata" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_partial_reconcile__partial_commission_settled msgid "Partial Commission Settled" -msgstr "" +msgstr "Provvigione parziale regolata" #. module: sale_commission_partial_settlement #: model:ir.model,name:sale_commission_partial_settlement.model_account_partial_reconcile msgid "Partial Reconcile" -msgstr "" +msgstr "Riconciliazione parziale" #. module: sale_commission_partial_settlement #: model:ir.model,name:sale_commission_partial_settlement.model_account_invoice_line_agent_partial msgid "Partial agent commissions" -msgstr "" +msgstr "Provvigioni parziali agente" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission__payment_amount_type msgid "Payment amount type" -msgstr "" +msgstr "Tipo importo pagamento" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__settled msgid "Settled" -msgstr "" +msgstr "Regolata" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_settlement_line__settled_amount msgid "Settled Amount" -msgstr "" +msgstr "Importo regolato" #. module: sale_commission_partial_settlement #: model:ir.model,name:sale_commission_partial_settlement.model_sale_commission_make_settle msgid "Wizard for settling commissions in invoices" -msgstr "" +msgstr "Procedura per regolare le provvigioni nelle fatture" From 3ab51e81d9a2ae0d0f1ad6f0cc93e2fb0c6ba104 Mon Sep 17 00:00:00 2001 From: Alessio Renda Date: Thu, 25 Jul 2024 14:35:59 +0200 Subject: [PATCH 08/12] [FIX] sale_commission_partial_settlement: reset agent partial If the invoice line agent does not have any settlement --- .../migrations/14.0.1.0.1/post-migrate.py | 11 +++++++++++ .../models/account_move.py | 4 ++++ 2 files changed, 15 insertions(+) create mode 100644 sale_commission_partial_settlement/migrations/14.0.1.0.1/post-migrate.py diff --git a/sale_commission_partial_settlement/migrations/14.0.1.0.1/post-migrate.py b/sale_commission_partial_settlement/migrations/14.0.1.0.1/post-migrate.py new file mode 100644 index 000000000..626eae3f9 --- /dev/null +++ b/sale_commission_partial_settlement/migrations/14.0.1.0.1/post-migrate.py @@ -0,0 +1,11 @@ +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + env["account.invoice.line.agent"].search( + [ + ("settled", "=", True), + ("commission_id.payment_amount_type", "=", "paid"), + ] + )._compute_settled() diff --git a/sale_commission_partial_settlement/models/account_move.py b/sale_commission_partial_settlement/models/account_move.py index 4ba56f54c..a402c5ed3 100644 --- a/sale_commission_partial_settlement/models/account_move.py +++ b/sale_commission_partial_settlement/models/account_move.py @@ -13,6 +13,10 @@ def _compute_settled(self): filtered_lines = self.filtered( lambda x: x.commission_id.payment_amount_type != "paid" ) + for line in self - filtered_lines: + if not line.mapped("agent_line.settlement_id"): + line.settled = False + super(AccountInvoiceLineAgent, filtered_lines)._compute_settled() def _partial_commissions(self, date_payment_to): From b2551df09c45045fbb00e8f4af2d9116eb962cc7 Mon Sep 17 00:00:00 2001 From: Alessio Renda Date: Fri, 26 Jul 2024 08:52:51 +0200 Subject: [PATCH 09/12] [IMP] sale_commission_partial_settlement: add maintainers --- sale_commission_partial_settlement/README.rst | 14 ++++++++++++++ sale_commission_partial_settlement/__manifest__.py | 3 ++- .../static/description/index.html | 14 +++++++++----- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/sale_commission_partial_settlement/README.rst b/sale_commission_partial_settlement/README.rst index c6fc54a25..0602d5cf2 100644 --- a/sale_commission_partial_settlement/README.rst +++ b/sale_commission_partial_settlement/README.rst @@ -91,6 +91,20 @@ 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. +.. |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 `__: + +|maintainer-aleuffre| |maintainer-renda-dev| |maintainer-PicchiSeba| + This module is part of the `OCA/commission `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/sale_commission_partial_settlement/__manifest__.py b/sale_commission_partial_settlement/__manifest__.py index 0ba779b5e..1b98f3e68 100644 --- a/sale_commission_partial_settlement/__manifest__.py +++ b/sale_commission_partial_settlement/__manifest__.py @@ -1,8 +1,9 @@ # Copyright 2023 Nextev { "name": "Sales commissions based on paid amount", - "version": "14.0.1.0.0", + "version": "14.0.1.0.1", "author": "Nextev Srl," "Ooops," "Odoo Community Association (OCA)", + "maintainers": ["aleuffre", "renda-dev", "PicchiSeba"], "category": "Sales Management", "license": "AGPL-3", "depends": ["sale_commission"], diff --git a/sale_commission_partial_settlement/static/description/index.html b/sale_commission_partial_settlement/static/description/index.html index 7f9acbee0..46a622486 100644 --- a/sale_commission_partial_settlement/static/description/index.html +++ b/sale_commission_partial_settlement/static/description/index.html @@ -1,4 +1,3 @@ - @@ -9,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -275,7 +275,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -301,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -439,10 +439,14 @@

Contributors

Maintainers

This module is maintained by the OCA.

-Odoo Community Association + +Odoo Community Association +

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.

+

Current maintainers:

+

aleuffre renda-dev PicchiSeba

This module is part of the OCA/commission project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

From b4d87c8950a0f02cf55103c226980d83c56a38f9 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Mon, 29 Jul 2024 09:21:56 +0000 Subject: [PATCH 10/12] [BOT] post-merge updates --- sale_commission_partial_settlement/README.rst | 2 +- .../static/description/index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sale_commission_partial_settlement/README.rst b/sale_commission_partial_settlement/README.rst index 0602d5cf2..984415fd0 100644 --- a/sale_commission_partial_settlement/README.rst +++ b/sale_commission_partial_settlement/README.rst @@ -7,7 +7,7 @@ Sales commissions based on paid amount !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:2a9857c3cff391b9ed98fd4916c0b50b68872332e34bf4937b6d3705dbf2510d + !! source digest: sha256:72b8b9ff4225524c4105f059588ec2038649d39259909c6d43d8e7c4b62b06a2 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/sale_commission_partial_settlement/static/description/index.html b/sale_commission_partial_settlement/static/description/index.html index 46a622486..6bf4cbe3b 100644 --- a/sale_commission_partial_settlement/static/description/index.html +++ b/sale_commission_partial_settlement/static/description/index.html @@ -367,7 +367,7 @@

Sales commissions based on paid amount

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:2a9857c3cff391b9ed98fd4916c0b50b68872332e34bf4937b6d3705dbf2510d +!! source digest: sha256:72b8b9ff4225524c4105f059588ec2038649d39259909c6d43d8e7c4b62b06a2 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Beta License: AGPL-3 OCA/commission Translate me on Weblate Try me on Runboat

This module allows to settle commissions based on paid amount.

From 0bb7f3ed63d7477ae465ca027b8f3a19c5ffe4b1 Mon Sep 17 00:00:00 2001 From: David Alonso Date: Wed, 11 Sep 2024 15:27:54 +0200 Subject: [PATCH 11/12] [IMP] sale_commission_partial_settlement: pre-commit stuff --- .../odoo/addons/sale_commission_partial_settlement | 1 + setup/sale_commission_partial_settlement/setup.py | 6 ++++++ 2 files changed, 7 insertions(+) create mode 120000 setup/sale_commission_partial_settlement/odoo/addons/sale_commission_partial_settlement create mode 100644 setup/sale_commission_partial_settlement/setup.py diff --git a/setup/sale_commission_partial_settlement/odoo/addons/sale_commission_partial_settlement b/setup/sale_commission_partial_settlement/odoo/addons/sale_commission_partial_settlement new file mode 120000 index 000000000..952293879 --- /dev/null +++ b/setup/sale_commission_partial_settlement/odoo/addons/sale_commission_partial_settlement @@ -0,0 +1 @@ +../../../../sale_commission_partial_settlement \ No newline at end of file diff --git a/setup/sale_commission_partial_settlement/setup.py b/setup/sale_commission_partial_settlement/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/sale_commission_partial_settlement/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) From 3ae386148653fc4f60615a2e413691d556ef3afc Mon Sep 17 00:00:00 2001 From: David Alonso Date: Wed, 11 Sep 2024 20:01:21 +0200 Subject: [PATCH 12/12] [MIG] sale_commission_partial_settlement: Migration to 16.0 --- sale_commission_partial_settlement/README.rst | 10 +- .../__manifest__.py | 4 +- sale_commission_partial_settlement/i18n/es.po | 69 +++--- .../migrations/14.0.1.0.1/post-migrate.py | 11 - .../models/__init__.py | 7 +- ..._move.py => account_invoice_line_agent.py} | 45 +--- .../account_invoice_line_agent_partial.py | 22 ++ .../{sale_commission.py => commission.py} | 4 +- ...ement.py => commission_settlement_line.py} | 6 +- .../static/description/index.html | 17 +- .../tests/common.py | 183 +++++++++++++++ .../tests/test_partial_settlement.py | 208 +----------------- ...ommission_view.xml => commission_view.xml} | 8 +- .../wizard/__init__.py | 2 +- ...rd_settle.py => commission_make_settle.py} | 29 ++- .../models/sale.py | 2 +- 16 files changed, 294 insertions(+), 333 deletions(-) delete mode 100644 sale_commission_partial_settlement/migrations/14.0.1.0.1/post-migrate.py rename sale_commission_partial_settlement/models/{account_move.py => account_invoice_line_agent.py} (71%) create mode 100644 sale_commission_partial_settlement/models/account_invoice_line_agent_partial.py rename sale_commission_partial_settlement/models/{sale_commission.py => commission.py} (81%) rename sale_commission_partial_settlement/models/{settlement.py => commission_settlement_line.py} (81%) create mode 100644 sale_commission_partial_settlement/tests/common.py rename sale_commission_partial_settlement/views/{sale_commission_view.xml => commission_view.xml} (56%) rename sale_commission_partial_settlement/wizard/{wizard_settle.py => commission_make_settle.py} (79%) diff --git a/sale_commission_partial_settlement/README.rst b/sale_commission_partial_settlement/README.rst index 984415fd0..4cd76a036 100644 --- a/sale_commission_partial_settlement/README.rst +++ b/sale_commission_partial_settlement/README.rst @@ -17,13 +17,13 @@ Sales commissions based on paid amount :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcommission-lightgray.png?logo=github - :target: https://github.com/OCA/commission/tree/14.0/sale_commission_partial_settlement + :target: https://github.com/OCA/commission/tree/16.0/sale_commission_partial_settlement :alt: OCA/commission .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/commission-14-0/commission-14-0-sale_commission_partial_settlement + :target: https://translation.odoo-community.org/projects/commission-16-0/commission-16-0-sale_commission_partial_settlement :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/commission&target_branch=14.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/commission&target_branch=16.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -50,7 +50,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -105,6 +105,6 @@ Current `maintainers `__: |maintainer-aleuffre| |maintainer-renda-dev| |maintainer-PicchiSeba| -This module is part of the `OCA/commission `_ project on GitHub. +This module is part of the `OCA/commission `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/sale_commission_partial_settlement/__manifest__.py b/sale_commission_partial_settlement/__manifest__.py index 1b98f3e68..019f8ea1e 100644 --- a/sale_commission_partial_settlement/__manifest__.py +++ b/sale_commission_partial_settlement/__manifest__.py @@ -1,7 +1,7 @@ # Copyright 2023 Nextev { "name": "Sales commissions based on paid amount", - "version": "14.0.1.0.1", + "version": "16.0.1.0.0", "author": "Nextev Srl," "Ooops," "Odoo Community Association (OCA)", "maintainers": ["aleuffre", "renda-dev", "PicchiSeba"], "category": "Sales Management", @@ -10,7 +10,7 @@ "website": "https://github.com/OCA/commission", "data": [ "security/ir.model.access.csv", - "views/sale_commission_view.xml", + "views/commission_view.xml", ], "installable": True, } diff --git a/sale_commission_partial_settlement/i18n/es.po b/sale_commission_partial_settlement/i18n/es.po index d260ab6af..f97d4bd96 100644 --- a/sale_commission_partial_settlement/i18n/es.po +++ b/sale_commission_partial_settlement/i18n/es.po @@ -4,17 +4,16 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 14.0\n" +"Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2023-12-13 15:35+0000\n" -"Last-Translator: Ivorra78 \n" -"Language-Team: none\n" -"Language: es\n" +"POT-Creation-Date: 2024-09-13 07:50+0000\n" +"PO-Revision-Date: 2024-09-13 07:50+0000\n" +"Last-Translator: \n" +"Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.17\n" +"Plural-Forms: \n" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__agent_line @@ -22,27 +21,28 @@ msgid "Agent Line" msgstr "Línea de Agente" #. module: sale_commission_partial_settlement -#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_settlement_line__agent_line_partial_ids +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_commission_settlement_line__agent_line_partial_ids msgid "Agent Line Partial" -msgstr "Agente Línea Parcial" +msgstr "Línea de Agente Parcial" #. module: sale_commission_partial_settlement #: model:ir.model,name:sale_commission_partial_settlement.model_account_invoice_line_agent msgid "Agent detail of commission line in invoice lines" msgstr "Detalle de agente de línea de comisión en líneas de pedido" +#. module: sale_commission_partial_settlement +#: model:ir.model,name:sale_commission_partial_settlement.model_commission +msgid "Commission" +msgstr "Comisión" + #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__amount msgid "Commission Amount" msgstr "Importe de la Comisión" #. module: sale_commission_partial_settlement -#: model:ir.model,name:sale_commission_partial_settlement.model_sale_commission -msgid "Commission in sales" -msgstr "Comisión en ventas" - -#. module: sale_commission_partial_settlement -#: code:addons/sale_commission_partial_settlement/wizard/wizard_settle.py:0 +#. odoo-python +#: code:addons/sale_commission_partial_settlement/wizard/commission_make_settle.py:0 #, python-format msgid "Created Settlements" msgstr "Liquidaciones Creadas" @@ -63,29 +63,19 @@ msgid "Currency" msgstr "Divisa" #. module: sale_commission_partial_settlement -#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent__display_name #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__display_name -#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_partial_reconcile__display_name -#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission__display_name -#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_make_settle__display_name -#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_settlement_line__display_name msgid "Display Name" msgstr "Nombre a Mostrar" #. module: sale_commission_partial_settlement -#: model:ir.model.fields.selection,name:sale_commission_partial_settlement.selection__sale_commission__payment_amount_type__full +#: model:ir.model.fields.selection,name:sale_commission_partial_settlement.selection__commission__payment_amount_type__full msgid "Full amount" msgstr "Importe total" #. module: sale_commission_partial_settlement -#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent__id #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__id -#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_partial_reconcile__id -#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission__id -#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_make_settle__id -#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_settlement_line__id msgid "ID" -msgstr "ID" +msgstr "" #. module: sale_commission_partial_settlement #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial__invoice_line_agent_id @@ -93,12 +83,7 @@ msgid "Invoice Line Agent" msgstr "Agente de Línea de Facturación" #. module: sale_commission_partial_settlement -#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent____last_update #: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_invoice_line_agent_partial____last_update -#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_account_partial_reconcile____last_update -#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission____last_update -#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_make_settle____last_update -#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_settlement_line____last_update msgid "Last Modified on" msgstr "Última Modificación el" @@ -113,12 +98,12 @@ msgid "Last Updated on" msgstr "Última Actualización el" #. module: sale_commission_partial_settlement -#: model:ir.model,name:sale_commission_partial_settlement.model_sale_commission_settlement_line +#: model:ir.model,name:sale_commission_partial_settlement.model_commission_settlement_line msgid "Line of a commission settlement" -msgstr "Línea de liquidación de comisión" +msgstr "Línea de liquidación de una comisión" #. module: sale_commission_partial_settlement -#: model:ir.model.fields.selection,name:sale_commission_partial_settlement.selection__sale_commission__payment_amount_type__paid +#: model:ir.model.fields.selection,name:sale_commission_partial_settlement.selection__commission__payment_amount_type__paid msgid "Paid amount" msgstr "Importe pagado" @@ -135,7 +120,7 @@ msgstr "Comisión Parcial Liquidada" #. module: sale_commission_partial_settlement #: model:ir.model,name:sale_commission_partial_settlement.model_account_partial_reconcile msgid "Partial Reconcile" -msgstr "Conciliación Parcial" +msgstr "Conciliación parcial" #. module: sale_commission_partial_settlement #: model:ir.model,name:sale_commission_partial_settlement.model_account_invoice_line_agent_partial @@ -143,7 +128,7 @@ msgid "Partial agent commissions" msgstr "Comisiones parciales de agente" #. module: sale_commission_partial_settlement -#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission__payment_amount_type +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_commission__payment_amount_type msgid "Payment amount type" msgstr "Tipo de importe del pago" @@ -153,11 +138,11 @@ msgid "Settled" msgstr "Liquidado" #. module: sale_commission_partial_settlement -#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_sale_commission_settlement_line__settled_amount +#: model:ir.model.fields,field_description:sale_commission_partial_settlement.field_commission_settlement_line__settled_amount msgid "Settled Amount" -msgstr "Importe Liquidado" +msgstr "Cantidad Liquidada" #. module: sale_commission_partial_settlement -#: model:ir.model,name:sale_commission_partial_settlement.model_sale_commission_make_settle -msgid "Wizard for settling commissions in invoices" -msgstr "Asistente para liquidar comisiones en facturas" +#: model:ir.model,name:sale_commission_partial_settlement.model_commission_make_settle +msgid "Wizard for settling commissions" +msgstr "Asistente para liquidación de comisiones" \ No newline at end of file diff --git a/sale_commission_partial_settlement/migrations/14.0.1.0.1/post-migrate.py b/sale_commission_partial_settlement/migrations/14.0.1.0.1/post-migrate.py deleted file mode 100644 index 626eae3f9..000000000 --- a/sale_commission_partial_settlement/migrations/14.0.1.0.1/post-migrate.py +++ /dev/null @@ -1,11 +0,0 @@ -from openupgradelib import openupgrade - - -@openupgrade.migrate() -def migrate(env, version): - env["account.invoice.line.agent"].search( - [ - ("settled", "=", True), - ("commission_id.payment_amount_type", "=", "paid"), - ] - )._compute_settled() diff --git a/sale_commission_partial_settlement/models/__init__.py b/sale_commission_partial_settlement/models/__init__.py index 4e17db438..d98e158fb 100644 --- a/sale_commission_partial_settlement/models/__init__.py +++ b/sale_commission_partial_settlement/models/__init__.py @@ -1,4 +1,5 @@ -from . import sale_commission -from . import account_move +from . import commission +from . import account_invoice_line_agent +from . import account_invoice_line_agent_partial from . import account_partial_reconcile -from . import settlement +from . import commission_settlement_line diff --git a/sale_commission_partial_settlement/models/account_move.py b/sale_commission_partial_settlement/models/account_invoice_line_agent.py similarity index 71% rename from sale_commission_partial_settlement/models/account_move.py rename to sale_commission_partial_settlement/models/account_invoice_line_agent.py index a402c5ed3..6f1562eb7 100644 --- a/sale_commission_partial_settlement/models/account_move.py +++ b/sale_commission_partial_settlement/models/account_invoice_line_agent.py @@ -14,10 +14,10 @@ def _compute_settled(self): lambda x: x.commission_id.payment_amount_type != "paid" ) for line in self - filtered_lines: - if not line.mapped("agent_line.settlement_id"): + if not line.settlement_line_ids: line.settled = False - super(AccountInvoiceLineAgent, filtered_lines)._compute_settled() + return super(AccountInvoiceLineAgent, filtered_lines)._compute_settled() def _partial_commissions(self, date_payment_to): """ @@ -33,11 +33,12 @@ def _partial_commissions(self, date_payment_to): lines_to_update = {} for line in self: line_total_amount = line.amount + reconciled_partials, _ = line.invoice_id._get_reconciled_invoices_partials() for ( partial, amount, counterpart_line, - ) in line.invoice_id._get_reconciled_invoices_partials(): + ) in reconciled_partials: if partial.partial_commission_settled: continue elif date_payment_to and date_payment_to < counterpart_line.date: @@ -51,11 +52,7 @@ def _partial_commissions(self, date_payment_to): partial_payment_remaining[partial.id] = {"remaining_amount": amount} if line.object_id.price_total <= payment_amount: partial_lines_to_settle.append( - { - "invoice_line_agent_id": line.id, - "currency_id": line.currency_id.id, - "amount": line_total_amount, - } + self._partial_agent_line_values(line, line_total_amount) ) lines_to_update[line.id] = { "partial_settled": line_total_amount, @@ -71,11 +68,7 @@ def _partial_commissions(self, date_payment_to): line.invoice_id.commission_total * paid_in_proportion ) partial_lines_to_settle.append( - { - "invoice_line_agent_id": line.id, - "currency_id": line.currency_id.id, - "amount": partial_commission, - } + self._partial_agent_line_values(line, partial_commission) ) if line.id in lines_to_update: lines_to_update[line.id]["partial_settled"] += partial_commission @@ -91,23 +84,9 @@ def _partial_commissions(self, date_payment_to): ) return partial_agent_lines, lines_to_update - -class AccountInvoiceLineAgentPartial(models.Model): - _name = "account.invoice.line.agent.partial" - _description = "Partial agent commissions" - - invoice_line_agent_id = fields.Many2one("account.invoice.line.agent", required=True) - agent_line = fields.Many2many( - comodel_name="sale.commission.settlement.line", - relation="settlement_agent_line_partial_rel", - column1="agent_line_partial_id", - column2="settlement_id", - copy=False, - ) - amount = fields.Monetary( - string="Commission Amount", - ) - currency_id = fields.Many2one( - related="invoice_line_agent_id.currency_id", - ) - settled = fields.Boolean() + def _partial_agent_line_values(self, line, amount): + return { + "invoice_line_agent_id": line.id, + "currency_id": line.currency_id.id, + "amount": amount, + } diff --git a/sale_commission_partial_settlement/models/account_invoice_line_agent_partial.py b/sale_commission_partial_settlement/models/account_invoice_line_agent_partial.py new file mode 100644 index 000000000..f6f608dea --- /dev/null +++ b/sale_commission_partial_settlement/models/account_invoice_line_agent_partial.py @@ -0,0 +1,22 @@ +from odoo import fields, models + + +class AccountInvoiceLineAgentPartial(models.Model): + _name = "account.invoice.line.agent.partial" + _description = "Partial agent commissions" + + invoice_line_agent_id = fields.Many2one("account.invoice.line.agent", required=True) + agent_line = fields.Many2many( + comodel_name="commission.settlement.line", + relation="settlement_agent_line_partial_rel", + column1="agent_line_partial_id", + column2="settlement_id", + copy=False, + ) + amount = fields.Monetary( + string="Commission Amount", + ) + currency_id = fields.Many2one( + related="invoice_line_agent_id.currency_id", + ) + settled = fields.Boolean() diff --git a/sale_commission_partial_settlement/models/sale_commission.py b/sale_commission_partial_settlement/models/commission.py similarity index 81% rename from sale_commission_partial_settlement/models/sale_commission.py rename to sale_commission_partial_settlement/models/commission.py index 68f03aea9..dcb090762 100644 --- a/sale_commission_partial_settlement/models/sale_commission.py +++ b/sale_commission_partial_settlement/models/commission.py @@ -3,8 +3,8 @@ from odoo import fields, models -class SaleCommission(models.Model): - _inherit = "sale.commission" +class Commission(models.Model): + _inherit = "commission" payment_amount_type = fields.Selection( [("full", "Full amount"), ("paid", "Paid amount")], diff --git a/sale_commission_partial_settlement/models/settlement.py b/sale_commission_partial_settlement/models/commission_settlement_line.py similarity index 81% rename from sale_commission_partial_settlement/models/settlement.py rename to sale_commission_partial_settlement/models/commission_settlement_line.py index f25ba11e0..63dba3971 100644 --- a/sale_commission_partial_settlement/models/settlement.py +++ b/sale_commission_partial_settlement/models/commission_settlement_line.py @@ -1,8 +1,8 @@ from odoo import api, fields, models -class SettlementLine(models.Model): - _inherit = "sale.commission.settlement.line" +class CommissionSettlementLine(models.Model): + _inherit = "commission.settlement.line" agent_line_partial_ids = fields.Many2many( comodel_name="account.invoice.line.agent.partial", @@ -23,4 +23,4 @@ def _compute_settled_amount(self): if rec.commission_id.payment_amount_type == "paid": rec.settled_amount = rec.agent_line_partial_ids[:1].amount else: - rec.settled_amount = rec.agent_line[:1].amount + rec.settled_amount = rec.invoice_agent_line_id[:1].amount diff --git a/sale_commission_partial_settlement/static/description/index.html b/sale_commission_partial_settlement/static/description/index.html index 6bf4cbe3b..74000c070 100644 --- a/sale_commission_partial_settlement/static/description/index.html +++ b/sale_commission_partial_settlement/static/description/index.html @@ -8,11 +8,10 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ +:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. -Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -275,7 +274,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: gray; } /* line numbers */ +pre.code .ln { color: grey; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -301,7 +300,7 @@ span.pre { white-space: pre } -span.problematic, pre.problematic { +span.problematic { color: red } span.section-subtitle { @@ -369,7 +368,7 @@

Sales commissions based on paid amount

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:72b8b9ff4225524c4105f059588ec2038649d39259909c6d43d8e7c4b62b06a2 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/commission Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/commission Translate me on Weblate Try me on Runboat

This module allows to settle commissions based on paid amount.

Table of contents

@@ -398,7 +397,7 @@

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -439,15 +438,13 @@

Contributors

Maintainers

This module is maintained by the OCA.

- -Odoo Community Association - +Odoo Community Association

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.

Current maintainers:

aleuffre renda-dev PicchiSeba

-

This module is part of the OCA/commission project on GitHub.

+

This module is part of the OCA/commission project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

diff --git a/sale_commission_partial_settlement/tests/common.py b/sale_commission_partial_settlement/tests/common.py new file mode 100644 index 000000000..374984a01 --- /dev/null +++ b/sale_commission_partial_settlement/tests/common.py @@ -0,0 +1,183 @@ +from dateutil.relativedelta import relativedelta + +from odoo import fields +from odoo.tests.common import TransactionCase + + +class TestPartialSettlementCommon(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.commission_model = cls.env["commission"] + cls.partial_commission_net_paid = cls.commission_model.create( + { + "name": "20% fixed commission (Net amount) - Payment Based - Partial", + "fix_qty": 20.0, + "invoice_state": "paid", + "amount_base_type": "net_amount", + "payment_amount_type": "paid", + } + ) + cls.company = cls.env.ref("base.main_company") + cls.res_partner_model = cls.env["res.partner"] + cls.partner = cls.env.ref("base.res_partner_2") + cls.partner.write({"agent": False}) + cls.sale_order_model = cls.env["sale.order"] + cls.advance_inv_model = cls.env["sale.advance.payment.inv"] + cls.settle_model = cls.env["commission.settlement"] + cls.make_settle_model = cls.env["commission.make.settle"] + cls.make_inv_model = cls.env["commission.make.invoice"] + cls.product = cls.env.ref("product.product_product_5") + cls.product.list_price = 5 # for testing specific commission section + cls.commission_product = cls.env["product.product"].create( + {"name": "Commission test product", "type": "service"} + ) + cls.product.write({"invoice_policy": "order"}) + cls.journal = cls.env["account.journal"].search( + [("type", "=", "purchase")], limit=1 + ) + cls.agent_monthly = cls.res_partner_model.create( + { + "name": "Test Agent - Monthly", + "agent": True, + "settlement": "monthly", + "lang": "en_US", + "commission_id": cls.partial_commission_net_paid.id, + } + ) + cls.income_account = cls.env["account.account"].search( + [ + ("company_id", "=", cls.company.id), + ("account_type", "=", "income"), + ], + limit=1, + ) + cls.commission_net_invoice = cls.commission_model.create( + { + "name": "10% fixed commission (Net amount) - Invoice Based", + "fix_qty": 10.0, + "amount_base_type": "net_amount", + } + ) + cls.agent_biweekly = cls.res_partner_model.create( + { + "name": "Test Agent - Bi-weekly", + "agent": True, + "settlement": "biweekly", + "lang": "en_US", + "commission_id": cls.commission_net_invoice.id, + } + ) + + def _create_multi_line_sale_order(self, agent, commission): + return self.sale_order_model.create( + { + "partner_id": self.partner.id, + "order_line": [ + ( + 0, + 0, + { + "name": self.product.name, + "product_id": self.product.id, + "product_uom_qty": 1.0, + "product_uom": self.ref("uom.product_uom_unit"), + "price_unit": self.product.lst_price, + "agent_ids": [ + ( + 0, + 0, + { + "agent_id": agent.id, + "commission_id": commission.id, + }, + ) + ], + }, + ), + ( + 0, + 0, + { + "name": self.product.name, + "product_id": self.product.id, + "product_uom_qty": 5.0, + "product_uom": self.ref("uom.product_uom_unit"), + "price_unit": self.product.lst_price, + "agent_ids": [ + ( + 0, + 0, + { + "agent_id": self.agent_monthly.id, + "commission_id": self.partial_commission_net_paid.id, + }, + ) + ], + }, + ), + ], + } + ) + + def _invoice_sale_order(self, sale_order): + old_invoices = sale_order.invoice_ids + wizard = self.advance_inv_model.create( + {"advance_payment_method": "delivered", "sale_order_ids": [sale_order.id]} + ) + wizard.with_context( + **{ + "active_model": "sale.order", + "active_ids": [sale_order.id], + "active_id": sale_order.id, + } + ).create_invoices() + invoice = sale_order.invoice_ids - old_invoices + return invoice + + def _settle_agent(self, agent=None, period=None, date=None): + vals = { + "date_to": ( + ( + fields.Datetime.from_string(fields.Datetime.now()) + + relativedelta(months=period) + ) + if period + else date + ), + "settlement_type": "sale_invoice", + } + if agent: + vals["agent_ids"] = [(4, agent.id)] + wizard = self.make_settle_model.create(vals) + wizard.action_settle() + + def register_payment( + self, + invoice, + payment_date, + amount=None, + payment_difference_handling="reconcile", + ): + payment_model = self.env["account.payment.register"] + invoice.action_post() + if not amount: + amount = invoice.amount_total + ctx = { + "active_model": "account.move", + "active_ids": [invoice.id], + } + return ( + payment_model.with_context(**ctx) + .create( + { + "payment_date": payment_date, + "amount": amount, + "journal_id": self.env["account.journal"] + .search([("type", "=", "bank")], limit=1) + .id, + "payment_difference_handling": payment_difference_handling, + } + ) + .action_create_payments() + ) diff --git a/sale_commission_partial_settlement/tests/test_partial_settlement.py b/sale_commission_partial_settlement/tests/test_partial_settlement.py index 66ba38ea4..54fa1448b 100644 --- a/sale_commission_partial_settlement/tests/test_partial_settlement.py +++ b/sale_commission_partial_settlement/tests/test_partial_settlement.py @@ -6,187 +6,11 @@ from dateutil.relativedelta import relativedelta from odoo import fields -from odoo.tests.common import SavepointCase +from .common import TestPartialSettlementCommon -class TestPartialSettlement(SavepointCase): - @classmethod - def setUpClass(cls): - super().setUpClass() - cls.commission_model = cls.env["sale.commission"] - cls.partial_commission_net_paid = cls.commission_model.create( - { - "name": "20% fixed commission (Net amount) - Payment Based - Partial", - "fix_qty": 20.0, - "invoice_state": "paid", - "amount_base_type": "net_amount", - "payment_amount_type": "paid", - } - ) - cls.company = cls.env.ref("base.main_company") - cls.res_partner_model = cls.env["res.partner"] - cls.partner = cls.env.ref("base.res_partner_2") - cls.partner.write({"agent": False}) - cls.sale_order_model = cls.env["sale.order"] - cls.advance_inv_model = cls.env["sale.advance.payment.inv"] - cls.settle_model = cls.env["sale.commission.settlement"] - cls.make_settle_model = cls.env["sale.commission.make.settle"] - cls.make_inv_model = cls.env["sale.commission.make.invoice"] - cls.product = cls.env.ref("product.product_product_5") - cls.product.list_price = 5 # for testing specific commission section - cls.commission_product = cls.env["product.product"].create( - {"name": "Commission test product", "type": "service"} - ) - cls.product.write({"invoice_policy": "order"}) - cls.journal = cls.env["account.journal"].search( - [("type", "=", "purchase")], limit=1 - ) - cls.agent_monthly = cls.res_partner_model.create( - { - "name": "Test Agent - Monthly", - "agent": True, - "settlement": "monthly", - "lang": "en_US", - "commission_id": cls.partial_commission_net_paid.id, - } - ) - cls.income_account = cls.env["account.account"].search( - [ - ("company_id", "=", cls.company.id), - ("user_type_id.name", "=", "Income"), - ], - limit=1, - ) - cls.commission_net_invoice = cls.commission_model.create( - { - "name": "10% fixed commission (Net amount) - Invoice Based", - "fix_qty": 10.0, - "amount_base_type": "net_amount", - } - ) - cls.agent_biweekly = cls.res_partner_model.create( - { - "name": "Test Agent - Bi-weekly", - "agent": True, - "settlement": "biweekly", - "lang": "en_US", - "commission_id": cls.commission_net_invoice.id, - } - ) - - def _create_multi_line_sale_order(self, agent, commission): - return self.sale_order_model.create( - { - "partner_id": self.partner.id, - "order_line": [ - ( - 0, - 0, - { - "name": self.product.name, - "product_id": self.product.id, - "product_uom_qty": 1.0, - "product_uom": self.ref("uom.product_uom_unit"), - "price_unit": self.product.lst_price, - "agent_ids": [ - ( - 0, - 0, - { - "agent_id": agent.id, - "commission_id": commission.id, - }, - ) - ], - }, - ), - ( - 0, - 0, - { - "name": self.product.name, - "product_id": self.product.id, - "product_uom_qty": 5.0, - "product_uom": self.ref("uom.product_uom_unit"), - "price_unit": self.product.lst_price, - "agent_ids": [ - ( - 0, - 0, - { - "agent_id": self.agent_monthly.id, - "commission_id": self.partial_commission_net_paid.id, - }, - ) - ], - }, - ), - ], - } - ) - - def _invoice_sale_order(self, sale_order, date=None): - old_invoices = sale_order.invoice_ids - wizard = self.advance_inv_model.create({"advance_payment_method": "delivered"}) - wizard.with_context( - { - "active_model": "sale.order", - "active_ids": [sale_order.id], - "active_id": sale_order.id, - } - ).create_invoices() - invoice = sale_order.invoice_ids - old_invoices - invoice.flush() - return invoice - - def _settle_agent(self, agent=None, period=None, date=None, date_payment_to=None): - vals = { - "date_to": ( - fields.Datetime.from_string(fields.Datetime.now()) - + relativedelta(months=period) - ) - if period - else date, - "date_payment_to": date_payment_to, - } - if agent: - vals["agent_ids"] = [(4, agent.id)] - wizard = self.make_settle_model.create(vals) - wizard.action_settle() - - def register_payment( - self, - invoice, - payment_date, - amount=None, - payment_difference_handling="reconcile", - ): - payment_model = self.env["account.payment.register"] - invoice.action_post() - if not amount: - amount = invoice.amount_total - ctx = { - "active_model": "account.move", - "active_ids": [invoice.id], - } - return ( - payment_model.with_context(ctx) - .create( - { - "payment_date": payment_date, - "amount": amount, - "journal_id": self.env["account.journal"] - .search([("type", "=", "bank")], limit=1) - .id, - "payment_method_id": self.env.ref( - "account.account_payment_method_manual_out" - ).id, - "payment_difference_handling": payment_difference_handling, - } - ) - .action_create_payments() - ) +class TestPartialSettlement(TestPartialSettlementCommon): def test_partial_payment_amount_settlement(self): sale_order = self._create_multi_line_sale_order( self.agent_monthly, self.partial_commission_net_paid @@ -202,8 +26,8 @@ def test_partial_payment_amount_settlement(self): payment_difference_handling="open", ) self.assertTrue(invoice._get_reconciled_invoices_partials()) - self._settle_agent(self.agent_monthly, 1, date_payment_to=datetime.now()) - settlements = self.env["sale.commission.settlement"].search( + self._settle_agent(self.agent_monthly, 1, datetime.now()) + settlements = self.env["commission.settlement"].search( [ ( "agent_id", @@ -217,30 +41,6 @@ def test_partial_payment_amount_settlement(self): self.assertEqual(2, len(settlements.line_ids)) self.assertEqual(2, len(invoice.line_ids.agent_ids)) - def test_skip_partial_future_payment(self): - sale_order = self._create_multi_line_sale_order( - self.agent_monthly, self.partial_commission_net_paid - ) - sale_order.action_confirm() - date = fields.Date.today() - invoice = self._invoice_sale_order(sale_order) - self.register_payment( - invoice, - date + relativedelta(days=2), - ) - self._settle_agent(self.agent_monthly, 1, date_payment_to=datetime.now()) - settlements = self.env["sale.commission.settlement"].search( - [ - ( - "agent_id", - "=", - self.agent_monthly.id, - ), - ("state", "=", "settled"), - ] - ) - self.assertEqual(0, len(settlements)) - def test_multi_agents_settlement(self): agent_net = self.agent_biweekly commission_net = self.commission_net_invoice diff --git a/sale_commission_partial_settlement/views/sale_commission_view.xml b/sale_commission_partial_settlement/views/commission_view.xml similarity index 56% rename from sale_commission_partial_settlement/views/sale_commission_view.xml rename to sale_commission_partial_settlement/views/commission_view.xml index b82c7b9d1..9dc52314f 100644 --- a/sale_commission_partial_settlement/views/sale_commission_view.xml +++ b/sale_commission_partial_settlement/views/commission_view.xml @@ -1,9 +1,9 @@ - - sale.commission.payment.amount.form - sale.commission - + + commission.partial.settlement.form.view + commission +