Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.0] Port intrastat_product to odoo 10 #10

Merged
merged 3 commits into from
Mar 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion intrastat_base/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
'views/res_partner.xml',
'views/res_country.xml',
'views/account_tax.xml',
'views/res_company.xml',
'views/account_config_settings.xml',
'views/intrastat.xml',
],
'demo': [
Expand Down
1 change: 1 addition & 0 deletions intrastat_base/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
from . import product_template
from . import account_tax
from . import res_company
from . import account_config_settings
from . import intrastat_common
12 changes: 12 additions & 0 deletions intrastat_base/models/account_config_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# -*- coding: utf-8 -*-
# © 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import models, fields


class AccountConfigSettings(models.TransientModel):
_inherit = 'account.config.settings'

intrastat_remind_user_ids = fields.Many2many(
related='company_id.intrastat_remind_user_ids')
2 changes: 1 addition & 1 deletion intrastat_base/models/res_company.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2013-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# © 2013-2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import models, fields, api, _
Expand Down
23 changes: 23 additions & 0 deletions intrastat_base/views/account_config_settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
© 2013-2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->

<odoo>

<record id="view_account_config_settings" model="ir.ui.view">
<field name="name">intrastat.account.config.settings.form</field>
<field name="model">account.config.settings</field>
<field name="inherit_id" ref="account.view_account_config_settings" />
<field name="arch" type="xml">
<xpath expr="//field[@name='overdue_msg']/.." position="after">
<group name="intrastat" string="Intrastat">
<field name="intrastat_remind_user_ids" widget="many2many_tags" />
</group>
</xpath>
</field>
</record>


</odoo>
2 changes: 1 addition & 1 deletion intrastat_base/views/intrastat.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<!-- Menu entries for Intrastat -->
<menuitem id="menu_intrastat_base_root"
name="Intrastat"
parent="account.menu_finance_legal_statement"/>
parent="account.menu_finance_reports" sequence="50"/>
<menuitem id="menu_intrastat_config_root" name="Intrastat"
parent="account.menu_finance_configuration" sequence="50"/>

Expand Down
26 changes: 0 additions & 26 deletions intrastat_base/views/res_company.xml

This file was deleted.

4 changes: 2 additions & 2 deletions intrastat_product/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ and adapt the code for the specific needs of your country.
Create also new objects inheriting from the Computation and Declaration Line Objects
so that you can add methods or customise the methods from the base modules (make a PR when
the customization or new method is required for multiple countries).

Adapt also the parent_id fields of the newly created objects
(cf. l10n_be_intrastat_product as example).

Expand All @@ -68,7 +68,7 @@ and adapt the code for the specific needs of your country.

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

Bug Tracker
===========
Expand Down
35 changes: 8 additions & 27 deletions intrastat_product/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,38 +1,19 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Intrastat Product module for Odoo
# Copyright (C) 2011-2015 Akretion (http://www.akretion.com)
# Copyright (C) 2009-2015 Noviat (http://www.noviat.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# @author Luc de Meyer <info@noviat.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# © 2011-2017 Akretion (http://www.akretion.com)
# © 2009-2017 Noviat (http://www.noviat.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# @author Luc de Meyer <info@noviat.com>

{
'name': 'Intrastat Product',
'version': '8.0.1.4.1',
'version': '10.0.1.0.0',
'category': 'Intrastat',
'license': 'AGPL-3',
'summary': 'Base module for Intrastat Product',
'author': 'Akretion, Noviat, Odoo Community Association (OCA)',
'depends': [
'intrastat_base',
'product_harmonized_system',
'stock_picking_invoice_link',
'sale_stock',
'purchase',
],
Expand All @@ -44,15 +25,15 @@
'views/intrastat_transaction.xml',
'views/intrastat_transport_mode.xml',
'views/intrastat_product_declaration.xml',
'views/res_company.xml',
'views/account_config_settings.xml',
'views/account_invoice.xml',
'views/stock_picking.xml',
'views/sale_order.xml',
'views/stock_warehouse.xml',
'security/intrastat_security.xml',
'security/ir.model.access.csv',
'data/intrastat_transport_mode.xml',
'data/intrastat_unit.xml',
],
'demo': ['demo/intrastat_demo.xml'],
'installable': False,
'installable': True,
}
6 changes: 2 additions & 4 deletions intrastat_product/data/intrastat_transport_mode.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<odoo noupdate="1">

<record id="intrastat_transport_1" model="intrastat.transport_mode">
<field name="code">1</field>
Expand Down Expand Up @@ -49,5 +48,4 @@
<field name="intrastat_transport_id" ref="intrastat_transport_3"/>
</record>

</data>
</openerp>
</odoo>
6 changes: 2 additions & 4 deletions intrastat_product/data/intrastat_unit.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<odoo noupdate="1">

<!-- Extracted from the Official Journal of the European Union -->

Expand Down Expand Up @@ -121,5 +120,4 @@
<field name="description">Terajoule (gross calorific value)</field>
</record>

</data>
</openerp>
</odoo>
13 changes: 5 additions & 8 deletions intrastat_product/demo/intrastat_demo.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>

<!--
Copyright (C) 2011-2015 Akretion (http://www.akretion.com/)
@author Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
© 2011-2017 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 noupdate="1">
<odoo noupdate="1">

<record id="product_harmonized_system.84715000" model="hs.code">
<field name="intrastat_unit_id" ref="intrastat_unit_pce"/>
Expand All @@ -24,5 +22,4 @@
<field name="intrastat_transport_id" ref="intrastat_transport_3"/>
</record>

</data>
</openerp>
</odoo>
2 changes: 1 addition & 1 deletion intrastat_product/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
from . import res_company
from . import account_config_settings
from . import account_invoice
from . import hs_code
from . import intrastat_product_declaration
Expand All @@ -8,5 +9,4 @@
from . import intrastat_transport_mode
from . import intrastat_unit
from . import sale_order
from . import stock_picking
from . import stock_warehouse
31 changes: 31 additions & 0 deletions intrastat_product/models/account_config_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
# © 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import models, fields


class AccountConfigSettings(models.TransientModel):
_inherit = 'account.config.settings'

intrastat_incoterm_id = fields.Many2one(
related='company_id.intrastat_incoterm_id')
intrastat_arrivals = fields.Selection(
related='company_id.intrastat_arrivals')
intrastat_dispatches = fields.Selection(
related='company_id.intrastat_dispatches')
intrastat = fields.Char(related='company_id.intrastat', readonly=True)
intrastat_transport_id = fields.Many2one(
related='company_id.intrastat_transport_id')
intrastat_region_id = fields.Many2one(
related='company_id.intrastat_region_id')
intrastat_transaction_out_invoice = fields.Many2one(
related='company_id.intrastat_transaction_out_invoice')
intrastat_transaction_out_refund = fields.Many2one(
related='company_id.intrastat_transaction_out_refund')
intrastat_transaction_in_invoice = fields.Many2one(
related='company_id.intrastat_transaction_in_invoice')
intrastat_transaction_in_refund = fields.Many2one(
related='company_id.intrastat_transaction_in_refund')
intrastat_accessory_costs = fields.Boolean(
related='company_id.intrastat_accessory_costs')
Loading