Skip to content

Commit

Permalink
[MIG] l10n_fr_intrastat_product to v17
Browse files Browse the repository at this point in the history
  • Loading branch information
alexis-via committed Sep 28, 2024
1 parent 1dd8b40 commit ef81938
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 68 deletions.
3 changes: 1 addition & 2 deletions l10n_fr_intrastat_product/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{
"name": "EMEBI",
"version": "16.0.1.3.0",
"version": "17.0.1.0.0",
"category": "Localisation/Report Intrastat",
"license": "AGPL-3",
"summary": "EMEBI (ex-DEB) for France",
Expand All @@ -18,7 +18,6 @@
],
"data": [
"security/ir.model.access.csv",
"data/account_fiscal_position_template.xml",
"data/intrastat_fr_regime.xml",
"views/intrastat_product_declaration.xml",
"views/intrastat_fr_regime.xml",
Expand Down

This file was deleted.

13 changes: 0 additions & 13 deletions l10n_fr_intrastat_product/migrations/14.0.1.0.0/pre-migration.py

This file was deleted.

7 changes: 2 additions & 5 deletions l10n_fr_intrastat_product/models/intrastat_fr_regime.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ class IntrastatFrRegime(models.Model):
]

@api.depends("code", "name")
def name_get(self):
res = []
def _compute_display_name(self):
for rec in self:
name = "%s. %s" % (rec.code, rec.name)
res.append((rec.id, name))
return res
rec.display_name = f"{rec.code}. {rec.name}"

Check warning on line 41 in l10n_fr_intrastat_product/models/intrastat_fr_regime.py

View check run for this annotation

Codecov / codecov/patch

l10n_fr_intrastat_product/models/intrastat_fr_regime.py#L41

Added line #L41 was not covered by tests
5 changes: 1 addition & 4 deletions l10n_fr_intrastat_product/post_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@

import logging

from odoo import SUPERUSER_ID, api

logger = logging.getLogger(__name__)


def set_fr_company_intrastat(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
def set_fr_company_intrastat(env):
imdo = env["ir.model.data"]
afpo = env["account.fiscal.position"]
fr_id = env.ref("base.fr").id
Expand Down
2 changes: 1 addition & 1 deletion l10n_fr_intrastat_product/views/intrastat_fr_regime.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
name="web_ribbon"
title="Archived"
bg_color="bg-danger"
attrs="{'invisible': [('active', '=', True)]}"
invisible="active"
/>
<div class="oe_title">
<label for="name" />
Expand Down
28 changes: 13 additions & 15 deletions l10n_fr_intrastat_product/views/intrastat_product_declaration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
<field name="transaction_id" position="before">
<field
name="fr_regime_id"
attrs="{'invisible': [('company_country_code', '!=', 'FR')], 'required': [('company_country_code', '=', 'FR')]}"
invisible="company_country_code != 'FR'"
required="company_country_code == 'FR'"
/>
</field>
<field name="vat" position="attributes">
<attribute
name="attrs"
>{'invisible': [('declaration_type', '=', 'arrivals'), ('company_country_code', '=', 'FR')]}</attribute>
name="invisible"
>declaration_type == 'arrivals' and company_country_code == 'FR'</attribute>
</field>
</field>
</record>
Expand All @@ -35,13 +36,13 @@
<field name="transaction_code" position="before">
<field
name="fr_regime_code"
attrs="{'column_invisible': [('parent.company_country_code', '!=', 'FR')]}"
column_invisible="parent.company_country_code != 'FR'"
/>
</field>
<field name="vat" position="attributes">
<attribute
name="attrs"
>{'column_invisible': [('parent.declaration_type', '=', 'arrivals'), ('parent.company_country_code', '=', 'FR')]}</attribute>
name="column_invisible"
>parent.declaration_type == 'arrivals' and parent.company_country_code == 'FR'</attribute>
</field>
</field>
</record>
Expand All @@ -53,15 +54,12 @@
/>
<field name="arch" type="xml">
<field name="transaction_id" position="before">
<field
name="fr_regime_id"
attrs="{'invisible': [('company_country_code', '!=', 'FR')]}"
/>
<field name="fr_regime_id" invisible="company_country_code != 'FR'" />
</field>
<field name="vat" position="attributes">
<attribute
name="attrs"
>{'invisible': [('declaration_type', '=', 'arrivals'), ('company_country_code', '=', 'FR')]}</attribute>
name="invisible"
>declaration_type == 'arrivals' and company_country_code == 'FR'</attribute>
</field>
</field>
</record>
Expand All @@ -77,13 +75,13 @@
<field name="transaction_code" position="before">
<field
name="fr_regime_code"
attrs="{'column_invisible': [('parent.company_country_code', '!=', 'FR')]}"
column_invisible="parent.company_country_code != 'FR'"
/>
</field>
<field name="vat" position="attributes">
<attribute
name="attrs"
>{'column_invisible': [('parent.declaration_type', '=', 'arrivals'), ('parent.company_country_code', '=', 'FR')]}</attribute>
name="column_invisible"
>parent.declaration_type == 'arrivals' and parent.company_country_code == 'FR'</attribute>
</field>
</field>
</record>
Expand Down
23 changes: 15 additions & 8 deletions l10n_fr_intrastat_product/views/res_config_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,22 @@
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="intrastat_product.view_res_config_settings" />
<field name="arch" type="xml">
<div id="intrastat-settings" position="inside">
<div class="o_setting_left_pane" />
<div class="o_setting_right_pane">
<div class="row">
<label for="fr_intrastat_accreditation" class="col-md-5" />
<field name="fr_intrastat_accreditation" />
<xpath expr="//setting[@id='intrastat-accessory_costs']" position="after">
<setting
id="intrastat-fr_intrastat_accreditation"
invisible="country_code != 'FR'"
>
<div class="content-group">
<div class="row mt16">
<label
for="fr_intrastat_accreditation"
class="col-lg-5 o_light_label"
/>
<field name="fr_intrastat_accreditation" />
</div>
</div>
</div>
</div>
</setting>
</xpath>
</field>
</record>
</odoo>

0 comments on commit ef81938

Please sign in to comment.