mirror of
https://github.com/OCA/intrastat-extrastat.git
synced 2025-02-16 17:13:41 +02:00
[MIG] intrastat_product: Migration to 10.0
intrastat_base: Move company view params to account config page
This commit is contained in:
committed by
João Marques
parent
8bb9826df0
commit
4bbb1d7cda
@@ -2,9 +2,9 @@
|
|||||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||||
:alt: License: AGPL-3
|
:alt: License: AGPL-3
|
||||||
|
|
||||||
========================
|
=================
|
||||||
Intrastat Product Module
|
Intrastat Product
|
||||||
========================
|
=================
|
||||||
|
|
||||||
This module contains common objects and fields for the Intrastat Product reporting, such as the *H.S. codes* (if you are not familiar with H.S. codes, read `Wikipedia <http://en.wikipedia.org/wiki/Harmonized_System>`) and the *country of origin* on the products.
|
This module contains common objects and fields for the Intrastat Product reporting, such as the *H.S. codes* (if you are not familiar with H.S. codes, read `Wikipedia <http://en.wikipedia.org/wiki/Harmonized_System>`) and the *country of origin* on the products.
|
||||||
|
|
||||||
@@ -27,7 +27,6 @@ This module conflicts with the module *report_intrastat* from the official addon
|
|||||||
If you have already installed the module *report_intrastat*,
|
If you have already installed the module *report_intrastat*,
|
||||||
you should uninstall it before installing this module.
|
you should uninstall it before installing this module.
|
||||||
|
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
=====
|
=====
|
||||||
|
|
||||||
@@ -69,26 +68,16 @@ and adapt the code for the specific needs of your country.
|
|||||||
|
|
||||||
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
|
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
|
||||||
:alt: Try me on Runbot
|
:alt: Try me on Runbot
|
||||||
:target: https://runbot.odoo-community.org/runbot/91/8.0
|
:target: https://runbot.odoo-community.org/runbot/227/10.0
|
||||||
|
|
||||||
|
|
||||||
Known issues / Roadmap
|
|
||||||
======================
|
|
||||||
|
|
||||||
Work is in progress to migrate the existing l10n_fr_intrastat_product module
|
|
||||||
to this new reporting framework, cf. Alexis de Lattre, Akretion <alexis.delattre@akretion.com>.
|
|
||||||
|
|
||||||
|
|
||||||
Bug Tracker
|
Bug Tracker
|
||||||
===========
|
===========
|
||||||
|
|
||||||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-financial-reporting/issues>`_.
|
Bugs are tracked on `GitHub Issues
|
||||||
In case of trouble, please check there if your issue has already been reported.
|
<https://github.com/OCA/intrastat/issues>`_. In case
|
||||||
If you spotted it first, help us smashing it by providing a detailed and welcomed feedback `here <https://github.com/OCA/
|
of trouble, please check there if your issue has already been reported.
|
||||||
account-financial-reporting/issues/new?body=module:%20
|
If you spotted it first, help us smashing it by providing a detailed
|
||||||
intrastat_product%0Aversion:%20
|
and welcomed feedback.
|
||||||
8.0.1.4%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
|
||||||
|
|
||||||
|
|
||||||
Credits
|
Credits
|
||||||
=======
|
=======
|
||||||
@@ -99,7 +88,6 @@ Contributors
|
|||||||
* Alexis de Lattre, Akretion <alexis.delattre@akretion.com>
|
* Alexis de Lattre, Akretion <alexis.delattre@akretion.com>
|
||||||
* Luc De Meyer, Noviat <info@noviat.com>
|
* Luc De Meyer, Noviat <info@noviat.com>
|
||||||
|
|
||||||
|
|
||||||
Maintainer
|
Maintainer
|
||||||
----------
|
----------
|
||||||
|
|
||||||
@@ -113,4 +101,4 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
|
|||||||
mission is to support the collaborative development of Odoo features and
|
mission is to support the collaborative development of Odoo features and
|
||||||
promote its widespread use.
|
promote its widespread use.
|
||||||
|
|
||||||
To contribute to this module, please visit http://odoo-community.org.
|
To contribute to this module, please visit https://odoo-community.org.
|
||||||
|
|||||||
39
intrastat_product/__manifest__.py
Normal file
39
intrastat_product/__manifest__.py
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# © 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': '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',
|
||||||
|
'sale_stock',
|
||||||
|
'purchase',
|
||||||
|
],
|
||||||
|
'conflicts': ['report_intrastat'],
|
||||||
|
'data': [
|
||||||
|
'views/hs_code.xml',
|
||||||
|
'views/intrastat_region.xml',
|
||||||
|
'views/intrastat_unit.xml',
|
||||||
|
'views/intrastat_transaction.xml',
|
||||||
|
'views/intrastat_transport_mode.xml',
|
||||||
|
'views/intrastat_product_declaration.xml',
|
||||||
|
'views/account_config_settings.xml',
|
||||||
|
'views/account_invoice.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': True,
|
||||||
|
}
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
# -*- 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/>.
|
|
||||||
#
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
{
|
|
||||||
'name': 'Intrastat Product',
|
|
||||||
'version': '8.0.1.4.1',
|
|
||||||
'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',
|
|
||||||
],
|
|
||||||
'conflicts': ['report_intrastat'],
|
|
||||||
'data': [
|
|
||||||
'views/hs_code.xml',
|
|
||||||
'views/intrastat_region.xml',
|
|
||||||
'views/intrastat_unit.xml',
|
|
||||||
'views/intrastat_transaction.xml',
|
|
||||||
'views/intrastat_transport_mode.xml',
|
|
||||||
'views/intrastat_product_declaration.xml',
|
|
||||||
'views/res_company.xml',
|
|
||||||
'views/account_invoice.xml',
|
|
||||||
'views/stock_picking.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': True,
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<openerp>
|
<odoo noupdate="1">
|
||||||
<data noupdate="1">
|
|
||||||
|
|
||||||
<record id="intrastat_transport_1" model="intrastat.transport_mode">
|
<record id="intrastat_transport_1" model="intrastat.transport_mode">
|
||||||
<field name="code">1</field>
|
<field name="code">1</field>
|
||||||
@@ -49,5 +48,4 @@
|
|||||||
<field name="intrastat_transport_id" ref="intrastat_transport_3"/>
|
<field name="intrastat_transport_id" ref="intrastat_transport_3"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
</data>
|
</odoo>
|
||||||
</openerp>
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<openerp>
|
<odoo noupdate="1">
|
||||||
<data noupdate="1">
|
|
||||||
|
|
||||||
<!-- Extracted from the Official Journal of the European Union -->
|
<!-- Extracted from the Official Journal of the European Union -->
|
||||||
|
|
||||||
@@ -121,5 +120,4 @@
|
|||||||
<field name="description">Terajoule (gross calorific value)</field>
|
<field name="description">Terajoule (gross calorific value)</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
</data>
|
</odoo>
|
||||||
</openerp>
|
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Copyright (C) 2011-2015 Akretion (http://www.akretion.com/)
|
© 2011-2017 Akretion (http://www.akretion.com/)
|
||||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
The licence is in the file __openerp__.py
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<openerp>
|
<odoo noupdate="1">
|
||||||
<data noupdate="1">
|
|
||||||
|
|
||||||
<record id="product_harmonized_system.84715000" model="hs.code">
|
<record id="product_harmonized_system.84715000" model="hs.code">
|
||||||
<field name="intrastat_unit_id" ref="intrastat_unit_pce"/>
|
<field name="intrastat_unit_id" ref="intrastat_unit_pce"/>
|
||||||
@@ -24,5 +22,4 @@
|
|||||||
<field name="intrastat_transport_id" ref="intrastat_transport_3"/>
|
<field name="intrastat_transport_id" ref="intrastat_transport_3"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
</data>
|
</odoo>
|
||||||
</openerp>
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from . import res_company
|
from . import res_company
|
||||||
|
from . import account_config_settings
|
||||||
from . import account_invoice
|
from . import account_invoice
|
||||||
from . import hs_code
|
from . import hs_code
|
||||||
from . import intrastat_product_declaration
|
from . import intrastat_product_declaration
|
||||||
@@ -8,5 +9,4 @@ from . import intrastat_transaction
|
|||||||
from . import intrastat_transport_mode
|
from . import intrastat_transport_mode
|
||||||
from . import intrastat_unit
|
from . import intrastat_unit
|
||||||
from . import sale_order
|
from . import sale_order
|
||||||
from . import stock_picking
|
|
||||||
from . import stock_warehouse
|
from . import stock_warehouse
|
||||||
|
|||||||
31
intrastat_product/models/account_config_settings.py
Normal file
31
intrastat_product/models/account_config_settings.py
Normal file
@@ -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')
|
||||||
@@ -1,37 +1,17 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
##############################################################################
|
# © 2011-2017 Akretion (http://www.akretion.com)
|
||||||
#
|
# © 2009-2017 Noviat (http://www.noviat.com)
|
||||||
# Intrastat Product module for Odoo
|
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
# Copyright (C) 2011-2016 Akretion (http://www.akretion.com)
|
# @author Luc de Meyer <info@noviat.com>
|
||||||
# Copyright (C) 2009-2016 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/>.
|
|
||||||
#
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
from openerp import models, fields, api
|
from odoo import models, fields, api
|
||||||
|
|
||||||
|
|
||||||
class AccountInvoice(models.Model):
|
class AccountInvoice(models.Model):
|
||||||
_inherit = 'account.invoice'
|
_inherit = 'account.invoice'
|
||||||
|
|
||||||
incoterm_id = fields.Many2one(
|
# in v10, the sale_stock module defines an incoterms_id
|
||||||
'stock.incoterms', string='Incoterm',
|
# Odoo v8 name: incoterm_id
|
||||||
help="International Commercial Terms are a series of predefined "
|
|
||||||
"commercial terms used in international transactions.")
|
|
||||||
intrastat_transaction_id = fields.Many2one(
|
intrastat_transaction_id = fields.Many2one(
|
||||||
'intrastat.transaction', string='Intrastat Transaction Type',
|
'intrastat.transaction', string='Intrastat Transaction Type',
|
||||||
default=lambda self: self._default_intrastat_transaction_id(),
|
default=lambda self: self._default_intrastat_transaction_id(),
|
||||||
@@ -42,33 +22,38 @@ class AccountInvoice(models.Model):
|
|||||||
ondelete='restrict')
|
ondelete='restrict')
|
||||||
src_dest_country_id = fields.Many2one(
|
src_dest_country_id = fields.Many2one(
|
||||||
'res.country', string='Origin/Destination Country',
|
'res.country', string='Origin/Destination Country',
|
||||||
ondelete='restrict')
|
compute='_compute_intrastat_country',
|
||||||
src_dest_region_id = fields.Many2one(
|
store=True,
|
||||||
'intrastat.region', string='Origin/Destination Region',
|
help="Destination country for dispatches. Origin country for "
|
||||||
default=lambda self: self._default_src_dest_region_id(),
|
"arrivals.")
|
||||||
help="Origin/Destination Region."
|
|
||||||
"\nThis field is used for the Intrastat Declaration.",
|
|
||||||
ondelete='restrict')
|
|
||||||
intrastat_country = fields.Boolean(
|
intrastat_country = fields.Boolean(
|
||||||
compute='_compute_intrastat_country',
|
compute='_compute_intrastat_country',
|
||||||
store=True, string='Intrastat Country', readonly=True)
|
store=True, string='Intrastat Country', readonly=True)
|
||||||
|
src_dest_region_id = fields.Many2one(
|
||||||
|
'intrastat.region', string='Origin/Destination Region',
|
||||||
|
default=lambda self: self._default_src_dest_region_id(),
|
||||||
|
help="Origin region for dispatches, destination region for "
|
||||||
|
"arrivals. This field is used for the Intrastat Declaration.",
|
||||||
|
ondelete='restrict')
|
||||||
intrastat = fields.Char(
|
intrastat = fields.Char(
|
||||||
string='Intrastat Declaration',
|
string='Intrastat Declaration',
|
||||||
related='company_id.intrastat', readonly=True)
|
related='company_id.intrastat', readonly=True)
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
@api.depends('src_dest_country_id', 'partner_id.country_id')
|
@api.depends('partner_shipping_id.country_id', 'partner_id.country_id')
|
||||||
def _compute_intrastat_country(self):
|
def _compute_intrastat_country(self):
|
||||||
for inv in self:
|
for inv in self:
|
||||||
country = inv.src_dest_country_id \
|
country = inv.partner_shipping_id.country_id\
|
||||||
or inv.partner_id.country_id
|
or inv.partner_id.country_id
|
||||||
|
if not country:
|
||||||
|
country = inv.company_id.country_id
|
||||||
|
inv.src_dest_country_id = country.id
|
||||||
inv.intrastat_country = country.intrastat
|
inv.intrastat_country = country.intrastat
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def _default_intrastat_transaction_id(self):
|
def _default_intrastat_transaction_id(self):
|
||||||
company = self.env['res.company']
|
rco = self.env['res.company']
|
||||||
company_id = company._company_default_get('account.invoice')
|
company = rco._company_default_get('account.invoice')
|
||||||
company = company.browse(company_id)
|
|
||||||
inv_type = self._context.get('type')
|
inv_type = self._context.get('type')
|
||||||
if inv_type == 'out_invoice':
|
if inv_type == 'out_invoice':
|
||||||
return company.intrastat_transaction_out_invoice
|
return company.intrastat_transaction_out_invoice
|
||||||
@@ -83,24 +68,10 @@ class AccountInvoice(models.Model):
|
|||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def _default_src_dest_region_id(self):
|
def _default_src_dest_region_id(self):
|
||||||
company = self.env['res.company']
|
rco = self.env['res.company']
|
||||||
company_id = company._company_default_get('account.invoice')
|
company = rco._company_default_get('account.invoice')
|
||||||
company = company.browse(company_id)
|
|
||||||
return company.intrastat_region_id
|
return company.intrastat_region_id
|
||||||
|
|
||||||
@api.multi
|
|
||||||
def onchange_partner_id(
|
|
||||||
self, type, partner_id, date_invoice=False,
|
|
||||||
payment_term=False, partner_bank_id=False, company_id=False):
|
|
||||||
res = super(AccountInvoice, self).onchange_partner_id(
|
|
||||||
type, partner_id, date_invoice=date_invoice,
|
|
||||||
payment_term=payment_term, partner_bank_id=partner_bank_id,
|
|
||||||
company_id=company_id)
|
|
||||||
if partner_id:
|
|
||||||
partner = self.env['res.partner'].browse(partner_id)
|
|
||||||
res['value']['src_dest_country_id'] = partner.country_id.id
|
|
||||||
return res
|
|
||||||
|
|
||||||
|
|
||||||
class AccountInvoiceLine(models.Model):
|
class AccountInvoiceLine(models.Model):
|
||||||
_inherit = 'account.invoice.line'
|
_inherit = 'account.invoice.line'
|
||||||
@@ -108,22 +79,8 @@ class AccountInvoiceLine(models.Model):
|
|||||||
hs_code_id = fields.Many2one(
|
hs_code_id = fields.Many2one(
|
||||||
'hs.code', string='Intrastat Code', ondelete='restrict')
|
'hs.code', string='Intrastat Code', ondelete='restrict')
|
||||||
|
|
||||||
@api.multi
|
@api.onchange('product_id')
|
||||||
def product_id_change(
|
def intrastat_product_id_change(self):
|
||||||
self, product, uom_id, qty=0, name='', type='out_invoice',
|
if self.product_id:
|
||||||
partner_id=False, fposition_id=False, price_unit=False,
|
hs_code = self.product_id.product_tmpl_id.get_hs_code_recursively()
|
||||||
currency_id=False, company_id=None):
|
self.hs_code_id = hs_code and hs_code.id or False
|
||||||
res = super(AccountInvoiceLine, self).product_id_change(
|
|
||||||
product, uom_id, qty=qty, name=name, type=type,
|
|
||||||
partner_id=partner_id, fposition_id=fposition_id,
|
|
||||||
price_unit=price_unit, currency_id=currency_id,
|
|
||||||
company_id=company_id)
|
|
||||||
|
|
||||||
if product:
|
|
||||||
product = self.env['product.product'].browse(product)
|
|
||||||
hs_code = product.product_tmpl_id.get_hs_code_recursively()
|
|
||||||
if hs_code:
|
|
||||||
res['value']['hs_code_id'] = hs_code.id
|
|
||||||
else:
|
|
||||||
res['value']['hs_code_id'] = False
|
|
||||||
return res
|
|
||||||
|
|||||||
@@ -1,29 +1,11 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
##############################################################################
|
# © 2011-2017 Akretion (http://www.akretion.com)
|
||||||
#
|
# © 2009-2017 Noviat (http://www.noviat.com)
|
||||||
# Intrastat Product module for Odoo
|
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
# Copyright (C) 2011-2015 Akretion (http://www.akretion.com)
|
# @author Luc de Meyer <info@noviat.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/>.
|
|
||||||
#
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
from openerp import models, fields, api, _
|
from odoo import models, fields, api, _
|
||||||
from openerp.exceptions import ValidationError
|
from odoo.exceptions import ValidationError
|
||||||
|
|
||||||
|
|
||||||
class HSCode(models.Model):
|
class HSCode(models.Model):
|
||||||
@@ -36,13 +18,13 @@ class HSCode(models.Model):
|
|||||||
def _hs_code(self):
|
def _hs_code(self):
|
||||||
if self.company_id.country_id.intrastat:
|
if self.company_id.country_id.intrastat:
|
||||||
if not self.local_code.isdigit():
|
if not self.local_code.isdigit():
|
||||||
raise ValidationError(
|
raise ValidationError(_(
|
||||||
_("Intrastat Codes should only contain digits. "
|
"Intrastat Codes should only contain digits. "
|
||||||
"This is not the case for code '%s'.")
|
"This is not the case for code '%s'.")
|
||||||
% self.local_code)
|
% self.local_code)
|
||||||
if len(self.local_code) != 8:
|
if len(self.local_code) != 8:
|
||||||
raise ValidationError(
|
raise ValidationError(_(
|
||||||
_("Intrastat Codes should "
|
"Intrastat Codes should "
|
||||||
"contain 8 digits. This is not the case for "
|
"contain 8 digits. This is not the case for "
|
||||||
"Intrastat Code '%s' which has %d digits.")
|
"Intrastat Code '%s' which has %d digits.")
|
||||||
% (self.local_code, len(self.local_code)))
|
% (self.local_code, len(self.local_code)))
|
||||||
|
|||||||
@@ -1,31 +1,12 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
##############################################################################
|
# © 2011-2017 Akretion (http://www.akretion.com)
|
||||||
#
|
# © 2009-2017 Noviat (http://www.noviat.com)
|
||||||
# Intrastat Product module for Odoo
|
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
# Copyright (C) 2011-2015 Akretion (http://www.akretion.com)
|
# @author Luc de Meyer <info@noviat.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/>.
|
|
||||||
#
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
from openerp import models, fields, api, _
|
from odoo import models, fields, api, _
|
||||||
from openerp.exceptions import RedirectWarning, ValidationError
|
from odoo.exceptions import RedirectWarning, ValidationError, UserError
|
||||||
from openerp.exceptions import Warning as UserError
|
import odoo.addons.decimal_precision as dp
|
||||||
import openerp.addons.decimal_precision as dp
|
|
||||||
from datetime import datetime, date
|
from datetime import datetime, date
|
||||||
from dateutil.relativedelta import relativedelta
|
from dateutil.relativedelta import relativedelta
|
||||||
import logging
|
import logging
|
||||||
@@ -38,12 +19,6 @@ class IntrastatProductDeclaration(models.Model):
|
|||||||
_rec_name = 'year_month'
|
_rec_name = 'year_month'
|
||||||
_inherit = ['mail.thread', 'intrastat.common']
|
_inherit = ['mail.thread', 'intrastat.common']
|
||||||
_order = 'year_month desc, type, revision'
|
_order = 'year_month desc, type, revision'
|
||||||
_track = {
|
|
||||||
'state': {
|
|
||||||
'intrastat_product.declaration_done':
|
|
||||||
lambda self, cr, uid, obj, ctx=None: obj['state'] == 'done',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def _get_type(self):
|
def _get_type(self):
|
||||||
@@ -262,7 +237,7 @@ class IntrastatProductDeclaration(models.Model):
|
|||||||
product = inv_line.product_id
|
product = inv_line.product_id
|
||||||
invoice = inv_line.invoice_id
|
invoice = inv_line.invoice_id
|
||||||
intrastat_unit_id = hs_code.intrastat_unit_id
|
intrastat_unit_id = hs_code.intrastat_unit_id
|
||||||
source_uom = inv_line.uos_id
|
source_uom = inv_line.uom_id
|
||||||
weight_uom_categ = self._get_uom_refs('weight_uom_categ')
|
weight_uom_categ = self._get_uom_refs('weight_uom_categ')
|
||||||
kg_uom = self._get_uom_refs('kg_uom')
|
kg_uom = self._get_uom_refs('kg_uom')
|
||||||
pce_uom_categ = self._get_uom_refs('pce_uom_categ')
|
pce_uom_categ = self._get_uom_refs('pce_uom_categ')
|
||||||
@@ -294,8 +269,8 @@ class IntrastatProductDeclaration(models.Model):
|
|||||||
self._note += note
|
self._note += note
|
||||||
return weight, suppl_unit_qty
|
return weight, suppl_unit_qty
|
||||||
if target_uom.category_id == source_uom.category_id:
|
if target_uom.category_id == source_uom.category_id:
|
||||||
suppl_unit_qty = self.env['product.uom']._compute_qty_obj(
|
suppl_unit_qty = source_uom._compute_quantity(
|
||||||
source_uom, line_qty, target_uom)
|
line_qty, target_uom)
|
||||||
else:
|
else:
|
||||||
note = "\n" + _(
|
note = "\n" + _(
|
||||||
"Conversion from unit of measure '%s' to '%s' "
|
"Conversion from unit of measure '%s' to '%s' "
|
||||||
@@ -311,10 +286,9 @@ class IntrastatProductDeclaration(models.Model):
|
|||||||
if source_uom == kg_uom:
|
if source_uom == kg_uom:
|
||||||
weight = line_qty
|
weight = line_qty
|
||||||
elif source_uom.category_id == weight_uom_categ:
|
elif source_uom.category_id == weight_uom_categ:
|
||||||
weight = self.env['product.uom']._compute_qty_obj(
|
weight = source_uom._compute_quantity(line_qty, kg_uom)
|
||||||
source_uom, line_qty, kg_uom)
|
|
||||||
elif source_uom.category_id == pce_uom_categ:
|
elif source_uom.category_id == pce_uom_categ:
|
||||||
if not product.weight_net:
|
if not product.weight: # re-create weight_net ?
|
||||||
note = "\n" + _(
|
note = "\n" + _(
|
||||||
"Missing net weight on product %s."
|
"Missing net weight on product %s."
|
||||||
) % product.name_get()[0][1]
|
) % product.name_get()[0][1]
|
||||||
@@ -324,13 +298,13 @@ class IntrastatProductDeclaration(models.Model):
|
|||||||
self._note += note
|
self._note += note
|
||||||
return weight, suppl_unit_qty
|
return weight, suppl_unit_qty
|
||||||
if source_uom == pce_uom:
|
if source_uom == pce_uom:
|
||||||
weight = product.weight_net * line_qty
|
weight = product.weight * line_qty # product.weight_net
|
||||||
else:
|
else:
|
||||||
# Here, I suppose that, on the product, the
|
# Here, I suppose that, on the product, the
|
||||||
# weight is per PCE and not per uom_id
|
# weight is per PCE and not per uom_id
|
||||||
weight = product.weight_net * \
|
# product.weight_net
|
||||||
self.env['product.uom']._compute_qty_obj(
|
weight = product.weight * \
|
||||||
source_uom, line_qty, pce_uom)
|
source_uom._compute_quantity(line_qty, pce_uom)
|
||||||
else:
|
else:
|
||||||
note = "\n" + _(
|
note = "\n" + _(
|
||||||
"Conversion from unit of measure '%s' to 'Kg' "
|
"Conversion from unit of measure '%s' to 'Kg' "
|
||||||
@@ -374,24 +348,18 @@ class IntrastatProductDeclaration(models.Model):
|
|||||||
"""
|
"""
|
||||||
region = False
|
region = False
|
||||||
inv_type = inv_line.invoice_id.type
|
inv_type = inv_line.invoice_id.type
|
||||||
if inv_line.move_line_ids:
|
if inv_type in ('in_invoice', 'in_refund'):
|
||||||
if inv_type in ('in_invoice', 'out_refund'):
|
|
||||||
region = inv_line.move_line_ids[0].location_id.\
|
|
||||||
get_intrastat_region()
|
|
||||||
else:
|
|
||||||
region = inv_line.move_line_ids[0].location_dest_id.\
|
|
||||||
get_intrastat_region()
|
|
||||||
elif inv_type in ('in_invoice', 'in_refund'):
|
|
||||||
po_lines = self.env['purchase.order.line'].search(
|
po_lines = self.env['purchase.order.line'].search(
|
||||||
[('invoice_lines', 'in', inv_line.id)])
|
[('invoice_lines', 'in', inv_line.id)])
|
||||||
if po_lines:
|
if po_lines:
|
||||||
po = po_lines.order_id
|
if po_lines[0].move_ids:
|
||||||
region = po.location_id.get_intrastat_region()
|
region = po_lines[0].move_ids[0].location_id\
|
||||||
elif inv_line.invoice_id.type in ('out_invoice', 'out_refund'):
|
.get_intrastat_region()
|
||||||
|
elif inv_type in ('out_invoice', 'out_refund'):
|
||||||
so_lines = self.env['sale.order.line'].search(
|
so_lines = self.env['sale.order.line'].search(
|
||||||
[('invoice_lines', 'in', inv_line.id)])
|
[('invoice_lines', 'in', inv_line.id)])
|
||||||
if so_lines:
|
if so_lines:
|
||||||
so = so_lines.order_id
|
so = so_lines[0].order_id
|
||||||
region = so.warehouse_id.region_id
|
region = so.warehouse_id.region_id
|
||||||
if not region:
|
if not region:
|
||||||
if self.company_id.intrastat_region_id:
|
if self.company_id.intrastat_region_id:
|
||||||
@@ -410,7 +378,7 @@ class IntrastatProductDeclaration(models.Model):
|
|||||||
return transport
|
return transport
|
||||||
|
|
||||||
def _get_incoterm(self, inv_line):
|
def _get_incoterm(self, inv_line):
|
||||||
incoterm = inv_line.invoice_id.incoterm_id \
|
incoterm = inv_line.invoice_id.incoterms_id \
|
||||||
or self.company_id.intrastat_incoterm_id
|
or self.company_id.intrastat_incoterm_id
|
||||||
if not incoterm:
|
if not incoterm:
|
||||||
msg = _(
|
msg = _(
|
||||||
@@ -499,7 +467,7 @@ class IntrastatProductDeclaration(models.Model):
|
|||||||
total_inv_accessory_costs_cc = 0.0 # in company currency
|
total_inv_accessory_costs_cc = 0.0 # in company currency
|
||||||
total_inv_product_cc = 0.0 # in company currency
|
total_inv_product_cc = 0.0 # in company currency
|
||||||
total_inv_weight = 0.0
|
total_inv_weight = 0.0
|
||||||
for inv_line in invoice.invoice_line:
|
for inv_line in invoice.invoice_line_ids:
|
||||||
|
|
||||||
if (
|
if (
|
||||||
accessory_costs and
|
accessory_costs and
|
||||||
@@ -530,7 +498,7 @@ class IntrastatProductDeclaration(models.Model):
|
|||||||
|
|
||||||
if any([
|
if any([
|
||||||
tax.exclude_from_intrastat_if_present
|
tax.exclude_from_intrastat_if_present
|
||||||
for tax in inv_line.invoice_line_tax_id]):
|
for tax in inv_line.invoice_line_tax_ids]):
|
||||||
_logger.info(
|
_logger.info(
|
||||||
'Skipping invoice line %s '
|
'Skipping invoice line %s '
|
||||||
'qty %s of invoice %s. Reason: '
|
'qty %s of invoice %s. Reason: '
|
||||||
|
|||||||
@@ -1,26 +1,8 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
##############################################################################
|
# © 2009-2017 Noviat nv/sa (www.noviat.com).
|
||||||
#
|
# @author Luc de Meyer <info@noviat.com>
|
||||||
# Odoo, Open Source Management Solution
|
|
||||||
#
|
|
||||||
# Copyright (c) 2009-2015 Noviat nv/sa (www.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/>.
|
|
||||||
#
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
from openerp import models, fields
|
from odoo import models, fields
|
||||||
|
|
||||||
|
|
||||||
class IntrastatRegion(models.Model):
|
class IntrastatRegion(models.Model):
|
||||||
@@ -39,5 +21,5 @@ class IntrastatRegion(models.Model):
|
|||||||
|
|
||||||
_sql_constraints = [
|
_sql_constraints = [
|
||||||
('intrastat_region_code_unique',
|
('intrastat_region_code_unique',
|
||||||
'UNIQUE(code, country_id)',
|
'UNIQUE(code, country_id)', # TODO add company_id ?
|
||||||
'Code must be unique.')]
|
'Code must be unique.')]
|
||||||
|
|||||||
@@ -1,28 +1,10 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
##############################################################################
|
# © 2011-2017 Akretion (http://www.akretion.com)
|
||||||
#
|
# © 2009-2017 Noviat (http://www.noviat.com)
|
||||||
# Intrastat Product module for Odoo
|
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
# Copyright (C) 2011-2015 Akretion (http://www.akretion.com)
|
# @author Luc de Meyer <info@noviat.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/>.
|
|
||||||
#
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
from openerp import models, fields, api
|
from odoo import models, fields, api
|
||||||
|
|
||||||
|
|
||||||
class IntrastatTransaction(models.Model):
|
class IntrastatTransaction(models.Model):
|
||||||
@@ -34,8 +16,8 @@ class IntrastatTransaction(models.Model):
|
|||||||
code = fields.Char(string='Code', required=True)
|
code = fields.Char(string='Code', required=True)
|
||||||
description = fields.Text(string='Description')
|
description = fields.Text(string='Description')
|
||||||
display_name = fields.Char(
|
display_name = fields.Char(
|
||||||
compute='_compute_display_name', string="Display Name", readonly=True,
|
compute='_compute_display_name_field', string="Display Name",
|
||||||
store=True)
|
readonly=True, store=True)
|
||||||
company_id = fields.Many2one(
|
company_id = fields.Many2one(
|
||||||
'res.company', string='Company',
|
'res.company', string='Company',
|
||||||
default=lambda self: self.env['res.company']._company_default_get(
|
default=lambda self: self.env['res.company']._company_default_get(
|
||||||
@@ -43,7 +25,7 @@ class IntrastatTransaction(models.Model):
|
|||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
@api.depends('code', 'description')
|
@api.depends('code', 'description')
|
||||||
def _compute_display_name(self):
|
def _compute_display_name_field(self):
|
||||||
for this in self:
|
for this in self:
|
||||||
display_name = this.code
|
display_name = this.code
|
||||||
if this.description:
|
if this.description:
|
||||||
|
|||||||
@@ -1,28 +1,10 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
##############################################################################
|
# © 2011-2017 Akretion (http://www.akretion.com)
|
||||||
#
|
# © 2009-2017 Noviat (http://www.noviat.com)
|
||||||
# Intrastat Product module for Odoo
|
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
# Copyright (C) 2011-2015 Akretion (http://www.akretion.com)
|
# @author Luc de Meyer <info@noviat.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/>.
|
|
||||||
#
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
from openerp import models, fields, api
|
from odoo import models, fields, api
|
||||||
|
|
||||||
|
|
||||||
class IntrastatTransportMode(models.Model):
|
class IntrastatTransportMode(models.Model):
|
||||||
|
|||||||
@@ -1,41 +1,20 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
##############################################################################
|
# © 2011-2017 Akretion (http://www.akretion.com)
|
||||||
#
|
# © 2009-2017 Noviat (http://www.noviat.com)
|
||||||
# Intrastat Product module for Odoo
|
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
# Copyright (C) 2011-2015 Akretion (http://www.akretion.com)
|
# @author Luc de Meyer <info@noviat.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/>.
|
|
||||||
#
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
from openerp import models, fields
|
from odoo import models, fields
|
||||||
|
|
||||||
|
|
||||||
class IntrastatUnit(models.Model):
|
class IntrastatUnit(models.Model):
|
||||||
_name = 'intrastat.unit'
|
_name = 'intrastat.unit'
|
||||||
_description = 'Intrastat Supplementary Units'
|
_description = 'Intrastat Supplementary Units'
|
||||||
|
|
||||||
name = fields.Char(
|
name = fields.Char(string='Name', required=True)
|
||||||
string='Name', required=True)
|
description = fields.Char(string='Description', required=True)
|
||||||
description = fields.Char(
|
|
||||||
string='Description', required=True)
|
|
||||||
uom_id = fields.Many2one(
|
uom_id = fields.Many2one(
|
||||||
'product.uom', string='Regular UoM',
|
'product.uom', string='Regular UoM',
|
||||||
help="Select the regular Unit of Measure of Odoo that corresponds "
|
help="Select the regular Unit of Measure of Odoo that corresponds "
|
||||||
"to this Intrastat Supplementary Unit.")
|
"to this Intrastat Supplementary Unit.")
|
||||||
active = fields.Boolean(
|
active = fields.Boolean(string='Active', default=True)
|
||||||
string='Active', default=True)
|
|
||||||
|
|||||||
@@ -1,28 +1,10 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
##############################################################################
|
# © 2011-2017 Akretion (http://www.akretion.com)
|
||||||
#
|
# © 2009-2017 Noviat (http://www.noviat.com)
|
||||||
# Intrastat Product module for Odoo
|
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
# Copyright (C) 2011-2015 Akretion (http://www.akretion.com)
|
# @author Luc de Meyer <info@noviat.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/>.
|
|
||||||
#
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
from openerp import models, fields, api
|
from odoo import models, fields, api
|
||||||
|
|
||||||
|
|
||||||
class ResCompany(models.Model):
|
class ResCompany(models.Model):
|
||||||
|
|||||||
@@ -1,37 +1,26 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
##############################################################################
|
# © 2010-2017 Akretion (http://www.akretion.com)
|
||||||
#
|
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
# Intrastat Product module for Odoo
|
|
||||||
# Copyright (C) 2010-2015 Akretion (http://www.akretion.com)
|
|
||||||
# @author Alexis de Lattre <alexis.delattre@akretion.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/>.
|
|
||||||
#
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
from openerp import models, api
|
from odoo import models, fields, api
|
||||||
|
|
||||||
|
|
||||||
class SaleOrder(models.Model):
|
class SaleOrder(models.Model):
|
||||||
_inherit = "sale.order"
|
_inherit = "sale.order"
|
||||||
|
|
||||||
@api.model
|
intrastat_transport_id = fields.Many2one(
|
||||||
def _prepare_invoice(self, order, lines):
|
'intrastat.transport_mode', string='Transport Mode',
|
||||||
|
help="This information is used in Intrastat reports")
|
||||||
|
intrastat = fields.Selection(
|
||||||
|
string='Intrastat Declaration',
|
||||||
|
related='company_id.intrastat_dispatches', readonly=True)
|
||||||
|
|
||||||
|
@api.multi
|
||||||
|
def _prepare_invoice(self):
|
||||||
'''Copy destination country to invoice'''
|
'''Copy destination country to invoice'''
|
||||||
invoice_vals = super(SaleOrder, self)._prepare_invoice(
|
vals = super(SaleOrder, self)._prepare_invoice()
|
||||||
order, lines)
|
if self.intrastat_transport_id:
|
||||||
invoice_vals['src_dest_country_id'] = \
|
vals['intrastat_transport_id'] = self.intrastat_transport_id.id
|
||||||
order.partner_shipping_id.country_id.id or False
|
if self.warehouse_id.region_id:
|
||||||
invoice_vals['incoterm_id'] = order.incoterm.id or False
|
vals['src_dest_region_id'] = self.warehouse_id.region_id.id
|
||||||
return invoice_vals
|
return vals
|
||||||
|
|||||||
@@ -1,46 +0,0 @@
|
|||||||
# -*- 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/>.
|
|
||||||
#
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
from openerp import models, fields, api
|
|
||||||
|
|
||||||
|
|
||||||
class StockPicking(models.Model):
|
|
||||||
_inherit = "stock.picking"
|
|
||||||
|
|
||||||
intrastat_transport_id = fields.Many2one(
|
|
||||||
'intrastat.transport_mode', string='Transport Mode',
|
|
||||||
help="This information is used in Intrastat reports")
|
|
||||||
intrastat = fields.Char(related='company_id.intrastat')
|
|
||||||
|
|
||||||
@api.model
|
|
||||||
def _create_invoice_from_picking(self, picking, vals):
|
|
||||||
""" Copy data from picking to invoice. """
|
|
||||||
vals['intrastat_transport_id'] = picking.intrastat_transport_id.id
|
|
||||||
if picking.partner_id and picking.partner_id.country_id:
|
|
||||||
vals['src_dest_country_id'] = picking.partner_id.country_id.id
|
|
||||||
region = picking.location_id.get_intrastat_region()
|
|
||||||
if region:
|
|
||||||
vals['src_dest_region_id'] = region.id
|
|
||||||
return super(StockPicking, self)._create_invoice_from_picking(
|
|
||||||
picking, vals)
|
|
||||||
@@ -1,34 +1,15 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
##############################################################################
|
# © 2009-2017 Noviat nv/sa (www.noviat.com).
|
||||||
#
|
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
# Odoo, Open Source Management Solution
|
# @author Luc de Meyer <info@noviat.com>
|
||||||
#
|
|
||||||
# Copyright (c) 2009-2015 Noviat nv/sa (www.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/>.
|
|
||||||
#
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
from openerp import models, fields, api
|
from odoo import models, fields, api
|
||||||
|
|
||||||
|
|
||||||
class StockWarehouse(models.Model):
|
class StockWarehouse(models.Model):
|
||||||
_inherit = 'stock.warehouse'
|
_inherit = 'stock.warehouse'
|
||||||
|
|
||||||
region_id = fields.Many2one(
|
region_id = fields.Many2one('intrastat.region', string='Intrastat Region')
|
||||||
'intrastat.region',
|
|
||||||
string='Intrastat region')
|
|
||||||
|
|
||||||
|
|
||||||
class StockLocation(models.Model):
|
class StockLocation(models.Model):
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<openerp>
|
<odoo noupdate="1">
|
||||||
<data noupdate="1">
|
|
||||||
|
|
||||||
<record id="intrastat_transaction_company_rule" model="ir.rule">
|
<record id="intrastat_transaction_company_rule" model="ir.rule">
|
||||||
<field name="name">Intrastat Transaction Company rule</field>
|
<field name="name">Intrastat Transaction Company rule</field>
|
||||||
@@ -14,5 +13,10 @@
|
|||||||
<field name="domain_force">['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])]</field>
|
<field name="domain_force">['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])]</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
</data>
|
<record id="intrastat_product_declaration_company_rule" model="ir.rule">
|
||||||
</openerp>
|
<field name="name">Intrastat Product Declaration Company rule</field>
|
||||||
|
<field name="model_id" ref="model_intrastat_product_declaration"/>
|
||||||
|
<field name="domain_force">['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])]</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
</odoo>
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<openerp>
|
<odoo>
|
||||||
<data>
|
|
||||||
|
|
||||||
<record id="view_company_form" model="ir.ui.view">
|
<record id="view_account_config_settings" model="ir.ui.view">
|
||||||
<field name="name">intrastat.company.form</field>
|
<field name="name">intrastat.account.config.settings.form</field>
|
||||||
<field name="model">res.company</field>
|
<field name="model">account.config.settings</field>
|
||||||
<field name="inherit_id" ref="intrastat_base.view_company_form"/>
|
<field name="inherit_id" ref="intrastat_base.view_account_config_settings"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<group name="intrastat-common" position="inside">
|
<group name="intrastat" position="inside">
|
||||||
<field name="intrastat" invisible="1"/>
|
<field name="intrastat" invisible="1"/>
|
||||||
<field name="intrastat_arrivals"/>
|
<field name="intrastat_arrivals"/>
|
||||||
<field name="intrastat_dispatches"/>
|
<field name="intrastat_dispatches"/>
|
||||||
@@ -24,5 +23,4 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
</data>
|
</odoo>
|
||||||
</openerp>
|
|
||||||
@@ -1,17 +1,12 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<openerp>
|
<odoo>
|
||||||
<data>
|
|
||||||
|
|
||||||
<record id="invoice_form" model="ir.ui.view">
|
<record id="invoice_form" model="ir.ui.view">
|
||||||
<field name="name">intrastat.invoice.form</field>
|
<field name="name">intrastat.invoice.form</field>
|
||||||
<field name="model">account.invoice</field>
|
<field name="model">account.invoice</field>
|
||||||
<field name="inherit_id" ref="account.invoice_form"/>
|
<field name="inherit_id" ref="account.invoice_form"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//field[@name='date_due']" position="after">
|
<xpath expr="//page[@name='other_info']//field[@name='name']" position="after">
|
||||||
<field name="incoterm_id"
|
|
||||||
attrs="{'invisible': [('intrastat', '!=', 'extended')]}"/>
|
|
||||||
</xpath>
|
|
||||||
<xpath expr="//field[@name='move_id']" position="after">
|
|
||||||
<field name="intrastat_transaction_id"/>
|
<field name="intrastat_transaction_id"/>
|
||||||
<field name="intrastat" invisible="1"/>
|
<field name="intrastat" invisible="1"/>
|
||||||
<field name="intrastat_transport_id"
|
<field name="intrastat_transport_id"
|
||||||
@@ -20,8 +15,8 @@
|
|||||||
<field name="src_dest_country_id" string="Destination Country"/>
|
<field name="src_dest_country_id" string="Destination Country"/>
|
||||||
<field name="src_dest_region_id" string="Origin Region" invisible="1"/>
|
<field name="src_dest_region_id" string="Origin Region" invisible="1"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//field[@name='invoice_line']//field[@name='account_id']" position="after">
|
<xpath expr="//field[@name='invoice_line_ids']//field[@name='account_id']" position="after">
|
||||||
<field name="hs_code_id"/>
|
<field name="hs_code_id" invisible="1"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
@@ -31,24 +26,23 @@
|
|||||||
<field name="model">account.invoice</field>
|
<field name="model">account.invoice</field>
|
||||||
<field name="inherit_id" ref="account.invoice_supplier_form"/>
|
<field name="inherit_id" ref="account.invoice_supplier_form"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//field[@name='payment_term']" position="after">
|
<xpath expr="//field[@name='payment_term_id']" position="after">
|
||||||
<field name="incoterm_id"
|
<field name="incoterms_id"
|
||||||
attrs="{'invisible': [('intrastat', '!=', 'extended')]}"/>
|
attrs="{'invisible': [('intrastat', '!=', 'extended')]}"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//field[@name='period_id']" position="after">
|
<xpath expr="//page/group/group/field[@name='company_id']" position="after">
|
||||||
<field name="intrastat_transaction_id"/>
|
<field name="intrastat_transaction_id"/>
|
||||||
<field name="intrastat" invisible="1"/>
|
<field name="intrastat" invisible="1"/>
|
||||||
<field name="intrastat_transport_id"
|
<field name="intrastat_transport_id"
|
||||||
attrs="{'invisible': [('intrastat', '!=', 'extended')]}"
|
attrs="{'invisible': [('intrastat', '!=', 'extended')]}"
|
||||||
widget="selection"/>
|
widget="selection"/>
|
||||||
<field name="src_dest_country_id" string="Origin/Destination Country"/>
|
<field name="src_dest_country_id" string="Origin Country"/>
|
||||||
<field name="src_dest_region_id" string="Origin/Destination Region" invisible="1"/>
|
<field name="src_dest_region_id" string="Destination Region" invisible="1"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//field[@name='invoice_line']//field[@name='account_id']" position="after">
|
<xpath expr="//field[@name='invoice_line_ids']//field[@name='account_id']" position="after">
|
||||||
<field name="hs_code_id"/>
|
<field name="hs_code_id" invisible="1"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
</data>
|
</odoo>
|
||||||
</openerp>
|
|
||||||
|
|||||||
@@ -1,15 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Copyright (C) 2010-2015 Akretion (http://www.akretion.com/)
|
© 2010-2017 Akretion (http://www.akretion.com/)
|
||||||
Copyright (C) 2015 Noviat (http://www.noviat.com/)
|
© 2015-2017 Noviat (http://www.noviat.com/)
|
||||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
@author Luc De Meyer <luc.demeyer@noviat.com>
|
@author Luc De Meyer <luc.demeyer@noviat.com>
|
||||||
The licence is in the file __openerp__.py
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<openerp>
|
<odoo>
|
||||||
<data>
|
|
||||||
|
|
||||||
<!-- Add the H.S. code menu under the Intrastat Config menu -->
|
<!-- Add the H.S. code menu under the Intrastat Config menu -->
|
||||||
<menuitem id="intrastat_code_menu"
|
<menuitem id="intrastat_code_menu"
|
||||||
@@ -41,5 +39,4 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
</data>
|
</odoo>
|
||||||
</openerp>
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<openerp>
|
<odoo>
|
||||||
<data>
|
|
||||||
|
|
||||||
<record id="intrastat_product_declaration_view_form" model="ir.ui.view">
|
<record id="intrastat_product_declaration_view_form" model="ir.ui.view">
|
||||||
<field name="name">intrastat.product.declaration.form</field>
|
<field name="name">intrastat.product.declaration.form</field>
|
||||||
@@ -75,14 +74,6 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<!-- Notification in the chatter -->
|
|
||||||
<record id="intrastat_product_declaration_done" model="mail.message.subtype">
|
|
||||||
<field name="name">Intrastat Product Declaration Validated</field>
|
|
||||||
<field name="res_model">intrastat.product.declaration</field>
|
|
||||||
<field name="default" eval="False"/>
|
|
||||||
<field name="description">Intrastat Product Declaration Validated</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<record id="intrastat_product_declaration_view_tree" model="ir.ui.view">
|
<record id="intrastat_product_declaration_view_tree" model="ir.ui.view">
|
||||||
<field name="name">intrastat.product.declaration.tree</field>
|
<field name="name">intrastat.product.declaration.tree</field>
|
||||||
<field name="model">intrastat.product.declaration</field>
|
<field name="model">intrastat.product.declaration</field>
|
||||||
@@ -259,5 +250,4 @@
|
|||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|
||||||
</data>
|
</odoo>
|
||||||
</openerp>
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<openerp>
|
<odoo>
|
||||||
<data>
|
|
||||||
|
|
||||||
<record id="intrastat_region_view_form" model="ir.ui.view">
|
<record id="intrastat_region_view_form" model="ir.ui.view">
|
||||||
<field name="name">intrastat.region.form</field>
|
<field name="name">intrastat.region.form</field>
|
||||||
@@ -42,5 +41,4 @@
|
|||||||
action="intrastat_region_action"
|
action="intrastat_region_action"
|
||||||
parent="intrastat_base.menu_intrastat_config_root"/>
|
parent="intrastat_base.menu_intrastat_config_root"/>
|
||||||
|
|
||||||
</data>
|
</odoo>
|
||||||
</openerp>
|
|
||||||
|
|||||||
@@ -1,15 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Copyright (C) 2010-2015 Akretion (http://www.akretion.com/)
|
© 2010-2017 Akretion (http://www.akretion.com/)
|
||||||
Copyright (C) 2015 Noviat (http://www.noviat.com/)
|
© 2015-2017 Noviat (http://www.noviat.com/)
|
||||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
@author Luc De Meyer <luc.demeyer@noviat.com>
|
@author Luc De Meyer <luc.demeyer@noviat.com>
|
||||||
The licence is in the file __openerp__.py
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<openerp>
|
<odoo>
|
||||||
<data>
|
|
||||||
|
|
||||||
<!-- Intrastat Transaction Type -->
|
<!-- Intrastat Transaction Type -->
|
||||||
<record id="intrastat_transaction_form" model="ir.ui.view">
|
<record id="intrastat_transaction_form" model="ir.ui.view">
|
||||||
@@ -64,5 +62,4 @@
|
|||||||
parent="intrastat_base.menu_intrastat_config_root"
|
parent="intrastat_base.menu_intrastat_config_root"
|
||||||
sequence="20"/>
|
sequence="20"/>
|
||||||
|
|
||||||
</data>
|
</odoo>
|
||||||
</openerp>
|
|
||||||
|
|||||||
@@ -1,15 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Copyright (C) 2010-2015 Akretion (http://www.akretion.com/)
|
© 2010-2017 Akretion (http://www.akretion.com/)
|
||||||
Copyright (C) 2015 Noviat (http://www.noviat.com/)
|
© 2015-2017 Noviat (http://www.noviat.com/)
|
||||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
@author Luc De Meyer <luc.demeyer@noviat.com>
|
@author Luc De Meyer <luc.demeyer@noviat.com>
|
||||||
The licence is in the file __openerp__.py
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<openerp>
|
<odoo>
|
||||||
<data>
|
|
||||||
|
|
||||||
<!-- Intrastat Transport Mode -->
|
<!-- Intrastat Transport Mode -->
|
||||||
<record id="intrastat_transport_mode_form" model="ir.ui.view">
|
<record id="intrastat_transport_mode_form" model="ir.ui.view">
|
||||||
@@ -60,5 +58,4 @@
|
|||||||
parent="intrastat_base.menu_intrastat_config_root"
|
parent="intrastat_base.menu_intrastat_config_root"
|
||||||
sequence="30"/>
|
sequence="30"/>
|
||||||
|
|
||||||
</data>
|
</odoo>
|
||||||
</openerp>
|
|
||||||
|
|||||||
@@ -1,15 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Copyright (C) 2010-2015 Akretion (http://www.akretion.com/)
|
© 2010-2017 Akretion (http://www.akretion.com/)
|
||||||
Copyright (C) 2015 Noviat (http://www.noviat.com/)
|
© 2015-2017 Noviat (http://www.noviat.com/)
|
||||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
@author Luc De Meyer <luc.demeyer@noviat.com>
|
@author Luc De Meyer <luc.demeyer@noviat.com>
|
||||||
The licence is in the file __openerp__.py
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<openerp>
|
<odoo>
|
||||||
<data>
|
|
||||||
|
|
||||||
<!-- Intrastat Supplementary Unit -->
|
<!-- Intrastat Supplementary Unit -->
|
||||||
<record id="intrastat_unit_form" model="ir.ui.view">
|
<record id="intrastat_unit_form" model="ir.ui.view">
|
||||||
@@ -66,5 +64,4 @@
|
|||||||
parent="intrastat_base.menu_intrastat_config_root"
|
parent="intrastat_base.menu_intrastat_config_root"
|
||||||
sequence="40"/>
|
sequence="40"/>
|
||||||
|
|
||||||
</data>
|
</odoo>
|
||||||
</openerp>
|
|
||||||
|
|||||||
20
intrastat_product/views/sale_order.xml
Normal file
20
intrastat_product/views/sale_order.xml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<odoo>
|
||||||
|
|
||||||
|
|
||||||
|
<record id="sale_order_form" model="ir.ui.view">
|
||||||
|
<field name="name">intrastat.sale.order.form</field>
|
||||||
|
<field name="model">sale.order</field>
|
||||||
|
<field name="inherit_id" ref="sale_stock.view_order_form_inherit_sale_stock"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="incoterm" position="after">
|
||||||
|
<field name="intrastat_transport_id"
|
||||||
|
attrs="{'invisible': [('intrastat', '!=', 'extended')]}"
|
||||||
|
widget="selection"/>
|
||||||
|
<field name="intrastat" invisible="1"/>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
|
||||||
|
</odoo>
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Copyright (C) 2010-2015 Akretion (http://www.akretion.com/)
|
|
||||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
|
||||||
The licence is in the file __openerp__.py
|
|
||||||
-->
|
|
||||||
|
|
||||||
<openerp>
|
|
||||||
<data>
|
|
||||||
|
|
||||||
<!-- Add transport mode on picking form view -->
|
|
||||||
<record id="view_picking_form" model="ir.ui.view">
|
|
||||||
<field name="name">intrastat.product.picking.form</field>
|
|
||||||
<field name="model">stock.picking</field>
|
|
||||||
<field name="inherit_id" ref="stock.view_picking_form"/>
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<field name="backorder_id" position="after">
|
|
||||||
<field name="intrastat_transport_id"
|
|
||||||
attrs="{'invisible': [('intrastat', '!=', 'extended')]}"
|
|
||||||
widget="selection"/>
|
|
||||||
<field name="intrastat" invisible="1"/>
|
|
||||||
</field>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
</data>
|
|
||||||
</openerp>
|
|
||||||
@@ -1,17 +1,15 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<openerp>
|
<odoo>
|
||||||
<data>
|
|
||||||
|
|
||||||
<record id="view_warehouse" model="ir.ui.view">
|
<record id="view_warehouse" model="ir.ui.view">
|
||||||
<field name="name">intrastat.stock.warehouse.form</field>
|
<field name="name">intrastat.stock.warehouse.form</field>
|
||||||
<field name="model">stock.warehouse</field>
|
<field name="model">stock.warehouse</field>
|
||||||
<field name="inherit_id" ref="stock.view_warehouse"/>
|
<field name="inherit_id" ref="stock.view_warehouse"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//field[@name='partner_id']" position="after">
|
<field name="partner_id" position="after">
|
||||||
<field name="region_id"/>
|
<field name="region_id"/>
|
||||||
</xpath>
|
</field>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
</data>
|
</odoo>
|
||||||
</openerp>
|
|
||||||
|
|||||||
Reference in New Issue
Block a user