Skip to content

Commit

Permalink
[NEW] L10n BR Product Contract
Browse files Browse the repository at this point in the history
  • Loading branch information
mileo authored and kaynnan committed Apr 12, 2023
1 parent c274e56 commit f226b42
Show file tree
Hide file tree
Showing 18 changed files with 236 additions and 0 deletions.
91 changes: 91 additions & 0 deletions l10n_br_product_contract/README.rst
Original file line number Diff line number Diff line change
@@ -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
<https://github.com/OCA/{project_repo}/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 <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.

Contributors
------------

* Firstname Lastname <[email protected]>
* Second Person <[email protected]>

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.
1 change: 1 addition & 0 deletions l10n_br_product_contract/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
22 changes: 22 additions & 0 deletions l10n_br_product_contract/__manifest__.py
Original file line number Diff line number Diff line change
@@ -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',
],
}
13 changes: 13 additions & 0 deletions l10n_br_product_contract/demo/sale_order.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2021 KMEE
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->

<odoo noupdate="1">

<!-- TODO
<record model="sale.order" id="sale_order_demo_1">
<field name="name">...</field>
</record>
-->

</odoo>
13 changes: 13 additions & 0 deletions l10n_br_product_contract/demo/sale_order_line.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2021 KMEE
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->

<odoo noupdate="1">

<!-- TODO
<record model="sale.order.line" id="sale_order_line_demo_1">
<field name="name">...</field>
</record>
-->

</odoo>
2 changes: 2 additions & 0 deletions l10n_br_product_contract/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import sale_order
from . import sale_order_line
16 changes: 16 additions & 0 deletions l10n_br_product_contract/models/sale_order.py
Original file line number Diff line number Diff line change
@@ -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
20 changes: 20 additions & 0 deletions l10n_br_product_contract/models/sale_order_line.py
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions l10n_br_product_contract/readme/CONFIGURE.rst
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions l10n_br_product_contract/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Luis Felipe Mileo <[email protected]>

6 changes: 6 additions & 0 deletions l10n_br_product_contract/readme/CREDITS.rst
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions l10n_br_product_contract/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -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.

14 changes: 14 additions & 0 deletions l10n_br_product_contract/readme/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions l10n_br_product_contract/readme/INSTALL.rst
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions l10n_br_product_contract/readme/ROADMAP.rst
Original file line number Diff line number Diff line change
@@ -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. ]

* ...
13 changes: 13 additions & 0 deletions l10n_br_product_contract/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -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.

Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f226b42

Please sign in to comment.