mirror of
https://github.com/OCA/intrastat-extrastat.git
synced 2025-02-16 17:13:41 +02:00
incoterms
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
# Copyright 2011-2017 Akretion France (http://www.akretion.com)
|
# Copyright 2011-2017 Akretion France (http://www.akretion.com)
|
||||||
# Copyright 2009-2018 Noviat (http://www.noviat.com)
|
# Copyright 2009-2020 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 <info@noviat.com>
|
# @author Luc de Meyer <info@noviat.com>
|
||||||
|
|
||||||
@@ -417,11 +417,8 @@ class IntrastatProductDeclaration(models.Model):
|
|||||||
return transport
|
return transport
|
||||||
|
|
||||||
def _get_incoterm(self, inv_line):
|
def _get_incoterm(self, inv_line):
|
||||||
# WARNING for v12: there are 2 incoterm fields on account.invoice
|
|
||||||
# cf https://github.com/odoo/odoo/issues/31641
|
|
||||||
# the field to use is 'incoterm_id' defined in the 'account' module
|
|
||||||
incoterm = (
|
incoterm = (
|
||||||
inv_line.invoice_id.incoterm_id or self.company_id.intrastat_incoterm_id
|
inv_line.invoice_id.invoice_incoterm_id or self.company_id.incoterm_id
|
||||||
)
|
)
|
||||||
if not incoterm:
|
if not incoterm:
|
||||||
msg = _(
|
msg = _(
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Copyright 2011-2017 Akretion (http://www.akretion.com)
|
# Copyright 2011-2017 Akretion (http://www.akretion.com)
|
||||||
# Copyright 2009-2018 Noviat (http://www.noviat.com)
|
# Copyright 2009-2020 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 <info@noviat.com>
|
# @author Luc de Meyer <info@noviat.com>
|
||||||
|
|
||||||
@@ -9,13 +9,6 @@ from odoo import api, fields, models
|
|||||||
class ResCompany(models.Model):
|
class ResCompany(models.Model):
|
||||||
_inherit = "res.company"
|
_inherit = "res.company"
|
||||||
|
|
||||||
intrastat_incoterm_id = fields.Many2one(
|
|
||||||
comodel_name="account.incoterms",
|
|
||||||
string="Default Incoterm for Intrastat",
|
|
||||||
help="International Commercial Terms are a series of "
|
|
||||||
"predefined commercial terms used in international "
|
|
||||||
"transactions.",
|
|
||||||
)
|
|
||||||
intrastat_arrivals = fields.Selection(
|
intrastat_arrivals = fields.Selection(
|
||||||
selection="_intrastat_arrivals",
|
selection="_intrastat_arrivals",
|
||||||
string="Arrivals",
|
string="Arrivals",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Copyright 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
# Copyright 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||||
# Copyright 2009-2018 Noviat (http://www.noviat.com)
|
# Copyright 2009-2020 Noviat (http://www.noviat.com)
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
|
|
||||||
from odoo import fields, models
|
from odoo import fields, models
|
||||||
@@ -8,9 +8,6 @@ from odoo import fields, models
|
|||||||
class ResConfigSettings(models.TransientModel):
|
class ResConfigSettings(models.TransientModel):
|
||||||
_inherit = "res.config.settings"
|
_inherit = "res.config.settings"
|
||||||
|
|
||||||
intrastat_incoterm_id = fields.Many2one(
|
|
||||||
related="company_id.intrastat_incoterm_id", readonly=False
|
|
||||||
)
|
|
||||||
intrastat_arrivals = fields.Selection(
|
intrastat_arrivals = fields.Selection(
|
||||||
related="company_id.intrastat_arrivals", readonly=False
|
related="company_id.intrastat_arrivals", readonly=False
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -21,30 +21,4 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<!--
|
|
||||||
<record id="invoice_supplier_form" model="ir.ui.view">
|
|
||||||
<field name="name">intrastat.invoice.supplier.form</field>
|
|
||||||
<field name="model">account.invoice</field>
|
|
||||||
<field name="inherit_id" ref="account.invoice_supplier_form"/>
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<xpath expr="//field[@name='payment_term_id']" position="after">
|
|
||||||
<field name="incoterms_id"
|
|
||||||
attrs="{'invisible': [('intrastat', '!=', 'extended')]}"/>
|
|
||||||
</xpath>
|
|
||||||
<xpath expr="//page/group/group/field[@name='company_id']" position="after">
|
|
||||||
<field name="intrastat_transaction_id"/>
|
|
||||||
<field name="intrastat" invisible="1"/>
|
|
||||||
<field name="intrastat_transport_id"
|
|
||||||
attrs="{'invisible': [('intrastat', '!=', 'extended')]}"
|
|
||||||
widget="selection"/>
|
|
||||||
<field name="src_dest_country_id" string="Origin Country"/>
|
|
||||||
<field name="src_dest_region_id" string="Destination Region" invisible="1"/>
|
|
||||||
</xpath>
|
|
||||||
<xpath expr="//field[@name='invoice_line_ids']//field[@name='account_id']" position="after">
|
|
||||||
<field name="hs_code_id" invisible="1"/>
|
|
||||||
</xpath>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
-->
|
|
||||||
|
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
@@ -34,10 +34,6 @@
|
|||||||
<label for="intrastat_transport_id" class="col-md-5 o_light_label"/>
|
<label for="intrastat_transport_id" class="col-md-5 o_light_label"/>
|
||||||
<field name="intrastat_transport_id"/>
|
<field name="intrastat_transport_id"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="row" attrs="{'invisible': [('country_code', 'in', ['FR'])]}">
|
|
||||||
<label for="intrastat_incoterm_id" class="col-md-5 o_light_label"/>
|
|
||||||
<field name="intrastat_incoterm_id"/>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<label for="intrastat_transaction_out_invoice" class="col-md-5 o_light_label"/>
|
<label for="intrastat_transaction_out_invoice" class="col-md-5 o_light_label"/>
|
||||||
<field name="intrastat_transaction_out_invoice"/>
|
<field name="intrastat_transaction_out_invoice"/>
|
||||||
|
|||||||
1
oca_dependencies.txt
Normal file
1
oca_dependencies.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
reporting-engine
|
||||||
Reference in New Issue
Block a user