Skip to content

Commit 9687acd

Browse files
committed
[MIG] l10n_it_bill_of_entry: Migration to 18.0
1 parent 1502673 commit 9687acd

9 files changed

Lines changed: 89 additions & 151 deletions

File tree

l10n_it_bill_of_entry/README.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ ITA - Bolle doganali
1717
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1818
:alt: License: AGPL-3
1919
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github
20-
:target: https://github.com/OCA/l10n-italy/tree/16.0/l10n_it_bill_of_entry
20+
:target: https://github.com/OCA/l10n-italy/tree/18.0/l10n_it_bill_of_entry
2121
:alt: OCA/l10n-italy
2222
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/l10n-italy-16-0/l10n-italy-16-0-l10n_it_bill_of_entry
23+
:target: https://translation.odoo-community.org/projects/l10n-italy-18-0/l10n-italy-18-0-l10n_it_bill_of_entry
2424
:alt: Translate me on Weblate
2525
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26-
:target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-italy&target_branch=16.0
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-italy&target_branch=18.0
2727
:alt: Try me on Runboat
2828

2929
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -148,7 +148,7 @@ Bug Tracker
148148
Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-italy/issues>`_.
149149
In case of trouble, please check there if your issue has already been reported.
150150
If you spotted it first, help us to smash it by providing a detailed and welcomed
151-
`feedback <https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_bill_of_entry%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
151+
`feedback <https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_bill_of_entry%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
152152

153153
Do not contact contributors directly about support or help with technical issues.
154154

@@ -176,6 +176,8 @@ Contributors
176176

177177
- Simone Rubino <simone.rubino@aion-tech.it>
178178

179+
- `Nextev Srl <https://nextev.it/>`__ <odoo@nextev.it>
180+
179181
Maintainers
180182
-----------
181183

@@ -189,6 +191,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
189191
mission is to support the collaborative development of Odoo features and
190192
promote its widespread use.
191193

192-
This module is part of the `OCA/l10n-italy <https://github.com/OCA/l10n-italy/tree/16.0/l10n_it_bill_of_entry>`_ project on GitHub.
194+
This module is part of the `OCA/l10n-italy <https://github.com/OCA/l10n-italy/tree/18.0/l10n_it_bill_of_entry>`_ project on GitHub.
193195

194196
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

l10n_it_bill_of_entry/__manifest__.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,13 @@
99

1010
{
1111
"name": "ITA - Bolle doganali",
12-
"version": "16.0.1.0.1",
12+
"version": "18.0.1.0.0",
1313
"category": "Localization/Italy",
1414
"author": "Agile Business Group, CQ Creativi Quadrati, TAKOBI, "
1515
"Odoo Community Association (OCA)",
16-
"website": "https://github.com/OCA/l10n-italy" "/tree/16.0/l10n_it_bill_of_entry",
16+
"website": "https://github.com/OCA/l10n-italy",
1717
"license": "AGPL-3",
18-
"depends": [
19-
"base",
20-
"account",
21-
],
18+
"depends": ["base", "account", "l10n_it"],
2219
"data": [
2320
"views/company_view.xml",
2421
"views/account_invoice_view.xml",

l10n_it_bill_of_entry/demo/bill_of_entry_demo.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
<field name="name">Delivery Expenses</field>
4141
<field name="account_type">expense</field>
4242
<field name="reconcile">True</field>
43+
<field name="company_ids" eval="[(6, 0, [ref('base.demo_company_it')])]" />
4344
</record>
4445

4546
<!-- Account Tax -->
@@ -54,26 +55,31 @@
5455
<field name="amount_type">percent</field>
5556
<field name="amount">22</field>
5657
<field name="description">22aExtraUE</field>
57-
<field name="tax_group_id" ref="account.tax_group_taxes" />
58+
<field name="country_id" ref="base.it" />
59+
<field name="tax_group_id" ref="account.2_tax_group_iva_22" />
60+
<field name="company_id" ref="base.demo_company_it" />
5861
<field name="sequence">99</field>
5962
</record>
6063

6164
<!-- Partner -->
6265
<record id="partner_customs" model="res.partner">
6366
<field name="name">Customs</field>
6467
<field name="is_company">True</field>
68+
<field name="company_id" ref="base.demo_company_it" />
6569
</record>
6670

6771
<!-- Account Fiscal Position -->
6872
<record id="fiscal_position_extraEU" model="account.fiscal.position">
6973
<field name="name">Extra EU</field>
74+
<field name="company_id" ref="base.demo_company_it" />
7075
</record>
7176

7277
<!-- Account Journal -->
7378
<record id="account_journal_purchase_extraEU" model="account.journal">
7479
<field name="name">Supplier Invoices ExtraUE</field>
7580
<field name="type">purchase</field>
7681
<field name="code">NOUE</field>
82+
<field name="company_id" ref="base.demo_company_it" />
7783
</record>
7884

7985
<!-- Product product -->

l10n_it_bill_of_entry/models/account_move.py

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from odoo import fields, models
66
from odoo.exceptions import UserError
77
from odoo.fields import first
8-
from odoo.tools.translate import _
98

109

1110
class AccountMove(models.Model):
@@ -112,7 +111,7 @@ def _check_forwarder_invoice_advance_customs_vat_line(self, boe_tax_rates):
112111
break
113112
if not advance_customs_vat_line and list(set(boe_tax_rates)) != [0.0]:
114113
raise UserError(
115-
_(
114+
self.env._(
116115
"Forwarder invoice %s does not have lines with "
117116
"'Advance Customs Vat'"
118117
)
@@ -123,11 +122,11 @@ def _check_forwarder_invoice_advance_customs_vat_line(self, boe_tax_rates):
123122
def _get_forwarder_invoice_boe_amounts(self):
124123
self.ensure_one()
125124
if not self.forwarder_bill_of_entry_ids:
126-
raise UserError(_("No bill of entries found for this invoice"))
125+
raise UserError(self.env._("No bill of entries found for this invoice"))
127126
for bill_of_entry in self.forwarder_bill_of_entry_ids:
128127
if bill_of_entry.state not in ("posted", "paid"):
129128
raise UserError(
130-
_(
129+
self.env._(
131130
"Bill of entry %(partner)s is in state %(state)s",
132131
partner=bill_of_entry.partner_id.name,
133132
state=bill_of_entry.state,
@@ -143,7 +142,7 @@ def _get_forwarder_invoice_boe_amounts(self):
143142
def _prepare_bill_of_entry_storno(self):
144143
self.ensure_one()
145144
if not self.company_id.bill_of_entry_journal_id:
146-
raise UserError(_("No Bill of entry Storno journal configured"))
145+
raise UserError(self.env._("No Bill of entry Storno journal configured"))
147146
move_vals = {
148147
"customs_doc_type": False,
149148
"move_type": "entry",
@@ -154,7 +153,7 @@ def _prepare_bill_of_entry_storno(self):
154153
for inv_line in self.invoice_line_ids:
155154
if inv_line.advance_customs_vat:
156155
line_vals = {
157-
"name": _("Customs expenses"),
156+
"name": self.env._("Customs expenses"),
158157
"account_id": inv_line.account_id.id,
159158
"debit": 0.0,
160159
"credit": inv_line.price_subtotal,
@@ -170,7 +169,7 @@ def _prepare_bill_of_entry_storno(self):
170169
)
171170
boe_account = first(boe_payable_lines).account_id
172171
line_vals = {
173-
"name": _("Customs supplier"),
172+
"name": self.env._("Customs supplier"),
174173
"account_id": first(boe_account).id,
175174
"debit": bill_of_entry.amount_total,
176175
"credit": 0.0,
@@ -181,12 +180,12 @@ def _prepare_bill_of_entry_storno(self):
181180
if boe_line.tax_ids:
182181
if len(boe_line.tax_ids) > 1:
183182
raise UserError(
184-
_("Can't handle more than 1 tax for line %s")
183+
self.env._("Can't handle more than 1 tax for line %s")
185184
% boe_line.name
186185
)
187186

188187
line_vals = {
189-
"name": _("Extra UE expenses"),
188+
"name": self.env._("Extra UE expenses"),
190189
"account_id": boe_line.account_id.id,
191190
"debit": 0.0,
192191
"credit": boe_line.price_subtotal,
@@ -258,21 +257,27 @@ def _check_no_taxes(self):
258257
self.ensure_one()
259258
for line in self.invoice_line_ids:
260259
if line.tax_ids:
261-
raise UserError(_("Extra UE supplier invoice must have no taxes"))
260+
raise UserError(
261+
self.env._("Extra UE supplier invoice must have no taxes")
262+
)
262263

263264
def generate_bill_of_entry(self):
264265
self.ensure_one()
265266
if self.customs_doc_type != "supplier_invoice":
266267
raise UserError(
267-
_("You can generate bill of entry from extra UE supplier invoice only")
268+
self.env._(
269+
"You can generate bill of entry from extra UE supplier invoice only"
270+
)
268271
)
269272
if not self.company_id.bill_of_entry_tax_id:
270273
raise UserError(
271-
_("Please set 'Bill of entry tax' in accounting configuration")
274+
self.env._("Please set 'Bill of entry tax' in accounting configuration")
272275
)
273276
if not self.company_id.bill_of_entry_partner_id:
274277
raise UserError(
275-
_("Please set 'Bill of entry partner' in accounting configuration")
278+
self.env._(
279+
"Please set 'Bill of entry partner' in accounting configuration"
280+
)
276281
)
277282
self._check_no_taxes()
278283
boe_inv = self.copy(

l10n_it_bill_of_entry/readme/CONTRIBUTORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
- Diego Bruselli \<<d.bruselli@creativiquadrati.it>\>
66
- [Aion Tech](https://aiontech.company/):
77
- Simone Rubino \<<simone.rubino@aion-tech.it>\>
8+
- [Nextev Srl](https://nextev.it/) \<<odoo@nextev.it>\>

l10n_it_bill_of_entry/static/description/index.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ <h1 class="title">ITA - Bolle doganali</h1>
368368
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
369369
!! source digest: sha256:797aec23d73bd9b18d5c80392d2310798e15660f13b166a61a754d33b8e27677
370370
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
371-
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/l10n-italy/tree/16.0/l10n_it_bill_of_entry"><img alt="OCA/l10n-italy" src="https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/l10n-italy-16-0/l10n-italy-16-0-l10n_it_bill_of_entry"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/l10n-italy&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
371+
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/l10n-italy/tree/18.0/l10n_it_bill_of_entry"><img alt="OCA/l10n-italy" src="https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/l10n-italy-18-0/l10n-italy-18-0-l10n_it_bill_of_entry"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/l10n-italy&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
372372
<p>This module enables to manage extraUE import purchases, generating a
373373
bill of entry according to the supplier invoice.</p>
374374
<p>It involves three documents:</p>
@@ -486,7 +486,7 @@ <h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
486486
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/l10n-italy/issues">GitHub Issues</a>.
487487
In case of trouble, please check there if your issue has already been reported.
488488
If you spotted it first, help us to smash it by providing a detailed and welcomed
489-
<a class="reference external" href="https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_bill_of_entry%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
489+
<a class="reference external" href="https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_bill_of_entry%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
490490
<p>Do not contact contributors directly about support or help with technical issues.</p>
491491
</div>
492492
<div class="section" id="credits">
@@ -513,6 +513,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
513513
<li>Simone Rubino &lt;<a class="reference external" href="mailto:simone.rubino&#64;aion-tech.it">simone.rubino&#64;aion-tech.it</a>&gt;</li>
514514
</ul>
515515
</li>
516+
<li><a class="reference external" href="https://nextev.it/">Nextev Srl</a> &lt;<a class="reference external" href="mailto:odoo&#64;nextev.it">odoo&#64;nextev.it</a>&gt;</li>
516517
</ul>
517518
</div>
518519
<div class="section" id="maintainers">
@@ -522,7 +523,7 @@ <h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
522523
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
523524
mission is to support the collaborative development of Odoo features and
524525
promote its widespread use.</p>
525-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-italy/tree/16.0/l10n_it_bill_of_entry">OCA/l10n-italy</a> project on GitHub.</p>
526+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-italy/tree/18.0/l10n_it_bill_of_entry">OCA/l10n-italy</a> project on GitHub.</p>
526527
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
527528
</div>
528529
</div>

l10n_it_bill_of_entry/tests/test_bill_of_entry.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from odoo.exceptions import UserError
88
from odoo.fields import first
9-
from odoo.tests.common import Form, tagged
9+
from odoo.tests import Form, tagged
1010

1111
from odoo.addons.account.tests.common import AccountTestInvoicingCommon
1212

@@ -44,7 +44,7 @@ def setUp(self):
4444
self.fp_model = self.env["account.fiscal.position"]
4545
self.fp_tax_model = self.env["account.fiscal.position.tax"]
4646

47-
demo_data_company = self.env.ref("base.main_company")
47+
demo_data_company = self.env.ref("base.demo_company_it")
4848
self.env.user.company_ids |= demo_data_company
4949
self.env.user.company_id = demo_data_company
5050
# Now that current user can access the company,
@@ -64,7 +64,7 @@ def setUp(self):
6464
"l10n_it_bill_of_entry.account_journal_purchase_extraEU"
6565
)
6666
# Bill of entry storno journal
67-
self.company = self.env.ref("base.main_company")
67+
self.company = self.env.ref("base.demo_company_it")
6868
self.bill_of_entry_journal = self.journal_model.create(
6969
{
7070
"name": "bill_of_entry_journal",
@@ -81,7 +81,7 @@ def setUp(self):
8181
"amount": 22,
8282
"amount_type": "percent",
8383
"type_tax_use": "purchase",
84-
"tax_group_id": self.env.ref("account.tax_group_taxes").id,
84+
"tax_group_id": self.env.ref("account.2_tax_group_iva_22").id,
8585
}
8686
)
8787
self.fiscpos_extra = self.env.ref(

0 commit comments

Comments
 (0)