diff --git a/account_invoice_product_code_remove/README.rst b/account_invoice_product_code_remove/README.rst new file mode 100644 index 00000000000..cd0ff6455b0 --- /dev/null +++ b/account_invoice_product_code_remove/README.rst @@ -0,0 +1,81 @@ +=================================== +Account Invoice Product Code Remove +=================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:8919ac55fd68566cd39fffba613e61c609c612ee5401ca82d02fac59c885ed6e + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--invoicing-lightgray.png?logo=github + :target: https://github.com/OCA/account-invoicing/tree/15.0/account_invoice_product_code_remove + :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-15-0/account-invoicing-15-0-account_invoice_product_code_remove + :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=15.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Removes default code brackets from the beginning of invoice line description. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +Add a product in the invoice line, then the description of the product will be displayed without the default code. + +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 +~~~~~~~ + +* Jarsa + +Contributors +~~~~~~~~~~~~ + +* Alan Ramos + +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_product_code_remove/__init__.py b/account_invoice_product_code_remove/__init__.py new file mode 100644 index 00000000000..af0b5c22add --- /dev/null +++ b/account_invoice_product_code_remove/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2023 Jarsa, () +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0.html). + +from . import models diff --git a/account_invoice_product_code_remove/__manifest__.py b/account_invoice_product_code_remove/__manifest__.py new file mode 100644 index 00000000000..5c0639d749e --- /dev/null +++ b/account_invoice_product_code_remove/__manifest__.py @@ -0,0 +1,12 @@ +# Copyright 2023 Jarsa, () +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0.html). +{ + "name": "Account Invoice Product Code Remove", + "summary": "Remove product code from invoice lines description", + "author": "Jarsa, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/account-invoicing", + "category": "Accounting & Finance", + "version": "15.0.1.0.0", + "license": "LGPL-3", + "depends": ["account"], +} diff --git a/account_invoice_product_code_remove/models/__init__.py b/account_invoice_product_code_remove/models/__init__.py new file mode 100644 index 00000000000..a906d123127 --- /dev/null +++ b/account_invoice_product_code_remove/models/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2023 Jarsa, () +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0.html). + +from . import account_move_line diff --git a/account_invoice_product_code_remove/models/account_move_line.py b/account_invoice_product_code_remove/models/account_move_line.py new file mode 100644 index 00000000000..9e6741875ca --- /dev/null +++ b/account_invoice_product_code_remove/models/account_move_line.py @@ -0,0 +1,14 @@ +# Copyright 2023 Jarsa, () +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0.html). + +from odoo import models + + +class AccountMoveLine(models.Model): + _inherit = "account.move.line" + + def _get_computed_name(self): + name = super()._get_computed_name() + if self.product_id.default_code: + name = name.replace(f"[{self.product_id.default_code}] ", "").strip() + return name diff --git a/account_invoice_product_code_remove/readme/CONTRIBUTORS.rst b/account_invoice_product_code_remove/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000000..9c31b0ce2d1 --- /dev/null +++ b/account_invoice_product_code_remove/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Alan Ramos diff --git a/account_invoice_product_code_remove/readme/DESCRIPTION.rst b/account_invoice_product_code_remove/readme/DESCRIPTION.rst new file mode 100644 index 00000000000..74daa8d3168 --- /dev/null +++ b/account_invoice_product_code_remove/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +Removes default code brackets from the beginning of invoice line description. diff --git a/account_invoice_product_code_remove/readme/USAGE.rst b/account_invoice_product_code_remove/readme/USAGE.rst new file mode 100644 index 00000000000..6350553b03d --- /dev/null +++ b/account_invoice_product_code_remove/readme/USAGE.rst @@ -0,0 +1 @@ +Add a product in the invoice line, then the description of the product will be displayed without the default code. diff --git a/account_invoice_product_code_remove/static/description/index.html b/account_invoice_product_code_remove/static/description/index.html new file mode 100644 index 00000000000..bf45dab59bf --- /dev/null +++ b/account_invoice_product_code_remove/static/description/index.html @@ -0,0 +1,426 @@ + + + + + + +Account Invoice Product Code Remove + + + +
+

Account Invoice Product Code Remove

+ + +

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

+

Removes default code brackets from the beginning of invoice line description.

+

Table of contents

+ +
+

Usage

+

Add a product in the invoice line, then the description of the product will be displayed without the default code.

+
+
+

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

+
    +
  • Jarsa
  • +
+
+
+

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/setup/account_invoice_product_code_remove/odoo/addons/account_invoice_product_code_remove b/setup/account_invoice_product_code_remove/odoo/addons/account_invoice_product_code_remove new file mode 120000 index 00000000000..1dbfc49499a --- /dev/null +++ b/setup/account_invoice_product_code_remove/odoo/addons/account_invoice_product_code_remove @@ -0,0 +1 @@ +../../../../account_invoice_product_code_remove \ No newline at end of file diff --git a/setup/account_invoice_product_code_remove/setup.py b/setup/account_invoice_product_code_remove/setup.py new file mode 100644 index 00000000000..28c57bb6403 --- /dev/null +++ b/setup/account_invoice_product_code_remove/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)