diff --git a/l10n_br_product_contract/README.rst b/l10n_br_product_contract/README.rst new file mode 100644 index 000000000000..b7cfa49eaacf --- /dev/null +++ b/l10n_br_product_contract/README.rst @@ -0,0 +1,91 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +======================== +L10n Br Product Contract +======================== + +Criação de contratos através dos Pedidos de Vendas + +Installation +============ + +To install this module, you need to: + +#. Do this ... + +Configuration +============= + +To configure this module, you need to: + +#. Go to ... + +.. figure:: path/to/local/image.png + :alt: alternative description + :width: 600 px + +Usage +===== + +To use this module, you need to: + +#. Go to ... + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/{repo_id}/{branch} + +.. repo_id is available in https://github.com/OCA/maintainer-tools/blob/master/tools/repos_with_ids.txt +.. branch is "8.0" for example + +Known issues / Roadmap +====================== + +* ... + +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 smash it by providing detailed and welcomed feedback. + +Credits +======= + +Images +------ + +* Odoo Community Association: `Icon `_. + +Contributors +------------ + +* Firstname Lastname +* Second Person + +Funders +------- + +The development of this module has been financially supported by: + +* Company 1 name +* Company 2 name + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +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. + +To contribute to this module, please visit https://odoo-community.org. diff --git a/l10n_br_product_contract/__init__.py b/l10n_br_product_contract/__init__.py new file mode 100644 index 000000000000..0650744f6bc6 --- /dev/null +++ b/l10n_br_product_contract/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/l10n_br_product_contract/__manifest__.py b/l10n_br_product_contract/__manifest__.py new file mode 100644 index 000000000000..8f6f036feeac --- /dev/null +++ b/l10n_br_product_contract/__manifest__.py @@ -0,0 +1,22 @@ +# Copyright 2021 KMEE +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + 'name': 'L10n Br Product Contract', + 'summary': """ + Criação de contratos através dos Pedidos de Vendas""", + 'version': '12.0.1.0.0', + 'license': 'AGPL-3', + 'author': 'KMEE,Odoo Community Association (OCA)', + 'website': 'https://github.com/oca/l10n-brazil.git', + 'depends': [ + 'l10n_br_contract', + 'product_contract', + ], + 'data': [ + ], + 'demo': [ + 'demo/sale_order_line.xml', + 'demo/sale_order.xml', + ], +} diff --git a/l10n_br_product_contract/demo/sale_order.xml b/l10n_br_product_contract/demo/sale_order.xml new file mode 100644 index 000000000000..3552a23a6dd8 --- /dev/null +++ b/l10n_br_product_contract/demo/sale_order.xml @@ -0,0 +1,13 @@ + + + + + + + + diff --git a/l10n_br_product_contract/demo/sale_order_line.xml b/l10n_br_product_contract/demo/sale_order_line.xml new file mode 100644 index 000000000000..4ed8cf469fa8 --- /dev/null +++ b/l10n_br_product_contract/demo/sale_order_line.xml @@ -0,0 +1,13 @@ + + + + + + + + diff --git a/l10n_br_product_contract/models/__init__.py b/l10n_br_product_contract/models/__init__.py new file mode 100644 index 000000000000..2d7ee6c3dc75 --- /dev/null +++ b/l10n_br_product_contract/models/__init__.py @@ -0,0 +1,2 @@ +from . import sale_order +from . import sale_order_line diff --git a/l10n_br_product_contract/models/sale_order.py b/l10n_br_product_contract/models/sale_order.py new file mode 100644 index 000000000000..142bec505a58 --- /dev/null +++ b/l10n_br_product_contract/models/sale_order.py @@ -0,0 +1,16 @@ +# Copyright 2021 KMEE +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models, _ + + +class SaleOrder(models.Model): + + _inherit = 'sale.order' + + @api.multi + def _prepare_contract_value(self, contract_template): + self.ensure_one() + vals = self._prepare_br_fiscal_dict() + vals.update(super()._prepare_contract_value(contract_template)) + return vals diff --git a/l10n_br_product_contract/models/sale_order_line.py b/l10n_br_product_contract/models/sale_order_line.py new file mode 100644 index 000000000000..13e82b5e341b --- /dev/null +++ b/l10n_br_product_contract/models/sale_order_line.py @@ -0,0 +1,20 @@ +# Copyright 2021 KMEE +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models, _ + + +class SaleOrderLine(models.Model): + + _inherit = 'sale.order.line' + + + @api.multi + def _prepare_contract_line_values( + self, contract, predecessor_contract_line_id=False + ): + vals = self._prepare_br_fiscal_dict() + vals.update(super()._prepare_contract_line_values( + contract, predecessor_contract_line_id + )) + return vals diff --git a/l10n_br_product_contract/readme/CONFIGURE.rst b/l10n_br_product_contract/readme/CONFIGURE.rst new file mode 100644 index 000000000000..348d947ee594 --- /dev/null +++ b/l10n_br_product_contract/readme/CONFIGURE.rst @@ -0,0 +1,6 @@ +[ This file is optional, it should explain how to configure + the module before using it; it is aimed at advanced users. ] + +To configure this module, you need to: + +#. Go to do nothing diff --git a/l10n_br_product_contract/readme/CONTRIBUTORS.rst b/l10n_br_product_contract/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000000..0b43fe9818c9 --- /dev/null +++ b/l10n_br_product_contract/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* Luis Felipe Mileo + diff --git a/l10n_br_product_contract/readme/CREDITS.rst b/l10n_br_product_contract/readme/CREDITS.rst new file mode 100644 index 000000000000..e38eec44e563 --- /dev/null +++ b/l10n_br_product_contract/readme/CREDITS.rst @@ -0,0 +1,6 @@ +[ This file is optional and contains additional credits, other than + authors, contributors, and maintainers. ] + +The development of this module has been financially supported by: + +* KMEE diff --git a/l10n_br_product_contract/readme/DESCRIPTION.rst b/l10n_br_product_contract/readme/DESCRIPTION.rst new file mode 100644 index 000000000000..3c022df93240 --- /dev/null +++ b/l10n_br_product_contract/readme/DESCRIPTION.rst @@ -0,0 +1,5 @@ +[ This file must be max 2-3 paragraphs, and is required. ] + +This module extends the functionality of product_contact to support l10n_br_contract +and to allow you to create fiscal documents with the same fiscal configuration of the sale orders. + diff --git a/l10n_br_product_contract/readme/HISTORY.rst b/l10n_br_product_contract/readme/HISTORY.rst new file mode 100644 index 000000000000..0b12215cd12f --- /dev/null +++ b/l10n_br_product_contract/readme/HISTORY.rst @@ -0,0 +1,14 @@ +[ The change log. The goal of this file is to help readers + understand changes between version. The primary audience is + end users and integrators. Purely technical changes such as + code refactoring must not be mentioned here. + + This file may contain ONE level of section titles, underlined + with the ~ (tilde) character. Other section markers are + forbidden and will likely break the structure of the README.rst + or other documents where this fragment is included. ] + +12.0.1.0.0 (2021-02-11) +~~~~~~~~~~~~~~~~~~~~~~~ + +* [NEW] First Release diff --git a/l10n_br_product_contract/readme/INSTALL.rst b/l10n_br_product_contract/readme/INSTALL.rst new file mode 100644 index 000000000000..ee57bca1996c --- /dev/null +++ b/l10n_br_product_contract/readme/INSTALL.rst @@ -0,0 +1,7 @@ +[ This file must only be present if there are very specific + installation instructions, such as installing non-python + dependencies. The audience is systems administrators. ] + +To install this module, you need to: + +#. Do nothing diff --git a/l10n_br_product_contract/readme/ROADMAP.rst b/l10n_br_product_contract/readme/ROADMAP.rst new file mode 100644 index 000000000000..207233013b40 --- /dev/null +++ b/l10n_br_product_contract/readme/ROADMAP.rst @@ -0,0 +1,5 @@ +[ Enumerate known caveats and future potential improvements. + It is mostly intended for end-users, and can also help + potential new contributors discovering new features to implement. ] + +* ... diff --git a/l10n_br_product_contract/readme/USAGE.rst b/l10n_br_product_contract/readme/USAGE.rst new file mode 100644 index 000000000000..7969eea52f69 --- /dev/null +++ b/l10n_br_product_contract/readme/USAGE.rst @@ -0,0 +1,13 @@ +[ This file must be present and contains the usage instructions + for end-users. As all other rst files included in the README, + it MUST NOT contain reStructuredText sections + only body text (paragraphs, lists, tables, etc). Should you need + a more elaborate structure to explain the addon, please create a + Sphinx documentation (which may include this file as a "quick start" + section). ] + +To use this module, you need to: + +#. Configure the products as contracts; +#. Create a sale order, with this product and confirm. + diff --git a/l10n_br_product_contract/readme/newsfragments/.gitkeep b/l10n_br_product_contract/readme/newsfragments/.gitkeep new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/l10n_br_product_contract/static/description/icon.png b/l10n_br_product_contract/static/description/icon.png new file mode 100644 index 000000000000..3a0328b516c4 Binary files /dev/null and b/l10n_br_product_contract/static/description/icon.png differ