Skip to content

Commit 3d2c91b

Browse files
committed
[MIG] account_invoice_fiscal_position_update: Migration to 18.0
1 parent e8b52a5 commit 3d2c91b

File tree

5 files changed

+215
-58
lines changed

5 files changed

+215
-58
lines changed

account_invoice_fiscal_position_update/README.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ Invoice Fiscal Position Update
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%2Faccount--invoicing-lightgray.png?logo=github
20-
:target: https://github.com/OCA/account-invoicing/tree/17.0/account_invoice_fiscal_position_update
20+
:target: https://github.com/OCA/account-invoicing/tree/18.0/account_invoice_fiscal_position_update
2121
:alt: OCA/account-invoicing
2222
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/account-invoicing-17-0/account-invoicing-17-0-account_invoice_fiscal_position_update
23+
:target: https://translation.odoo-community.org/projects/account-invoicing-18-0/account-invoicing-18-0-account_invoice_fiscal_position_update
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/account-invoicing&target_branch=17.0
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/account-invoicing&target_branch=18.0
2727
:alt: Try me on Runboat
2828

2929
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -50,7 +50,7 @@ Bug Tracker
5050
Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-invoicing/issues>`_.
5151
In case of trouble, please check there if your issue has already been reported.
5252
If you spotted it first, help us to smash it by providing a detailed and welcomed
53-
`feedback <https://github.com/OCA/account-invoicing/issues/new?body=module:%20account_invoice_fiscal_position_update%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
53+
`feedback <https://github.com/OCA/account-invoicing/issues/new?body=module:%20account_invoice_fiscal_position_update%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
5454

5555
Do not contact contributors directly about support or help with technical issues.
5656

@@ -105,6 +105,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
105105

106106
|maintainer-alexis-via|
107107

108-
This module is part of the `OCA/account-invoicing <https://github.com/OCA/account-invoicing/tree/17.0/account_invoice_fiscal_position_update>`_ project on GitHub.
108+
This module is part of the `OCA/account-invoicing <https://github.com/OCA/account-invoicing/tree/18.0/account_invoice_fiscal_position_update>`_ project on GitHub.
109109

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

account_invoice_fiscal_position_update/__manifest__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
{
99
"name": "Invoice Fiscal Position Update",
10-
"version": "17.0.1.0.0",
10+
"version": "18.0.1.0.0",
1111
"category": "Accounting",
1212
"license": "AGPL-3",
1313
"summary": "Changing the fiscal position of an invoice will auto-update "

account_invoice_fiscal_position_update/models/account_move.py

+7
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,14 @@ def _onchange_fiscal_position_id_account_invoice_fiscal_position_invoice(self):
2323
if not line.product_id:
2424
lines_without_product |= line
2525
else:
26+
# Preserve the subtotal when converting from tax incl to excl
27+
price_unit = line.product_id._get_tax_included_unit_price_from_price(
28+
line.price_unit,
29+
line.tax_ids,
30+
fiscal_position=line.move_id.fiscal_position_id,
31+
)
2632
line._compute_tax_ids()
33+
line.price_unit = price_unit
2734
line._compute_account_id()
2835
if lines_without_product:
2936
res["warning"] = {"title": _("Warning")}

account_invoice_fiscal_position_update/static/description/index.html

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<?xml version="1.0" encoding="utf-8"?>
21
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
32
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
43
<head>
@@ -9,10 +8,11 @@
98

109
/*
1110
:Author: David Goodger ([email protected])
12-
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
11+
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
1312
:Copyright: This stylesheet has been placed in the public domain.
1413
1514
Default cascading style sheet for the HTML output of Docutils.
15+
Despite the name, some widely supported CSS2 features are used.
1616
1717
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
1818
customize this style sheet.
@@ -275,7 +275,7 @@
275275
margin-left: 2em ;
276276
margin-right: 2em }
277277

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

304-
span.problematic {
304+
span.problematic, pre.problematic {
305305
color: red }
306306

307307
span.section-subtitle {
@@ -369,7 +369,7 @@ <h1 class="title">Invoice Fiscal Position Update</h1>
369369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370370
!! source digest: sha256:87c4c266ef71609beca654ce2d1a4501872c66cd56e881f0141e7cd4fb517368
371371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372-
<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/account-invoicing/tree/17.0/account_invoice_fiscal_position_update"><img alt="OCA/account-invoicing" src="https://img.shields.io/badge/github-OCA%2Faccount--invoicing-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/account-invoicing-17-0/account-invoicing-17-0-account_invoice_fiscal_position_update"><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/account-invoicing&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
372+
<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/account-invoicing/tree/18.0/account_invoice_fiscal_position_update"><img alt="OCA/account-invoicing" src="https://img.shields.io/badge/github-OCA%2Faccount--invoicing-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/account-invoicing-18-0/account-invoicing-18-0-account_invoice_fiscal_position_update"><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/account-invoicing&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373373
<p>With this module, when a user changes the fiscal position of an invoice,
374374
the taxes and the accounts on all the invoice lines which have a product
375375
are automatically updated. The invoice lines without a product are not
@@ -397,7 +397,7 @@ <h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
397397
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/account-invoicing/issues">GitHub Issues</a>.
398398
In case of trouble, please check there if your issue has already been reported.
399399
If you spotted it first, help us to smash it by providing a detailed and welcomed
400-
<a class="reference external" href="https://github.com/OCA/account-invoicing/issues/new?body=module:%20account_invoice_fiscal_position_update%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
400+
<a class="reference external" href="https://github.com/OCA/account-invoicing/issues/new?body=module:%20account_invoice_fiscal_position_update%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
401401
<p>Do not contact contributors directly about support or help with technical issues.</p>
402402
</div>
403403
<div class="section" id="credits">
@@ -441,13 +441,15 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
441441
<div class="section" id="maintainers">
442442
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
443443
<p>This module is maintained by the OCA.</p>
444-
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
444+
<a class="reference external image-reference" href="https://odoo-community.org">
445+
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
446+
</a>
445447
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
446448
mission is to support the collaborative development of Odoo features and
447449
promote its widespread use.</p>
448450
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
449451
<p><a class="reference external image-reference" href="https://github.com/alexis-via"><img alt="alexis-via" src="https://github.com/alexis-via.png?size=40px" /></a></p>
450-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-invoicing/tree/17.0/account_invoice_fiscal_position_update">OCA/account-invoicing</a> project on GitHub.</p>
452+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-invoicing/tree/18.0/account_invoice_fiscal_position_update">OCA/account-invoicing</a> project on GitHub.</p>
451453
<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>
452454
</div>
453455
</div>

0 commit comments

Comments
 (0)