diff --git a/account_invoice_crm_tag/README.rst b/account_invoice_crm_tag/README.rst new file mode 100644 index 00000000000..b8990fd6284 --- /dev/null +++ b/account_invoice_crm_tag/README.rst @@ -0,0 +1,88 @@ +======================= +Account Invoice CRM Tag +======================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:841df5b6ec6c5547b7ff726b3f1bfd002910fc4b1b51e1779b387eaf874d801b + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Faccount--invoicing-lightgray.png?logo=github + :target: https://github.com/OCA/account-invoicing/tree/16.0/account_invoice_crm_tag + :alt: OCA/account-invoicing +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/account-invoicing-16-0/account-invoicing-16-0-account_invoice_crm_tag + :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/account-invoicing&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module links the tags assigned to sale_orders with its respective invoices. These tags +are also linked to the return if it is made. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +#. Configure a sale_order +#. Go to *Other info* -> *Tags* and add your desired tags to the sale order. +#. When you create an invoice of the sale order, its assigned tags will be linked to + the created invoice + + +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 +~~~~~~~ + +* Tecnativa + +Contributors +~~~~~~~~~~~~ + +* `Tecnativa `_: + + * Stefan Ungureanu + +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/account-invoicing `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_invoice_crm_tag/__init__.py b/account_invoice_crm_tag/__init__.py new file mode 100644 index 00000000000..bf588bc8b80 --- /dev/null +++ b/account_invoice_crm_tag/__init__.py @@ -0,0 +1,2 @@ +from . import models +from . import report diff --git a/account_invoice_crm_tag/__manifest__.py b/account_invoice_crm_tag/__manifest__.py new file mode 100644 index 00000000000..9fe3d2ba76f --- /dev/null +++ b/account_invoice_crm_tag/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2023 Tecnativa - Stefan Ungureanu +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +{ + "name": "Account Invoice CRM Tag", + "version": "15.0.1.0.0", + "category": "Accounting", + "author": "Tecnativa, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/account-invoicing", + "license": "AGPL-3", + "depends": ["sale"], + "data": [ + "views/account_invoice_views.xml", + "report/account_invoice_report.xml", + ], + "application": False, + "installable": True, +} diff --git a/account_invoice_crm_tag/i18n/account_invoice_crm_tag.pot b/account_invoice_crm_tag/i18n/account_invoice_crm_tag.pot new file mode 100644 index 00000000000..4953e60c2d2 --- /dev/null +++ b/account_invoice_crm_tag/i18n/account_invoice_crm_tag.pot @@ -0,0 +1,43 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_invoice_crm_tag +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-07-14 06:55+0000\n" +"PO-Revision-Date: 2023-07-14 06:55+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: \n" + +#. module: account_invoice_crm_tag +#: model:ir.model.fields,field_description:account_invoice_crm_tag.field_account_invoice_report__tag_ids +msgid "Invoice CRM Tags" +msgstr "" + +#. module: account_invoice_crm_tag +#: model:ir.model.fields,field_description:account_invoice_crm_tag.field_account_bank_statement_line__tags_ids +#: model:ir.model.fields,field_description:account_invoice_crm_tag.field_account_move__tags_ids +#: model:ir.model.fields,field_description:account_invoice_crm_tag.field_account_payment__tags_ids +msgid "Invoice CRM tags" +msgstr "" + +#. module: account_invoice_crm_tag +#: model:ir.model,name:account_invoice_crm_tag.model_account_invoice_report +msgid "Invoices Statistics" +msgstr "" + +#. module: account_invoice_crm_tag +#: model:ir.model,name:account_invoice_crm_tag.model_account_move +msgid "Journal Entry" +msgstr "" + +#. module: account_invoice_crm_tag +#: model:ir.model,name:account_invoice_crm_tag.model_sale_order +msgid "Sales Order" +msgstr "" diff --git a/account_invoice_crm_tag/i18n/es.po b/account_invoice_crm_tag/i18n/es.po new file mode 100644 index 00000000000..5c73c612311 --- /dev/null +++ b/account_invoice_crm_tag/i18n/es.po @@ -0,0 +1,45 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_invoice_crm_tag +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-07-14 06:55+0000\n" +"PO-Revision-Date: 2023-07-14 08:57+0200\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: es_ES\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 3.0.1\n" + +#. module: account_invoice_crm_tag +#: model:ir.model.fields,field_description:account_invoice_crm_tag.field_account_invoice_report__tag_ids +msgid "Invoice CRM Tags" +msgstr "Etiquetas CRM de facturas" + +#. module: account_invoice_crm_tag +#: model:ir.model.fields,field_description:account_invoice_crm_tag.field_account_bank_statement_line__tags_ids +#: model:ir.model.fields,field_description:account_invoice_crm_tag.field_account_move__tags_ids +#: model:ir.model.fields,field_description:account_invoice_crm_tag.field_account_payment__tags_ids +msgid "Invoice CRM tags" +msgstr "Etiquetas CRM de facturas" + +#. module: account_invoice_crm_tag +#: model:ir.model,name:account_invoice_crm_tag.model_account_invoice_report +msgid "Invoices Statistics" +msgstr "Estadísticas de facturas" + +#. module: account_invoice_crm_tag +#: model:ir.model,name:account_invoice_crm_tag.model_account_move +msgid "Journal Entry" +msgstr "Asiento contable" + +#. module: account_invoice_crm_tag +#: model:ir.model,name:account_invoice_crm_tag.model_sale_order +msgid "Sales Order" +msgstr "Pedido de venta" diff --git a/account_invoice_crm_tag/models/__init__.py b/account_invoice_crm_tag/models/__init__.py new file mode 100644 index 00000000000..df48fd83043 --- /dev/null +++ b/account_invoice_crm_tag/models/__init__.py @@ -0,0 +1,2 @@ +from . import account_move +from . import sale_order diff --git a/account_invoice_crm_tag/models/account_move.py b/account_invoice_crm_tag/models/account_move.py new file mode 100644 index 00000000000..a82f718f527 --- /dev/null +++ b/account_invoice_crm_tag/models/account_move.py @@ -0,0 +1,9 @@ +# Copyright 2023 Tecnativa - Stefan Ungureanu +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from odoo import fields, models + + +class AccountMove(models.Model): + _inherit = "account.move" + + tag_ids = fields.Many2many(comodel_name="crm.tag", string="Invoice CRM tags") diff --git a/account_invoice_crm_tag/models/sale_order.py b/account_invoice_crm_tag/models/sale_order.py new file mode 100644 index 00000000000..51afba8a179 --- /dev/null +++ b/account_invoice_crm_tag/models/sale_order.py @@ -0,0 +1,13 @@ +# Copyright 2023 Tecnativa - Stefan Ungureanu +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from odoo import models + + +class SaleOrder(models.Model): + _inherit = "sale.order" + + def _prepare_invoice(self): + vals = super()._prepare_invoice() + if self.tag_ids: + vals["tag_ids"] = [(6, 0, self.tag_ids.ids)] + return vals diff --git a/account_invoice_crm_tag/readme/CONTRIBUTORS.rst b/account_invoice_crm_tag/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000000..bd5cfa29f42 --- /dev/null +++ b/account_invoice_crm_tag/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* `Tecnativa `_: + + * Stefan Ungureanu diff --git a/account_invoice_crm_tag/readme/DESCRIPTION.rst b/account_invoice_crm_tag/readme/DESCRIPTION.rst new file mode 100644 index 00000000000..c405fe1ae1e --- /dev/null +++ b/account_invoice_crm_tag/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +This module links the tags assigned to sale_orders with its respective invoices. These tags +are also linked to the return if it is made. diff --git a/account_invoice_crm_tag/readme/USAGE.rst b/account_invoice_crm_tag/readme/USAGE.rst new file mode 100644 index 00000000000..6761b7e0680 --- /dev/null +++ b/account_invoice_crm_tag/readme/USAGE.rst @@ -0,0 +1,4 @@ +#. Configure a sale_order +#. Go to *Other info* -> *Tags* and add your desired tags to the sale order. +#. When you create an invoice of the sale order, its assigned tags will be linked to + the created invoice diff --git a/account_invoice_crm_tag/report/__init__.py b/account_invoice_crm_tag/report/__init__.py new file mode 100644 index 00000000000..52e62702b3c --- /dev/null +++ b/account_invoice_crm_tag/report/__init__.py @@ -0,0 +1 @@ +from . import account_invoice_report diff --git a/account_invoice_crm_tag/report/account_invoice_report.py b/account_invoice_crm_tag/report/account_invoice_report.py new file mode 100644 index 00000000000..fe8e44da990 --- /dev/null +++ b/account_invoice_crm_tag/report/account_invoice_report.py @@ -0,0 +1,17 @@ +# Copyright 2023 Tecnativa - Stefan Ungureanu +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class AccountInvoiceReport(models.Model): + _inherit = "account.invoice.report" + + tag_ids = fields.Many2many( + comodel_name="crm.tag", + relation="account_move_crm_tag_rel", + column1="account_move_id", + column2="crm_tag_id", + string="Invoice CRM Tags", + readonly=True, + ) diff --git a/account_invoice_crm_tag/report/account_invoice_report.xml b/account_invoice_crm_tag/report/account_invoice_report.xml new file mode 100644 index 00000000000..25e2ff2dd22 --- /dev/null +++ b/account_invoice_crm_tag/report/account_invoice_report.xml @@ -0,0 +1,25 @@ + + + + + account.invoice.report.search + account.invoice.report + + + + + + + + + + + + diff --git a/account_invoice_crm_tag/static/description/index.html b/account_invoice_crm_tag/static/description/index.html new file mode 100644 index 00000000000..186ff8bdea0 --- /dev/null +++ b/account_invoice_crm_tag/static/description/index.html @@ -0,0 +1,435 @@ + + + + + + +Account Invoice CRM Tag + + + +
+

Account Invoice CRM Tag

+ + +

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

+

This module links the tags assigned to sale_orders with its respective invoices. These tags +are also linked to the return if it is made.

+

Table of contents

+ +
+

Usage

+
    +
  1. Configure a sale_order
  2. +
  3. Go to Other info -> Tags and add your desired tags to the sale order.
  4. +
  5. When you create an invoice of the sale order, its assigned tags will be linked to +the created invoice
  6. +
+
+
+

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

+
    +
  • Tecnativa
  • +
+
+
+

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/account-invoicing project on GitHub.

+

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

+
+
+
+ + diff --git a/account_invoice_crm_tag/views/account_invoice_views.xml b/account_invoice_crm_tag/views/account_invoice_views.xml new file mode 100644 index 00000000000..f32e0a01bb4 --- /dev/null +++ b/account_invoice_crm_tag/views/account_invoice_views.xml @@ -0,0 +1,19 @@ + + + + account.move + + + + + + + + diff --git a/setup/account_invoice_crm_tag/odoo/addons/account_invoice_crm_tag b/setup/account_invoice_crm_tag/odoo/addons/account_invoice_crm_tag new file mode 120000 index 00000000000..c5d3227f7ab --- /dev/null +++ b/setup/account_invoice_crm_tag/odoo/addons/account_invoice_crm_tag @@ -0,0 +1 @@ +../../../../account_invoice_crm_tag \ No newline at end of file diff --git a/setup/account_invoice_crm_tag/setup.py b/setup/account_invoice_crm_tag/setup.py new file mode 100644 index 00000000000..28c57bb6403 --- /dev/null +++ b/setup/account_invoice_crm_tag/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)