diff --git a/agreement_account/README.rst b/agreement_account/README.rst new file mode 100644 index 000000000..501a3ec57 --- /dev/null +++ b/agreement_account/README.rst @@ -0,0 +1,95 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +================= +Agreement Account +================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:404e1e4edd2425847d9b4c0a8308bd2b3a1bd4f69a330acc05cb03811c03095d + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/license-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%2Fagreement-lightgray.png?logo=github + :target: https://github.com/OCA/agreement/tree/18.0/agreement_account + :alt: OCA/agreement +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/agreement-18-0/agreement-18-0-agreement_account + :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/agreement&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module adds *Agreement* field on invoices. + +**Table of contents** + +.. contents:: + :local: + +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 +------- + +* Akretion + +Contributors +------------ + +- Alexis de Lattre +- Italo LOPES +- `Heliconia Solutions Pvt. Ltd. `__ + + - Bhavesh Heliconia + +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. + +.. |maintainer-alexis-via| image:: https://github.com/alexis-via.png?size=40px + :target: https://github.com/alexis-via + :alt: alexis-via +.. |maintainer-bealdav| image:: https://github.com/bealdav.png?size=40px + :target: https://github.com/bealdav + :alt: bealdav + +Current `maintainers `__: + +|maintainer-alexis-via| |maintainer-bealdav| + +This module is part of the `OCA/agreement `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/agreement_account/__init__.py b/agreement_account/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/agreement_account/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/agreement_account/__manifest__.py b/agreement_account/__manifest__.py new file mode 100644 index 000000000..4a9f28cf2 --- /dev/null +++ b/agreement_account/__manifest__.py @@ -0,0 +1,28 @@ +# Copyright 2017-2020 Akretion France (http://www.akretion.com/) +# @author: Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Agreement Account", + "summary": "Agreement on invoices", + "version": "19.0.1.0.0", + "category": "Contract", + "author": "Akretion, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/agreement", + "license": "AGPL-3", + "depends": [ + "agreement", + "account", + ], + "data": [ + "security/ir.model.access.csv", + "views/agreement.xml", + "views/account_move.xml", + ], + "development_status": "Beta", + "maintainers": [ + "alexis-via", + "bealdav", + ], + "installable": True, +} diff --git a/agreement_account/i18n/agreement_account.pot b/agreement_account/i18n/agreement_account.pot new file mode 100644 index 000000000..d72f01a44 --- /dev/null +++ b/agreement_account/i18n/agreement_account.pot @@ -0,0 +1,54 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * agreement_account +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.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: agreement_account +#: model:ir.model.fields,field_description:agreement_account.field_agreement__out_invoice_count +msgid "# of Customer Invoices" +msgstr "" + +#. module: agreement_account +#: model:ir.model.fields,field_description:agreement_account.field_agreement__in_invoice_count +msgid "# of Vendor Bills" +msgstr "" + +#. module: agreement_account +#: model:ir.model,name:agreement_account.model_agreement +#: model:ir.model.fields,field_description:agreement_account.field_account_bank_statement_line__agreement_id +#: model:ir.model.fields,field_description:agreement_account.field_account_move__agreement_id +#: model_terms:ir.ui.view,arch_db:agreement_account.view_account_invoice_filter +msgid "Agreement" +msgstr "" + +#. module: agreement_account +#: model:ir.ui.menu,name:agreement_account.agreement_type_menu +msgid "Agreement Types" +msgstr "" + +#. module: agreement_account +#: model:ir.model.fields,field_description:agreement_account.field_agreement__invoice_ids +#: model_terms:ir.ui.view,arch_db:agreement_account.agreement_form +msgid "Invoices" +msgstr "" + +#. module: agreement_account +#: model:ir.model,name:agreement_account.model_account_move +msgid "Journal Entry" +msgstr "" + +#. module: agreement_account +#: model:ir.actions.act_window,name:agreement_account.account_invoice_in_invoice_refund_action +#: model_terms:ir.ui.view,arch_db:agreement_account.agreement_form +msgid "Vendor Bills" +msgstr "" diff --git a/agreement_account/i18n/es.po b/agreement_account/i18n/es.po new file mode 100644 index 000000000..638e646ce --- /dev/null +++ b/agreement_account/i18n/es.po @@ -0,0 +1,67 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * agreement_account +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-12-19 13:33+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: agreement_account +#: model:ir.model.fields,field_description:agreement_account.field_agreement__out_invoice_count +msgid "# of Customer Invoices" +msgstr "# de Facturas de Cliente" + +#. module: agreement_account +#: model:ir.model.fields,field_description:agreement_account.field_agreement__in_invoice_count +msgid "# of Vendor Bills" +msgstr "# de Facturas de Proveedores" + +#. module: agreement_account +#: model:ir.model,name:agreement_account.model_agreement +#: model:ir.model.fields,field_description:agreement_account.field_account_bank_statement_line__agreement_id +#: model:ir.model.fields,field_description:agreement_account.field_account_move__agreement_id +#: model:ir.model.fields,field_description:agreement_account.field_account_payment__agreement_id +#: model_terms:ir.ui.view,arch_db:agreement_account.view_account_invoice_filter +msgid "Agreement" +msgstr "Acuerdo" + +#. module: agreement_account +#: model:ir.ui.menu,name:agreement_account.agreement_type_menu +msgid "Agreement Types" +msgstr "Tipos de Acuerdo" + +#. module: agreement_account +#: model:ir.model.fields,field_description:agreement_account.field_agreement__invoice_ids +#: model_terms:ir.ui.view,arch_db:agreement_account.agreement_form +msgid "Invoices" +msgstr "Facturas" + +#. module: agreement_account +#: model:ir.model,name:agreement_account.model_account_move +msgid "Journal Entry" +msgstr "Entrada en Diario" + +#. module: agreement_account +#: model:ir.actions.act_window,name:agreement_account.account_invoice_in_invoice_refund_action +#: model_terms:ir.ui.view,arch_db:agreement_account.agreement_form +msgid "Vendor Bills" +msgstr "Facturas de Vendedor" + +#~ msgid "Display Name" +#~ msgstr "Mostrar Nombre" + +#~ msgid "ID" +#~ msgstr "ID (identificación)" + +#~ msgid "Last Modified on" +#~ msgstr "Última Modificación el" diff --git a/agreement_account/i18n/es_AR.po b/agreement_account/i18n/es_AR.po new file mode 100644 index 000000000..c737b2e5b --- /dev/null +++ b/agreement_account/i18n/es_AR.po @@ -0,0 +1,67 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * agreement_account +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2022-02-06 20:59+0000\n" +"Last-Translator: Ignacio Buioli \n" +"Language-Team: none\n" +"Language: es_AR\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.3.2\n" + +#. module: agreement_account +#: model:ir.model.fields,field_description:agreement_account.field_agreement__out_invoice_count +msgid "# of Customer Invoices" +msgstr "# de Facturas de Cliente" + +#. module: agreement_account +#: model:ir.model.fields,field_description:agreement_account.field_agreement__in_invoice_count +msgid "# of Vendor Bills" +msgstr "# de Facturas de Proveedores" + +#. module: agreement_account +#: model:ir.model,name:agreement_account.model_agreement +#: model:ir.model.fields,field_description:agreement_account.field_account_bank_statement_line__agreement_id +#: model:ir.model.fields,field_description:agreement_account.field_account_move__agreement_id +#: model:ir.model.fields,field_description:agreement_account.field_account_payment__agreement_id +#: model_terms:ir.ui.view,arch_db:agreement_account.view_account_invoice_filter +msgid "Agreement" +msgstr "Acuerdo" + +#. module: agreement_account +#: model:ir.ui.menu,name:agreement_account.agreement_type_menu +msgid "Agreement Types" +msgstr "Tipos de Acuerdo" + +#. module: agreement_account +#: model:ir.model.fields,field_description:agreement_account.field_agreement__invoice_ids +#: model_terms:ir.ui.view,arch_db:agreement_account.agreement_form +msgid "Invoices" +msgstr "Facturas" + +#. module: agreement_account +#: model:ir.model,name:agreement_account.model_account_move +msgid "Journal Entry" +msgstr "Apunte Contable" + +#. module: agreement_account +#: model:ir.actions.act_window,name:agreement_account.account_invoice_in_invoice_refund_action +#: model_terms:ir.ui.view,arch_db:agreement_account.agreement_form +msgid "Vendor Bills" +msgstr "Facturas de Proveedores" + +#~ msgid "Display Name" +#~ msgstr "Mostrar Nombre" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Última Modificación el" diff --git a/agreement_account/i18n/it.po b/agreement_account/i18n/it.po new file mode 100644 index 000000000..1fca77e53 --- /dev/null +++ b/agreement_account/i18n/it.po @@ -0,0 +1,58 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * agreement_account +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-10-25 20:06+0000\n" +"Last-Translator: mymage \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 5.6.2\n" + +#. module: agreement_account +#: model:ir.model.fields,field_description:agreement_account.field_agreement__out_invoice_count +msgid "# of Customer Invoices" +msgstr "N° fatture cliente" + +#. module: agreement_account +#: model:ir.model.fields,field_description:agreement_account.field_agreement__in_invoice_count +msgid "# of Vendor Bills" +msgstr "N° fatture fornitore" + +#. module: agreement_account +#: model:ir.model,name:agreement_account.model_agreement +#: model:ir.model.fields,field_description:agreement_account.field_account_bank_statement_line__agreement_id +#: model:ir.model.fields,field_description:agreement_account.field_account_move__agreement_id +#: model:ir.model.fields,field_description:agreement_account.field_account_payment__agreement_id +#: model_terms:ir.ui.view,arch_db:agreement_account.view_account_invoice_filter +msgid "Agreement" +msgstr "Contratto" + +#. module: agreement_account +#: model:ir.ui.menu,name:agreement_account.agreement_type_menu +msgid "Agreement Types" +msgstr "Tipi contratto" + +#. module: agreement_account +#: model:ir.model.fields,field_description:agreement_account.field_agreement__invoice_ids +#: model_terms:ir.ui.view,arch_db:agreement_account.agreement_form +msgid "Invoices" +msgstr "Fatture" + +#. module: agreement_account +#: model:ir.model,name:agreement_account.model_account_move +msgid "Journal Entry" +msgstr "Registrazione contabile" + +#. module: agreement_account +#: model:ir.actions.act_window,name:agreement_account.account_invoice_in_invoice_refund_action +#: model_terms:ir.ui.view,arch_db:agreement_account.agreement_form +msgid "Vendor Bills" +msgstr "Fatture fornitore" diff --git a/agreement_account/i18n/sv.po b/agreement_account/i18n/sv.po new file mode 100644 index 000000000..a0cca91ce --- /dev/null +++ b/agreement_account/i18n/sv.po @@ -0,0 +1,57 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * agreement_account +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2025-11-03 15:56+0000\n" +"Last-Translator: jakobkrabbe \n" +"Language-Team: none\n" +"Language: sv\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 5.10.4\n" + +#. module: agreement_account +#: model:ir.model.fields,field_description:agreement_account.field_agreement__out_invoice_count +msgid "# of Customer Invoices" +msgstr "# Antal kundfakturor" + +#. module: agreement_account +#: model:ir.model.fields,field_description:agreement_account.field_agreement__in_invoice_count +msgid "# of Vendor Bills" +msgstr "# Antal leverantörsfakturor" + +#. module: agreement_account +#: model:ir.model,name:agreement_account.model_agreement +#: model:ir.model.fields,field_description:agreement_account.field_account_bank_statement_line__agreement_id +#: model:ir.model.fields,field_description:agreement_account.field_account_move__agreement_id +#: model_terms:ir.ui.view,arch_db:agreement_account.view_account_invoice_filter +msgid "Agreement" +msgstr "Avtal" + +#. module: agreement_account +#: model:ir.ui.menu,name:agreement_account.agreement_type_menu +msgid "Agreement Types" +msgstr "Typer av avtal" + +#. module: agreement_account +#: model:ir.model.fields,field_description:agreement_account.field_agreement__invoice_ids +#: model_terms:ir.ui.view,arch_db:agreement_account.agreement_form +msgid "Invoices" +msgstr "Fakturor" + +#. module: agreement_account +#: model:ir.model,name:agreement_account.model_account_move +msgid "Journal Entry" +msgstr "Verifikat" + +#. module: agreement_account +#: model:ir.actions.act_window,name:agreement_account.account_invoice_in_invoice_refund_action +#: model_terms:ir.ui.view,arch_db:agreement_account.agreement_form +msgid "Vendor Bills" +msgstr "Leverantörsfakturor" diff --git a/agreement_account/migrations/19.0.1.0.0/pre-migration.py b/agreement_account/migrations/19.0.1.0.0/pre-migration.py new file mode 100644 index 000000000..291e44a07 --- /dev/null +++ b/agreement_account/migrations/19.0.1.0.0/pre-migration.py @@ -0,0 +1,8 @@ +# Copyright 2026 WISSEN BERATUNG +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +"""Placeholder pre-migration script for 18.0 -> 19.0. + +No schema drift in this migration -- fields and models are stable. +Kept as an explicit empty step so OpenUpgrade recognises 19.0 as a +deliberate version bump. +""" diff --git a/agreement_account/models/__init__.py b/agreement_account/models/__init__.py new file mode 100644 index 000000000..77c035979 --- /dev/null +++ b/agreement_account/models/__init__.py @@ -0,0 +1,2 @@ +from . import account_move +from . import agreement diff --git a/agreement_account/models/account_move.py b/agreement_account/models/account_move.py new file mode 100644 index 000000000..7d9dc8bf0 --- /dev/null +++ b/agreement_account/models/account_move.py @@ -0,0 +1,18 @@ +# Copyright 2017-2020 Akretion France (http://www.akretion.com/) +# @author: Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + + +from odoo import fields, models + + +class AccountMove(models.Model): + _inherit = "account.move" + + agreement_id = fields.Many2one( + comodel_name="agreement", + string="Agreement", + ondelete="restrict", + tracking=True, + copy=False, + ) diff --git a/agreement_account/models/agreement.py b/agreement_account/models/agreement.py new file mode 100644 index 000000000..adeb6f6b4 --- /dev/null +++ b/agreement_account/models/agreement.py @@ -0,0 +1,39 @@ +# Copyright 2017-2020 Akretion France (http://www.akretion.com/) +# @author: Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + + +from odoo import fields, models + + +class Agreement(models.Model): + _inherit = "agreement" + + invoice_ids = fields.One2many( + "account.move", "agreement_id", string="Invoices", readonly=True + ) + out_invoice_count = fields.Integer( + compute="_compute_invoice_count", string="# of Customer Invoices" + ) + in_invoice_count = fields.Integer( + compute="_compute_invoice_count", string="# of Vendor Bills" + ) + + def _compute_invoice_count(self): + base_domain = [("agreement_id", "in", self.ids)] + aio = self.env["account.move"] + out_rg = aio._read_group( + base_domain + [("move_type", "in", ("out_invoice", "out_refund"))], + groupby=["agreement_id"], + aggregates=["__count"], + ) + out_data = {agreement.id: count for agreement, count in out_rg} + in_rg = aio._read_group( + base_domain + [("move_type", "in", ("in_invoice", "in_refund"))], + groupby=["agreement_id"], + aggregates=["__count"], + ) + in_data = {agreement.id: count for agreement, count in in_rg} + for agreement in self: + agreement.out_invoice_count = out_data.get(agreement.id, 0) + agreement.in_invoice_count = in_data.get(agreement.id, 0) diff --git a/agreement_account/pyproject.toml b/agreement_account/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/agreement_account/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/agreement_account/readme/CONTRIBUTORS.md b/agreement_account/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..7742cdaa2 --- /dev/null +++ b/agreement_account/readme/CONTRIBUTORS.md @@ -0,0 +1,4 @@ +- Alexis de Lattre \<\> +- Italo LOPES \<\> +- [Heliconia Solutions Pvt. Ltd.](https://www.heliconia.io) + - Bhavesh Heliconia diff --git a/agreement_account/readme/DESCRIPTION.md b/agreement_account/readme/DESCRIPTION.md new file mode 100644 index 000000000..ff0b5ca02 --- /dev/null +++ b/agreement_account/readme/DESCRIPTION.md @@ -0,0 +1 @@ +This module adds _Agreement_ field on invoices. diff --git a/agreement_account/security/ir.model.access.csv b/agreement_account/security/ir.model.access.csv new file mode 100644 index 000000000..c1b7f487c --- /dev/null +++ b/agreement_account/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_agreement_full,Full access on agreement to Financial mgr,agreement.model_agreement,account.group_account_manager,1,1,1,1 +access_agreement_type_full,Full access on agreement type to Financial mgr,agreement.model_agreement_type,account.group_account_manager,1,1,1,1 diff --git a/agreement_account/static/description/icon.png b/agreement_account/static/description/icon.png new file mode 100644 index 000000000..976ee9a35 Binary files /dev/null and b/agreement_account/static/description/icon.png differ diff --git a/agreement_account/static/description/index.html b/agreement_account/static/description/index.html new file mode 100644 index 000000000..f2d7c107b --- /dev/null +++ b/agreement_account/static/description/index.html @@ -0,0 +1,702 @@ + + + + + + README.rst + + + +
+ + Odoo Community Association + +
+

Agreement Account

+ +

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

+

This module adds Agreement field on invoices.

+

Table of contents

+
+ +
+
+

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

+
    +
  • Akretion
  • +
+
+
+

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. +

+

+ Current + maintainers: +

+

+ alexis-via + bealdav +

+

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

+

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

+
+
+
+
+ + diff --git a/agreement_account/tests/__init__.py b/agreement_account/tests/__init__.py new file mode 100644 index 000000000..b636caa99 --- /dev/null +++ b/agreement_account/tests/__init__.py @@ -0,0 +1 @@ +from . import test_agreement diff --git a/agreement_account/tests/test_agreement.py b/agreement_account/tests/test_agreement.py new file mode 100644 index 000000000..9bbb2bdb8 --- /dev/null +++ b/agreement_account/tests/test_agreement.py @@ -0,0 +1,32 @@ +# Copyright 2017-2020 Akretion France (http://www.akretion.com/) +# @author: Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.addons.base.tests.common import BaseCommon + + +class TestAgreement(BaseCommon): + @classmethod + def setUpClass(self): + super().setUpClass() + self.test_customer = self.env["res.partner"].create({"name": "TestCustomer"}) + self.test_agreement_sale = self.env["agreement"].create( + { + "name": "TestAgreement-Sale", + "code": "SALE", + "partner_id": self.test_customer.id, + "domain": "sale", + } + ) + self.test_agreement_purchase = self.env["agreement"].create( + { + "name": "TestAgreement-Purchase", + "code": "PURCHASE", + "partner_id": self.test_customer.id, + "domain": "purchase", + } + ) + + def test_compute_invoice_count(self): + self.test_agreement_sale._compute_invoice_count() + self.test_agreement_purchase._compute_invoice_count() diff --git a/agreement_account/views/account_move.xml b/agreement_account/views/account_move.xml new file mode 100644 index 000000000..88392da58 --- /dev/null +++ b/agreement_account/views/account_move.xml @@ -0,0 +1,61 @@ + + + + agreement.customer.invoice.form + account.move + + + + + + + + + + + agreement.supplier.invoice.form + account.move + + + + + + + + + + agreement.account.move.search + account.move + + + + + + + + + + + + diff --git a/agreement_account/views/agreement.xml b/agreement_account/views/agreement.xml new file mode 100644 index 000000000..61717d2c5 --- /dev/null +++ b/agreement_account/views/agreement.xml @@ -0,0 +1,84 @@ + + + + 150 + + + + + + Vendor Bills + account.move + list,form + [('move_type','in', ('in_invoice', 'in_refund')), ('state', 'not in', ('draft', 'cancel'))] + {'default_type': 'in_invoice', 'move_type': 'in_invoice', 'journal_type': 'purchase'} + + + + + list + + + + + + + form + + + + + + invoice.button.agreement.form + agreement + + +
+ + +
+
+
+