diff --git a/contract_layout_category_hide_detail/README.rst b/contract_layout_category_hide_detail/README.rst new file mode 100644 index 000000000..04fdd55b1 --- /dev/null +++ b/contract_layout_category_hide_detail/README.rst @@ -0,0 +1,129 @@ +==================================== +Contract layout category hide detail +==================================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fcontract-lightgray.png?logo=github + :target: https://github.com/OCA/contract/tree/12.0/contract_layout_category_hide_detail + :alt: OCA/contract +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-contract_layout_category_hide_detail + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/110/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows you to check/uncheck 'Show details' and +'Show subtotal' flags for *Recurring invoices section lines* +in Customer Contracts and Supplier Contracts so that +Invoices are generated with this information. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To use this module, you need to: + +#. Go to *Invoicing -> Customers -> Customer Contracts* and create + a new *Contract*. +#. In *Recurring Invoices* tab add a section line. +#. Add some product lines. +#. Add a section line, but this time, click on the *plus-circle* + icon |plus-circle-icon| on your right. That icon will be replaced by + *minus-circle* icon |minus-circle-icon|. That means *Show subtotal* field is + set to False. (You can also set *Show subtotal* field to False/True + in the pop-up form when you click on the section line) +#. Add some product lines. +#. Add another section line and click on the *eye* icon |eye-icon| on your + right. That icon will be replaced by *eye-slash* icon |eye-slash-icon|. + That means *Show details* field is set to False. (You can also set + *Show details* field to False/True in the pop-up form when you + click on the section line) +#. Add some product lines. +#. Then, when the Invoice is generated, you will see that it will have the + information regarding "Show details" and "Show subtotal" specified in + the previous steps. + +For more information about *Show details* and *Show subtotal* flags in +Invoices: see `'Usage' section of the 'Sale layout category hide detail' +module `_ + +.. |eye-icon| image:: https://raw.githubusercontent.com/OCA/contract/12.0/contract_layout_category_hide_detail/static/description/readme-icons/eye.png + :alt: plus-circle icon + :width: 12 px + +.. |eye-slash-icon| image:: https://raw.githubusercontent.com/OCA/contract/12.0/contract_layout_category_hide_detail/static/description/readme-icons/eye-slash.png + :alt: minus-circle icon + :width: 12 px + +.. |plus-circle-icon| image:: https://raw.githubusercontent.com/OCA/contract/12.0/contract_layout_category_hide_detail/static/description/readme-icons/plus-circle.png + :alt: plus-circle icon + :width: 12 px + +.. |minus-circle-icon| image:: https://raw.githubusercontent.com/OCA/contract/12.0/contract_layout_category_hide_detail/static/description/readme-icons/minus-circle.png + :alt: minus-circle icon + :width: 12 px + +Known issues / Roadmap +====================== + +* Unit tests are needed + +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 smashing 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 `_: + + * Ernesto Tejeda + * Pedro M. Baeza + +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/contract `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/contract_layout_category_hide_detail/__init__.py b/contract_layout_category_hide_detail/__init__.py new file mode 100644 index 000000000..83e553ac4 --- /dev/null +++ b/contract_layout_category_hide_detail/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import models diff --git a/contract_layout_category_hide_detail/__manifest__.py b/contract_layout_category_hide_detail/__manifest__.py new file mode 100644 index 000000000..7d08a1ce9 --- /dev/null +++ b/contract_layout_category_hide_detail/__manifest__.py @@ -0,0 +1,15 @@ +# Copyright 2018-2019 Tecnativa - Ernesto Tejeda +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + "name": "Contract layout category hide detail", + "summary": "Hide details for sections in Contract lines", + "version": "13.0.1.0.0", + "category": "Contract Management", + "website": "https://github.com/OCA/contract", + "author": "Tecnativa, " "Odoo Community Association (OCA)", + "license": "AGPL-3", + "depends": ["contract", "sale_layout_category_hide_detail"], + "development_status": "Production/Stable", + "data": ["views/abstract_contract_line.xml", "views/contract.xml"], +} diff --git a/contract_layout_category_hide_detail/i18n/contract_layout_category_hide_detail.pot b/contract_layout_category_hide_detail/i18n/contract_layout_category_hide_detail.pot new file mode 100644 index 000000000..213686cdf --- /dev/null +++ b/contract_layout_category_hide_detail/i18n/contract_layout_category_hide_detail.pot @@ -0,0 +1,39 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_layout_category_hide_detail +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.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: contract_layout_category_hide_detail +#: model:ir.model,name:contract_layout_category_hide_detail.model_contract_abstract_contract_line +msgid "Abstract Recurring Contract Line" +msgstr "" + +#. module: contract_layout_category_hide_detail +#: model:ir.model,name:contract_layout_category_hide_detail.model_contract_line +msgid "Contract Line" +msgstr "" + +#. module: contract_layout_category_hide_detail +#: model:ir.model.fields,field_description:contract_layout_category_hide_detail.field_contract_abstract_contract_line__show_details +#: model:ir.model.fields,field_description:contract_layout_category_hide_detail.field_contract_line__show_details +#: model:ir.model.fields,field_description:contract_layout_category_hide_detail.field_contract_template_line__show_details +msgid "Show details" +msgstr "" + +#. module: contract_layout_category_hide_detail +#: model:ir.model.fields,field_description:contract_layout_category_hide_detail.field_contract_abstract_contract_line__show_subtotal +#: model:ir.model.fields,field_description:contract_layout_category_hide_detail.field_contract_line__show_subtotal +#: model:ir.model.fields,field_description:contract_layout_category_hide_detail.field_contract_template_line__show_subtotal +msgid "Show subtotal" +msgstr "" + diff --git a/contract_layout_category_hide_detail/i18n/pt_BR.po b/contract_layout_category_hide_detail/i18n/pt_BR.po new file mode 100644 index 000000000..15f80e7f2 --- /dev/null +++ b/contract_layout_category_hide_detail/i18n/pt_BR.po @@ -0,0 +1,41 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_layout_category_hide_detail +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-08-10 16:59+0000\n" +"Last-Translator: Fernando Colus \n" +"Language-Team: none\n" +"Language: pt_BR\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 3.10\n" + +#. module: contract_layout_category_hide_detail +#: model:ir.model,name:contract_layout_category_hide_detail.model_contract_abstract_contract_line +msgid "Abstract Recurring Contract Line" +msgstr "Linha de contrato recorrente abstrata" + +#. module: contract_layout_category_hide_detail +#: model:ir.model,name:contract_layout_category_hide_detail.model_contract_line +msgid "Contract Line" +msgstr "Linha de Contrato" + +#. module: contract_layout_category_hide_detail +#: model:ir.model.fields,field_description:contract_layout_category_hide_detail.field_contract_abstract_contract_line__show_details +#: model:ir.model.fields,field_description:contract_layout_category_hide_detail.field_contract_line__show_details +#: model:ir.model.fields,field_description:contract_layout_category_hide_detail.field_contract_template_line__show_details +msgid "Show details" +msgstr "Exibir Detalhes" + +#. module: contract_layout_category_hide_detail +#: model:ir.model.fields,field_description:contract_layout_category_hide_detail.field_contract_abstract_contract_line__show_subtotal +#: model:ir.model.fields,field_description:contract_layout_category_hide_detail.field_contract_line__show_subtotal +#: model:ir.model.fields,field_description:contract_layout_category_hide_detail.field_contract_template_line__show_subtotal +msgid "Show subtotal" +msgstr "Exibir subtotal" diff --git a/contract_layout_category_hide_detail/models/__init__.py b/contract_layout_category_hide_detail/models/__init__.py new file mode 100644 index 000000000..fb37df5c1 --- /dev/null +++ b/contract_layout_category_hide_detail/models/__init__.py @@ -0,0 +1,4 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import abstract_contract_line +from . import contract_line diff --git a/contract_layout_category_hide_detail/models/abstract_contract_line.py b/contract_layout_category_hide_detail/models/abstract_contract_line.py new file mode 100644 index 000000000..8511c425a --- /dev/null +++ b/contract_layout_category_hide_detail/models/abstract_contract_line.py @@ -0,0 +1,11 @@ +# Copyright 2020 Tecnativa - Ernesto Tejeda +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class ContractAbstractContractLine(models.AbstractModel): + _inherit = "contract.abstract.contract.line" + + show_details = fields.Boolean(string="Show details", default=True) + show_subtotal = fields.Boolean(string="Show subtotal", default=True) diff --git a/contract_layout_category_hide_detail/models/contract_line.py b/contract_layout_category_hide_detail/models/contract_line.py new file mode 100644 index 000000000..f849951af --- /dev/null +++ b/contract_layout_category_hide_detail/models/contract_line.py @@ -0,0 +1,20 @@ +# Copyright 2020 Tecnativa - Ernesto Tejeda +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + + +from odoo import models + + +class ContractLine(models.Model): + _inherit = "contract.line" + + def _prepare_invoice_line(self, move_form): + vals = super()._prepare_invoice_line(move_form) + # If the line has skip_zero_qty field (provided by contract_variable + # quantity module) set to 'True' and 'quantity' field' is zero then + # 'vals' will be equal to {} + if vals: + vals.update( + show_details=self.show_details, show_subtotal=self.show_subtotal, + ) + return vals diff --git a/contract_layout_category_hide_detail/readme/CONTRIBUTORS.rst b/contract_layout_category_hide_detail/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..bef4cdf82 --- /dev/null +++ b/contract_layout_category_hide_detail/readme/CONTRIBUTORS.rst @@ -0,0 +1,5 @@ +* `Tecnativa `_: + + * Ernesto Tejeda + * Pedro M. Baeza + * Víctor Martínez diff --git a/contract_layout_category_hide_detail/readme/DESCRIPTION.rst b/contract_layout_category_hide_detail/readme/DESCRIPTION.rst new file mode 100644 index 000000000..85d29d7f9 --- /dev/null +++ b/contract_layout_category_hide_detail/readme/DESCRIPTION.rst @@ -0,0 +1,4 @@ +This module allows you to check/uncheck 'Show details' and +'Show subtotal' flags for *Recurring invoices section lines* +in Customer Contracts and Supplier Contracts so that +Invoices are generated with this information. diff --git a/contract_layout_category_hide_detail/readme/ROADMAP.rst b/contract_layout_category_hide_detail/readme/ROADMAP.rst new file mode 100644 index 000000000..b86f1c5e5 --- /dev/null +++ b/contract_layout_category_hide_detail/readme/ROADMAP.rst @@ -0,0 +1 @@ +* Unit tests are needed diff --git a/contract_layout_category_hide_detail/readme/USAGE.rst b/contract_layout_category_hide_detail/readme/USAGE.rst new file mode 100644 index 000000000..f4d524b8b --- /dev/null +++ b/contract_layout_category_hide_detail/readme/USAGE.rst @@ -0,0 +1,41 @@ +To use this module, you need to: + +#. Go to *Invoicing -> Customers -> Customer Contracts* and create + a new *Contract*. +#. In *Recurring Invoices* tab add a section line. +#. Add some product lines. +#. Add a section line, but this time, click on the *plus-circle* + icon |plus-circle-icon| on your right. That icon will be replaced by + *minus-circle* icon |minus-circle-icon|. That means *Show subtotal* field is + set to False. (You can also set *Show subtotal* field to False/True + in the pop-up form when you click on the section line) +#. Add some product lines. +#. Add another section line and click on the *eye* icon |eye-icon| on your + right. That icon will be replaced by *eye-slash* icon |eye-slash-icon|. + That means *Show details* field is set to False. (You can also set + *Show details* field to False/True in the pop-up form when you + click on the section line) +#. Add some product lines. +#. Then, when the Invoice is generated, you will see that it will have the + information regarding "Show details" and "Show subtotal" specified in + the previous steps. + +For more information about *Show details* and *Show subtotal* flags in +Invoices: see `'Usage' section of the 'Sale layout category hide detail' +module `_ + +.. |eye-icon| image:: ../static/description/readme-icons/eye.png + :alt: plus-circle icon + :width: 12 px + +.. |eye-slash-icon| image:: ../static/description/readme-icons/eye-slash.png + :alt: minus-circle icon + :width: 12 px + +.. |plus-circle-icon| image:: ../static/description/readme-icons/plus-circle.png + :alt: plus-circle icon + :width: 12 px + +.. |minus-circle-icon| image:: ../static/description/readme-icons/minus-circle.png + :alt: minus-circle icon + :width: 12 px diff --git a/contract_layout_category_hide_detail/static/description/icon.png b/contract_layout_category_hide_detail/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/contract_layout_category_hide_detail/static/description/icon.png differ diff --git a/contract_layout_category_hide_detail/static/description/index.html b/contract_layout_category_hide_detail/static/description/index.html new file mode 100644 index 000000000..2042536b9 --- /dev/null +++ b/contract_layout_category_hide_detail/static/description/index.html @@ -0,0 +1,462 @@ + + + + + + +Contract layout category hide detail + + + +
+

Contract layout category hide detail

+ + +

Beta License: AGPL-3 OCA/contract Translate me on Weblate Try me on Runbot

+

This module allows you to check/uncheck ‘Show details’ and +‘Show subtotal’ flags for Recurring invoices section lines +in Customer Contracts and Supplier Contracts so that +Invoices are generated with this information.

+

Table of contents

+ +
+

Usage

+

To use this module, you need to:

+
    +
  1. Go to Invoicing -> Customers -> Customer Contracts and create +a new Contract.
  2. +
  3. In Recurring Invoices tab add a section line.
  4. +
  5. Add some product lines.
  6. +
  7. Add a section line, but this time, click on the plus-circle +icon plus-circle icon on your right. That icon will be replaced by +minus-circle icon minus-circle icon. That means Show subtotal field is +set to False. (You can also set Show subtotal field to False/True +in the pop-up form when you click on the section line)
  8. +
  9. Add some product lines.
  10. +
  11. Add another section line and click on the eye icon plus-circle icon on your +right. That icon will be replaced by eye-slash icon minus-circle icon. +That means Show details field is set to False. (You can also set +Show details field to False/True in the pop-up form when you +click on the section line)
  12. +
  13. Add some product lines.
  14. +
  15. Then, when the Invoice is generated, you will see that it will have the +information regarding “Show details” and “Show subtotal” specified in +the previous steps.
  16. +
+

For more information about Show details and Show subtotal flags in +Invoices: see ‘Usage’ section of the ‘Sale layout category hide detail’ +module

+
+
+

Known issues / Roadmap

+
    +
  • Unit tests are needed
  • +
+
+
+

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 smashing 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:
      +
    • Ernesto Tejeda
    • +
    • Pedro M. Baeza
    • +
    +
  • +
+
+
+

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

+

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

+
+
+
+ + diff --git a/contract_layout_category_hide_detail/static/description/readme-icons/eye-slash.png b/contract_layout_category_hide_detail/static/description/readme-icons/eye-slash.png new file mode 100644 index 000000000..310a7a4c4 Binary files /dev/null and b/contract_layout_category_hide_detail/static/description/readme-icons/eye-slash.png differ diff --git a/contract_layout_category_hide_detail/static/description/readme-icons/eye.png b/contract_layout_category_hide_detail/static/description/readme-icons/eye.png new file mode 100644 index 000000000..7c892be8a Binary files /dev/null and b/contract_layout_category_hide_detail/static/description/readme-icons/eye.png differ diff --git a/contract_layout_category_hide_detail/static/description/readme-icons/minus-circle.png b/contract_layout_category_hide_detail/static/description/readme-icons/minus-circle.png new file mode 100644 index 000000000..ed324cb6a Binary files /dev/null and b/contract_layout_category_hide_detail/static/description/readme-icons/minus-circle.png differ diff --git a/contract_layout_category_hide_detail/static/description/readme-icons/plus-circle.png b/contract_layout_category_hide_detail/static/description/readme-icons/plus-circle.png new file mode 100644 index 000000000..cf7d62cc3 Binary files /dev/null and b/contract_layout_category_hide_detail/static/description/readme-icons/plus-circle.png differ diff --git a/contract_layout_category_hide_detail/views/abstract_contract_line.xml b/contract_layout_category_hide_detail/views/abstract_contract_line.xml new file mode 100644 index 000000000..aed10e5ad --- /dev/null +++ b/contract_layout_category_hide_detail/views/abstract_contract_line.xml @@ -0,0 +1,22 @@ + + + + contract.abstract.contract.line.hide.details + contract.abstract.contract.line + + + + + + + + + + + diff --git a/contract_layout_category_hide_detail/views/contract.xml b/contract_layout_category_hide_detail/views/contract.xml new file mode 100644 index 000000000..b1ce8cfb3 --- /dev/null +++ b/contract_layout_category_hide_detail/views/contract.xml @@ -0,0 +1,81 @@ + + + + contract.contract.form.hide.details + contract.contract + + + + + + + + + + + + + diff --git a/oca_dependencies.txt b/oca_dependencies.txt index 34f82ae94..dcd607ed1 100644 --- a/oca_dependencies.txt +++ b/oca_dependencies.txt @@ -1 +1,2 @@ bank-payment +sale-reporting diff --git a/setup/contract_layout_category_hide_detail/odoo/addons/contract_layout_category_hide_detail b/setup/contract_layout_category_hide_detail/odoo/addons/contract_layout_category_hide_detail new file mode 120000 index 000000000..25fe67c40 --- /dev/null +++ b/setup/contract_layout_category_hide_detail/odoo/addons/contract_layout_category_hide_detail @@ -0,0 +1 @@ +../../../../contract_layout_category_hide_detail \ No newline at end of file diff --git a/setup/contract_layout_category_hide_detail/setup.py b/setup/contract_layout_category_hide_detail/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/contract_layout_category_hide_detail/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)