Skip to content

Commit

Permalink
Port *unece* modules to odoo 10
Browse files Browse the repository at this point in the history
  • Loading branch information
alexis-via committed Mar 17, 2017
1 parent 2956305 commit 079d4a8
Show file tree
Hide file tree
Showing 26 changed files with 113 additions and 166 deletions.
12 changes: 4 additions & 8 deletions account_payment_unece/README.rst
Expand Up @@ -6,7 +6,7 @@
Account Payment UNECE
=====================

This module adds a field *UNECE Payment Mean* on *Payment Mode Types* to be able to use a standard written by the `United Nations Economic Commission for Europe <http://www.unece.org>`_ (which has 56 members states in Europe, America and Central Asia, cf `Wikipedia <https://en.wikipedia.org/wiki/United_Nations_Economic_Commission_for_Europe>`_). This standard define a codification of the payment modes, cf the `official code list <http://www.unece.org/trade/untdid/d99b/tred/tred4461.htm>`_.
This module adds a field *UNECE Payment Mean* on *Payment Methods* to be able to use a standard written by the `United Nations Economic Commission for Europe <http://www.unece.org>`_ (which has 56 members states in Europe, America and Central Asia, cf `Wikipedia <https://en.wikipedia.org/wiki/United_Nations_Economic_Commission_for_Europe>`_). This standard define a codification of the payment modes, cf the `official code list <http://www.unece.org/trade/untdid/d99b/tred/tred4461.htm>`_.

This codification is used for example in the two main international standards for electronic invoicing:

Expand All @@ -16,27 +16,23 @@ This codification is used for example in the two main international standards fo
Configuration
=============

Go to the menu *Accounting > Configuration > Miscellaneous > Payment Export Types* and select the appropriate value for the *UNECE Code*.
Go to the menu *Accounting > Configuration > Management > Payment Methods* and, on each payment method, select the appropriate value for the *UNECE Code*.

Usage
=====


.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/101/8.0
:target: https://runbot.odoo-community.org/runbot/101/10.0

Bug Tracker
===========

Bugs are tracked on `GitHub Issues
<https://github.com/OCA/community-data-files/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
<https://github.com/OCA/
community-data-files/issues/new?body=module:%20
account_payment_unece%0Aversion:%20
8.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
help us smashing it by providing a detailed and welcomed feedback.

Credits
=======
Expand Down
Expand Up @@ -5,16 +5,16 @@

{
'name': 'Account Payment UNECE',
'version': '8.0.1.0.0',
'version': '10.0.1.0.0',
'category': 'Accounting & Finance',
'license': 'AGPL-3',
'summary': 'UNECE nomenclature for the payment mode types',
'summary': 'UNECE nomenclature for the payment methods',
'author': 'Akretion,Odoo Community Association (OCA)',
'website': 'http://www.akretion.com',
'depends': ['account_banking_payment_export', 'base_unece'],
'depends': ['account_payment_mode', 'base_unece'],
'data': [
'data/unece.xml',
'views/payment_mode_type.xml',
'views/account_payment_method.xml',
],
'installable': True,
}
11 changes: 2 additions & 9 deletions account_payment_unece/data/unece.xml
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="0">
<odoo noupdate="0">

<!-- unece.code.list
Source : http://www.unece.org/trade/untdid/d99b/tred/tred4461.htm -->
Expand Down Expand Up @@ -507,10 +506,4 @@ But it is used in real life (cf Chorus specs for example: http://www.economie.go
</record>


<record id="account_banking_payment_export.manual_bank_tranfer" model="payment.mode.type">
<field name="unece_id" ref="payment_means_31"/>
</record>


</data>
</openerp>
</odoo>
2 changes: 1 addition & 1 deletion account_payment_unece/models/__init__.py
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-

from . import unece_code_list
from . import payment_mode_type
from . import account_payment_method
Expand Up @@ -3,15 +3,15 @@
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openerp import models, fields
from odoo import models, fields


class PaymentModeType(models.Model):
_inherit = 'payment.mode.type'
class AccountPaymentMethod(models.Model):
_inherit = 'account.payment.method'

unece_id = fields.Many2one(
'unece.code.list', string='UNECE Payment Mean',
domain=[('type', '=', 'payment_means')],
domain=[('type', '=', 'payment_means')], ondelete='restrict',
help="Standard nomenclature of the United Nations Economic "
"Commission for Europe (UNECE) defined in UN/EDIFACT Data "
"Element 4461")
Expand Down
2 changes: 1 addition & 1 deletion account_payment_unece/models/unece_code_list.py
Expand Up @@ -3,7 +3,7 @@
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openerp import models, fields
from odoo import models, fields


class UneceCodeList(models.Model):
Expand Down
33 changes: 33 additions & 0 deletions account_payment_unece/views/account_payment_method.xml
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
© 2016 Akretion (http://www.akretion.com/)
@author Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>


<record id="account_payment_method_form" model="ir.ui.view">
<field name="name">unece.account.payment.method.form</field>
<field name="model">account.payment.method</field>
<field name="inherit_id" ref="account_payment_mode.account_payment_method_form"/>
<field name="arch" type="xml">
<group name="main" position="inside">
<field name="unece_id" context="{'default_type': 'payment_means'}"/>
</group>
</field>
</record>

<record id="account_payment_method_tree" model="ir.ui.view">
<field name="name">unece.account.payment.method.tree</field>
<field name="model">account.payment.method</field>
<field name="inherit_id" ref="account_payment_mode.account_payment_method_tree"/>
<field name="arch" type="xml">
<field name="code" position="after">
<field name="unece_code"/>
</field>
</field>
</record>


</odoo>
35 changes: 0 additions & 35 deletions account_payment_unece/views/payment_mode_type.xml

This file was deleted.

10 changes: 3 additions & 7 deletions account_tax_unece/README.rst
Expand Up @@ -19,26 +19,22 @@ This codification is part of the UNCL (United Nations Code List). This codificat
Configuration
=============

Go to the menu *Accounting > Configuration > Taxes > Taxes* and configure the *UNECE Type Code* (default value is *VAT*) and the *UNECE Category Code*.
Go to the menu *Accounting > Configuration > Accounting > Taxes* and configure the *UNECE Type Code* (the value should be *VAT* for most of your taxes) and the *UNECE Category Code*.

Usage
=====

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/101/8.0
:target: https://runbot.odoo-community.org/runbot/101/10.0

Bug Tracker
===========

Bugs are tracked on `GitHub Issues
<https://github.com/OCA/community-data-files/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
<https://github.com/OCA/
community-data-files/issues/new?body=module:%20
account_unece%0Aversion:%20
8.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
help us smashing it by providing a detailed and welcomed feedback.

Credits
=======
Expand Down
Expand Up @@ -5,7 +5,7 @@

{
'name': 'Account Tax UNECE',
'version': '8.0.1.0.0',
'version': '10.0.1.0.0',
'category': 'Accounting & Finance',
'license': 'AGPL-3',
'summary': 'UNECE nomenclature for taxes',
Expand Down
6 changes: 2 additions & 4 deletions account_tax_unece/data/unece_tax_categ.xml
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="0">
<odoo noupdate="0">

<!-- unece.code.list
Source : http://www.unece.org/trade/untdid/d97a/uncl/uncl5305.htm -->
Expand Down Expand Up @@ -97,5 +96,4 @@ Source : http://www.unece.org/trade/untdid/d97a/uncl/uncl5305.htm -->
</record>


</data>
</openerp>
</odoo>
6 changes: 2 additions & 4 deletions account_tax_unece/data/unece_tax_type.xml
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="0">
<odoo noupdate="0">

<!-- unece.code.list
Source : http://www.unece.org/trade/untdid/d97b/uncl/uncl5153.htm -->
Expand Down Expand Up @@ -321,5 +320,4 @@ Source : http://www.unece.org/trade/untdid/d97b/uncl/uncl5153.htm -->
</record>


</data>
</openerp>
</odoo>
6 changes: 3 additions & 3 deletions account_tax_unece/models/account_tax.py
Expand Up @@ -3,15 +3,15 @@
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openerp import models, fields
from odoo import models, fields


class AccountTax(models.Model):
_inherit = 'account.tax'

unece_type_id = fields.Many2one(
'unece.code.list', string='UNECE Tax Type',
domain=[('type', '=', 'tax_type')],
domain=[('type', '=', 'tax_type')], ondelete='restrict',
help="Select the Tax Type Code of the official "
"nomenclature of the United Nations Economic "
"Commission for Europe (UNECE), DataElement 5153")
Expand All @@ -20,7 +20,7 @@ class AccountTax(models.Model):
string='UNECE Type Code')
unece_categ_id = fields.Many2one(
'unece.code.list', string='UNECE Tax Category',
domain=[('type', '=', 'tax_categ')],
domain=[('type', '=', 'tax_categ')], ondelete='restrict',
help="Select the Tax Category Code of the official "
"nomenclature of the United Nations Economic "
"Commission for Europe (UNECE), DataElement 5305")
Expand Down
2 changes: 1 addition & 1 deletion account_tax_unece/models/unece_code_list.py
Expand Up @@ -3,7 +3,7 @@
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openerp import models, fields
from odoo import models, fields


class UneceCodeList(models.Model):
Expand Down
20 changes: 9 additions & 11 deletions account_tax_unece/views/account_tax.xml
@@ -1,26 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2016 Akretion (http://www.akretion.com/)
@author Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
© 2016 Akretion (http://www.akretion.com/)
@author Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->

<openerp>
<data>
<odoo>


<record id="view_tax_form" model="ir.ui.view">
<field name="name">unece.account.tax.form</field>
<field name="model">account.tax</field>
<field name="inherit_id" ref="account.view_tax_form"/>
<field name="arch" type="xml">
<field name="child_depend" position="after">
<field name="unece_type_id"/>
<field name="unece_categ_id"/>
</field>
<group name="advanced_booleans" position="inside">
<field name="unece_type_id" context="{'default_type': 'tax_type'}"/>
<field name="unece_categ_id" context="{'default_type': 'tax_categ'}"/>
</group>
</field>
</record>


</data>
</openerp>
</odoo>
10 changes: 3 additions & 7 deletions base_unece/README.rst
Expand Up @@ -11,26 +11,22 @@ This module adds the technical basis for the use of the code lists standardized
Configuration
=============

The configuration takes place in the menu *Sales > Configuration > UNECE Code Lists*.
The configuration takes place in the menu *Settings > Technical > Parameters > UNECE Code Lists*.

Usage
=====

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/101/8.0
:target: https://runbot.odoo-community.org/runbot/101/10.0

Bug Tracker
===========

Bugs are tracked on `GitHub Issues
<https://github.com/OCA/community-data-files/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
<https://github.com/OCA/
community-data-files/issues/new?body=module:%20
base_unece%0Aversion:%20
8.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
help us smashing it by providing a detailed and welcomed feedback.

Credits
=======
Expand Down
2 changes: 1 addition & 1 deletion base_unece/__openerp__.py → base_unece/__manifest__.py
Expand Up @@ -5,7 +5,7 @@

{
'name': 'Base UNECE',
'version': '8.0.1.0.0',
'version': '10.0.1.0.0',
'category': 'Tools',
'license': 'AGPL-3',
'summary': 'Base module for UNECE code lists',
Expand Down
2 changes: 1 addition & 1 deletion base_unece/models/unece_code_list.py
Expand Up @@ -3,7 +3,7 @@
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openerp import models, fields, api
from odoo import models, fields, api


# There are so many UNCL that can be usefull in Odoo
Expand Down

0 comments on commit 079d4a8

Please sign in to comment.