mirror of
https://github.com/OCA/intrastat-extrastat.git
synced 2025-02-16 17:13:41 +02:00
[MIG] intrastat_product: Migration to 11.0
This commit is contained in:
committed by
João Marques
parent
2aed9bca6e
commit
f094100eae
@@ -1,16 +1,19 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2011-2017 Akretion (http://www.akretion.com)
|
||||
# © 2009-2017 Noviat (http://www.noviat.com)
|
||||
# © 2018 brain-tec AG (http://www.braintec-group.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# @author Luc de Meyer <info@noviat.com>
|
||||
# @author Kumar Aberer <kumar.aberer@braintec-group.com>
|
||||
|
||||
{
|
||||
'name': 'Intrastat Product',
|
||||
'version': '10.0.1.1.0',
|
||||
'version': '11.0.1.1.0',
|
||||
'category': 'Intrastat',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Base module for Intrastat Product',
|
||||
'author': 'Akretion, Noviat, Odoo Community Association (OCA)',
|
||||
'author': 'brain-tec AG, Akretion, Noviat, '
|
||||
'Odoo Community Association (OCA)',
|
||||
'depends': [
|
||||
'intrastat_base',
|
||||
'product_harmonized_system',
|
||||
@@ -25,7 +28,7 @@
|
||||
'views/intrastat_transaction.xml',
|
||||
'views/intrastat_transport_mode.xml',
|
||||
'views/intrastat_product_declaration.xml',
|
||||
'views/account_config_settings.xml',
|
||||
'views/res_config_settings.xml',
|
||||
'views/account_invoice.xml',
|
||||
'views/sale_order.xml',
|
||||
'views/stock_warehouse.xml',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from . import res_company
|
||||
from . import account_config_settings
|
||||
from . import res_config_settings
|
||||
from . import account_invoice
|
||||
from . import hs_code
|
||||
from . import intrastat_product_declaration
|
||||
|
||||
@@ -666,7 +666,7 @@ class IntrastatProductDeclaration(models.Model):
|
||||
|
||||
def group_line_hashcode(self, computation_line):
|
||||
hc_fields = self._group_line_hashcode_fields(computation_line)
|
||||
hashcode = '-'.join([unicode(f) for f in hc_fields.itervalues()])
|
||||
hashcode = '-'.join([str(f) for f in hc_fields.values()])
|
||||
return hashcode
|
||||
|
||||
@api.multi
|
||||
@@ -686,7 +686,7 @@ class IntrastatProductDeclaration(models.Model):
|
||||
else:
|
||||
dl_group[hashcode] = [cl]
|
||||
ipdl = self.declaration_line_ids
|
||||
for cl_lines in dl_group.values():
|
||||
for cl_lines in list(dl_group.values()):
|
||||
vals = ipdl._prepare_declaration_line(cl_lines)
|
||||
declaration_line = ipdl.create(vals)
|
||||
for cl in cl_lines:
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
from odoo import models, fields
|
||||
|
||||
|
||||
class AccountConfigSettings(models.TransientModel):
|
||||
_inherit = 'account.config.settings'
|
||||
class ResConfigSettings(models.TransientModel):
|
||||
_inherit = 'res.config.settings'
|
||||
|
||||
intrastat_incoterm_id = fields.Many2one(
|
||||
related='company_id.intrastat_incoterm_id')
|
||||
@@ -1,26 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<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="intrastat_base.view_account_config_settings"/>
|
||||
<field name="arch" type="xml">
|
||||
<group name="intrastat" position="inside">
|
||||
<field name="intrastat" invisible="1"/>
|
||||
<field name="intrastat_arrivals"/>
|
||||
<field name="intrastat_dispatches"/>
|
||||
<field name="intrastat_transaction_out_invoice"/>
|
||||
<field name="intrastat_transaction_out_refund"/>
|
||||
<field name="intrastat_transaction_in_invoice"/>
|
||||
<field name="intrastat_transaction_in_refund"/>
|
||||
<field name="intrastat_region_id" domain="[('country_id','=', country_id)]" invisible="1"/>
|
||||
<field name="intrastat_transport_id"
|
||||
attrs="{'required': [('intrastat', '=', 'extended')], 'invisible': [('intrastat', '!=', 'extended')]}"/>
|
||||
<field name="intrastat_incoterm_id" invisible="1"/>
|
||||
<field name="intrastat_accessory_costs" invisible="1"/>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
62
intrastat_product/views/res_config_settings.xml
Normal file
62
intrastat_product/views/res_config_settings.xml
Normal file
@@ -0,0 +1,62 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
© 2018 brain-tec AG (Kumar Aberer <kumar.aberer@braintec-group.com>)
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
<odoo>
|
||||
|
||||
<record id="view_res_config_settings" model="ir.ui.view">
|
||||
<field name="name">intrastat.account.config.settings.form</field>
|
||||
<field name="model">res.config.settings</field>
|
||||
<field name="inherit_id" ref="intrastat_base.view_intrastat_res_config_settings"/>
|
||||
<field name="arch" type="xml">
|
||||
|
||||
|
||||
<xpath expr="//div[@id='intrastat']" position="inside">
|
||||
<div class="col-xs-12 col-md-6 o_setting_box">
|
||||
<div class="o_setting_right_pane">
|
||||
<div class="content-group">
|
||||
<div class="row mt16">
|
||||
<label for="intrastat_arrivals" class="col-md-5 o_light_label"/>
|
||||
<field name="intrastat_arrivals"/>
|
||||
|
||||
<label for="intrastat_dispatches" class="col-md-5 o_light_label"/>
|
||||
<field name="intrastat_dispatches"/>
|
||||
|
||||
<label for="intrastat_transport_id" class="col-md-5 o_light_label"/>
|
||||
<field name="intrastat_transport_id"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</xpath>
|
||||
<xpath expr="//div[@id='intrastat']" position="after">
|
||||
<div class="row mt16 o_settings_container" id="intrastat_ext">
|
||||
<label for="intrastat_incoterm_id" class="col-md-5 o_light_label"/>
|
||||
<field name="intrastat_incoterm_id"/>
|
||||
|
||||
<label for="intrastat_transaction_out_invoice" class="col-md-5 o_light_label"/>
|
||||
<field name="intrastat_transaction_out_invoice"/>
|
||||
|
||||
<label for="intrastat_transaction_out_refund" class="col-md-5 o_light_label"/>
|
||||
<field name="intrastat_transaction_out_refund"/>
|
||||
|
||||
<label for="intrastat_transaction_in_invoice" class="col-md-5 o_light_label"/>
|
||||
<field name="intrastat_transaction_in_invoice"/>
|
||||
|
||||
<label for="intrastat_transaction_in_refund" class="col-md-5 o_light_label"/>
|
||||
<field name="intrastat_transaction_in_refund"/>
|
||||
|
||||
<label for="intrastat_accessory_costs" class="col-md-5 o_light_label"/>
|
||||
<field name="intrastat_accessory_costs"/>
|
||||
|
||||
<field name="intrastat_region_id" invisible="1"/>
|
||||
</div>
|
||||
</xpath>
|
||||
|
||||
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user