mirror of
https://github.com/OCA/intrastat-extrastat.git
synced 2025-02-16 17:13:41 +02:00
Add new module product_harmonized_system_delivery (hide native hs_code field)
Finalize port to v11
This commit is contained in:
committed by
Luc De Meyer
parent
4dd21d0f7c
commit
d720873be0
@@ -53,7 +53,7 @@ class AccountInvoice(models.Model):
|
||||
@api.model
|
||||
def _default_intrastat_transaction_id(self):
|
||||
rco = self.env['res.company']
|
||||
company = rco._company_default_get('account.invoice')
|
||||
company = rco._company_default_get()
|
||||
inv_type = self._context.get('type')
|
||||
if inv_type == 'out_invoice':
|
||||
return company.intrastat_transaction_out_invoice
|
||||
@@ -69,7 +69,7 @@ class AccountInvoice(models.Model):
|
||||
@api.model
|
||||
def _default_src_dest_region_id(self):
|
||||
rco = self.env['res.company']
|
||||
company = rco._company_default_get('account.invoice')
|
||||
company = rco._company_default_get()
|
||||
return company.intrastat_region_id
|
||||
|
||||
|
||||
|
||||
@@ -80,8 +80,7 @@ class IntrastatProductDeclaration(models.Model):
|
||||
|
||||
company_id = fields.Many2one(
|
||||
'res.company', string='Company', readonly=True,
|
||||
default=lambda self: self.env['res.company']._company_default_get(
|
||||
'intrastat.product.declaration'))
|
||||
default=lambda self: self.env['res.company']._company_default_get())
|
||||
company_country_code = fields.Char(
|
||||
compute='_compute_company_country_code',
|
||||
string='Company Country Code', readonly=True, store=True,
|
||||
@@ -924,29 +923,6 @@ class IntrastatProductDeclarationLine(models.Model):
|
||||
'res.country', string='Country of Origin of the Product',
|
||||
help="Country of origin of the product i.e. product 'made in ____'")
|
||||
|
||||
@api.model
|
||||
def _prepare_grouped_fields(self, computation_line, fields_to_sum):
|
||||
"""
|
||||
This method is DEPRECATED.
|
||||
You should use the _prepare_grouped_fields method on the
|
||||
IntrastatProductDeclaration class.
|
||||
"""
|
||||
vals = {
|
||||
'src_dest_country_id': computation_line.src_dest_country_id.id,
|
||||
'intrastat_unit_id': computation_line.intrastat_unit_id.id,
|
||||
'hs_code_id': computation_line.hs_code_id.id,
|
||||
'transaction_id': computation_line.transaction_id.id,
|
||||
'transport_id': computation_line.transport_id.id,
|
||||
'region_id': computation_line.region_id.id,
|
||||
'parent_id': computation_line.parent_id.id,
|
||||
'product_origin_country_id':
|
||||
computation_line.product_origin_country_id.id,
|
||||
'amount_company_currency': 0.0,
|
||||
}
|
||||
for field in fields_to_sum:
|
||||
vals[field] = 0.0
|
||||
return vals
|
||||
|
||||
def _fields_to_sum(self):
|
||||
"""
|
||||
This method is DEPRECATED.
|
||||
|
||||
@@ -16,8 +16,7 @@ class IntrastatRegion(models.Model):
|
||||
description = fields.Char(string='Description')
|
||||
company_id = fields.Many2one(
|
||||
'res.company', string='Company',
|
||||
default=lambda self: self.env['res.company']._company_default_get(
|
||||
'intrastat.region'))
|
||||
default=lambda self: self.env['res.company']._company_default_get())
|
||||
|
||||
_sql_constraints = [
|
||||
('intrastat_region_code_unique',
|
||||
|
||||
@@ -20,8 +20,7 @@ class IntrastatTransaction(models.Model):
|
||||
readonly=True, store=True)
|
||||
company_id = fields.Many2one(
|
||||
'res.company', string='Company',
|
||||
default=lambda self: self.env['res.company']._company_default_get(
|
||||
'intrastat.transaction'))
|
||||
default=lambda self: self.env['res.company']._company_default_get())
|
||||
|
||||
@api.multi
|
||||
@api.depends('code', 'description')
|
||||
|
||||
@@ -12,48 +12,48 @@
|
||||
<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 id="intrastat_content_grp" position="inside">
|
||||
<div class="row mt16">
|
||||
<label for="intrastat_arrivals" class="col-md-5 o_light_label"/>
|
||||
<field name="intrastat_arrivals"/>
|
||||
</div>
|
||||
|
||||
</xpath>
|
||||
<xpath expr="//div[@id='intrastat']" position="after">
|
||||
<div class="row mt16 o_settings_container" id="intrastat_ext">
|
||||
<div class="row mt16">
|
||||
<label for="intrastat_dispatches" class="col-md-5 o_light_label"/>
|
||||
<field name="intrastat_dispatches"/>
|
||||
</div>
|
||||
<div class="row mt16">
|
||||
<label for="intrastat_transport_id" class="col-md-5 o_light_label"/>
|
||||
<field name="intrastat_transport_id"/>
|
||||
</div>
|
||||
<div class="row mt16">
|
||||
<label for="intrastat_incoterm_id" class="col-md-5 o_light_label"/>
|
||||
<field name="intrastat_incoterm_id"/>
|
||||
|
||||
</div>
|
||||
<div class="row mt16">
|
||||
<label for="intrastat_transaction_out_invoice" class="col-md-5 o_light_label"/>
|
||||
<field name="intrastat_transaction_out_invoice"/>
|
||||
|
||||
</div>
|
||||
<div class="row mt16">
|
||||
<label for="intrastat_transaction_out_refund" class="col-md-5 o_light_label"/>
|
||||
<field name="intrastat_transaction_out_refund"/>
|
||||
|
||||
</div>
|
||||
<div class="row mt16">
|
||||
<label for="intrastat_transaction_in_invoice" class="col-md-5 o_light_label"/>
|
||||
<field name="intrastat_transaction_in_invoice"/>
|
||||
|
||||
</div>
|
||||
<div class="row mt16">
|
||||
<label for="intrastat_transaction_in_refund" class="col-md-5 o_light_label"/>
|
||||
<field name="intrastat_transaction_in_refund"/>
|
||||
|
||||
</div>
|
||||
<div id="intrastat_accessory_costs" class="row mt16" invisible="1">
|
||||
<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>
|
||||
<div class="row mt16" id="intrastat_region" invisible="1">
|
||||
<label for="intrastat_region_id" class="col-md-5 o_light_label"/>
|
||||
<field name="intrastat_region_id"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</field>
|
||||
|
||||
Reference in New Issue
Block a user