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 ea8337d
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 75 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
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ def _check_fr_declaration(self):
):
raise ValidationError(

Check warning on line 51 in l10n_fr_intrastat_product/models/intrastat_product_declaration.py

View check run for this annotation

Codecov / codecov/patch

l10n_fr_intrastat_product/models/intrastat_product_declaration.py#L51

Added line #L51 was not covered by tests
_(
"In France, an arrival EMEBI cannot have a 'standard' reporting level."
"In France, an arrival EMEBI cannot have a 'standard' "
"reporting level."
)
)

Expand Down Expand Up @@ -428,7 +429,8 @@ def _generate_xml_line(self, parent_node, eu_countries):
if not self.src_dest_country_code:
raise UserError(

Check warning on line 430 in l10n_fr_intrastat_product/models/intrastat_product_declaration.py

View check run for this annotation

Codecov / codecov/patch

l10n_fr_intrastat_product/models/intrastat_product_declaration.py#L430

Added line #L430 was not covered by tests
_(
"Missing country code of origin/destination on declaration line %d."
"Missing country code of origin/destination on "
"declaration line %d."
)
% self.line_number
)
Expand Down
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
12 changes: 7 additions & 5 deletions l10n_fr_intrastat_product/static/description/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
Expand All @@ -9,10 +8,11 @@

/*
:Author: David Goodger ([email protected])
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.

See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -275,7 +275,7 @@
margin-left: 2em ;
margin-right: 2em }

pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -301,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -444,7 +444,9 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
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 ea8337d

Please sign in to comment.