Skip to content

Commit

Permalink
[MIG] l10n_fr_intrastat_product: migrate to v18
Browse files Browse the repository at this point in the history
  • Loading branch information
alexis-via committed Feb 1, 2025
1 parent 7d3ff33 commit 50d8821
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 21 deletions.
2 changes: 1 addition & 1 deletion 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": "17.0.1.0.0",
"version": "18.0.1.0.0",
"category": "Localisation/Report Intrastat",
"license": "AGPL-3",
"summary": "EMEBI (ex-DEB) for France",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<field name="user_id" ref="base.user_root" />
<field name="interval_number">1</field>
<field name="interval_type">months</field>
<field name="numbercall">-1</field>
<field
name="model_id"
ref="intrastat_product.model_intrastat_product_declaration"
Expand Down
3 changes: 2 additions & 1 deletion l10n_fr_intrastat_product/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from . import intrastat_fr_regime
from . import intrastat_unit
from . import stock
from . import stock_warehouse
from . import stock_location
from . import res_company
from . import intrastat_product_declaration
18 changes: 18 additions & 0 deletions l10n_fr_intrastat_product/models/stock_location.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2010-2022 Akretion France (http://www.akretion.com)
# @author Alexis de Lattre <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import models


class StockLocation(models.Model):
_inherit = "stock.location"

def _get_fr_department(self):
self.ensure_one()
warehouse = self.env["stock.warehouse"].search(
[("lot_stock_id", "parent_of", self.id)], limit=1
)
if warehouse:
return warehouse._get_fr_department()
return None
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,3 @@ def _get_fr_department(self):
if not self.partner_id:
raise UserError(_("Missing partner on warehouse '%s'.") % self.display_name)
return self.partner_id.country_department_id


class StockLocation(models.Model):
_inherit = "stock.location"

def _get_fr_department(self):
self.ensure_one()
warehouse = self.env["stock.warehouse"].search(
[("lot_stock_id", "parent_of", self.ids)], limit=1
)
if warehouse:
return warehouse._get_fr_department()
return None
8 changes: 4 additions & 4 deletions l10n_fr_intrastat_product/views/intrastat_fr_regime.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
<record id="intrastat_fr_regime_tree" model="ir.ui.view">
<field name="model">intrastat.fr.regime</field>
<field name="arch" type="xml">
<tree>
<field name="code" />
<list>
<field name="code" decoration-bf="1" />
<field name="name" />
<field name="is_fiscal_only" optional="show" />
<field name="fiscal_value_multiplier" optional="show" />
Expand All @@ -52,7 +52,7 @@
decoration-warning="declaration_type == 'dispatches'"
widget="badge"
/>
</tree>
</list>
</field>
</record>

Expand Down Expand Up @@ -96,7 +96,7 @@
<record id="intrastat_fr_regime_action" model="ir.actions.act_window">
<field name="name">Regime Codes</field>
<field name="res_model">intrastat.fr.regime</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">list,form</field>
</record>

<menuitem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
>
<field name="name">EMEBI</field>
<field name="res_model">intrastat.product.declaration</field>
<field name="view_mode">tree,form,graph,pivot</field>
<field name="view_mode">list,form,graph,pivot</field>
</record>
<menuitem
id="l10n_fr_intrastat_product_declaration_menu"
Expand Down

0 comments on commit 50d8821

Please sign in to comment.