Skip to content

Commit

Permalink
[MIG] account_invoice_start_end_dates: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
thaolt99 committed Nov 30, 2023
1 parent 61e96b0 commit 61885c8
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 28 deletions.
11 changes: 10 additions & 1 deletion account_invoice_start_end_dates/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Account Invoice Start End Dates
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:b4f3db5b68014e9eb2899369770b45a88dad71ae3948fa21734d3bf3740e13c0
!! source digest: sha256:5cdd22e597d4b399a3e56a35773066f3c693343314680f1ba6a5429a5dd01bce
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down Expand Up @@ -78,6 +78,15 @@ Contributors

- Alexis de Lattre <alexis.delattre@akretion.com>
- Jeroen Evens <jeroen.evens@dynapps.be>
- `Trobz <https://trobz.com>`__:

- Thao Le thaolt@trobz.com

Other credits
-------------

The migration of this module from 16.0 to 17.0 was financially supported
by Camptocamp.

Maintainers
-----------
Expand Down
2 changes: 1 addition & 1 deletion account_invoice_start_end_dates/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

{
"name": "Account Invoice Start End Dates",
"version": "16.0.1.2.0",
"version": "17.0.1.0.0",
"category": "Accounting & Finance",
"license": "AGPL-3",
"summary": "Adds start/end dates on invoice/move lines",
Expand Down
3 changes: 1 addition & 2 deletions account_invoice_start_end_dates/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ def _post(self, soft=True):
raise UserError(
_(
"Missing Start Date and End Date for invoice "
"line with Product '%s' which has the "
f"line with Product '{line.product_id.display_name}' which has the "
"property 'Must Have Start/End Dates'."
)
% (line.product_id.display_name)
)
return super()._post(soft=soft)
4 changes: 2 additions & 2 deletions account_invoice_start_end_dates/models/account_move_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ def _check_start_end_dates(self):
for moveline in self:
if moveline.start_date and not moveline.end_date:
raise ValidationError(
_("Missing End Date for line '%s'.") % (moveline.display_name)
_(f"Missing End Date for line '{moveline.display_name}'.")
)
if moveline.end_date and not moveline.start_date:
raise ValidationError(
_("Missing Start Date for line '%s'.") % (moveline.display_name)
_(f"Missing Start Date for line '{moveline.display_name}'.")
)
if (
moveline.end_date
Expand Down
2 changes: 2 additions & 0 deletions account_invoice_start_end_dates/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
- Alexis de Lattre \<<alexis.delattre@akretion.com>\>
- Jeroen Evens \<<jeroen.evens@dynapps.be>\>
- [Trobz](https://trobz.com):
- Thao Le <thaolt@trobz.com>
1 change: 1 addition & 0 deletions account_invoice_start_end_dates/readme/CREDITS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The migration of this module from 16.0 to 17.0 was financially supported by Camptocamp.
16 changes: 13 additions & 3 deletions account_invoice_start_end_dates/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Account Invoice Start End Dates</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:b4f3db5b68014e9eb2899369770b45a88dad71ae3948fa21734d3bf3740e13c0
!! source digest: sha256:5cdd22e597d4b399a3e56a35773066f3c693343314680f1ba6a5429a5dd01bce
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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-closing/tree/17.0/account_invoice_start_end_dates"><img alt="OCA/account-closing" src="https://img.shields.io/badge/github-OCA%2Faccount--closing-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/account-closing-17-0/account-closing-17-0-account_invoice_start_end_dates"><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-closing&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module adds the fields <em>Start Date</em> and <em>End Date</em> on invoice/move
Expand Down Expand Up @@ -397,7 +397,8 @@ <h1 class="title">Account Invoice Start End Dates</h1>
<li><a class="reference internal" href="#credits" id="toc-entry-2">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-3">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-4">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-5">Maintainers</a></li>
<li><a class="reference internal" href="#other-credits" id="toc-entry-5">Other credits</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-6">Maintainers</a></li>
</ul>
</li>
</ul>
Expand All @@ -423,10 +424,19 @@ <h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
<ul class="simple">
<li>Alexis de Lattre &lt;<a class="reference external" href="mailto:alexis.delattre&#64;akretion.com">alexis.delattre&#64;akretion.com</a>&gt;</li>
<li>Jeroen Evens &lt;<a class="reference external" href="mailto:jeroen.evens&#64;dynapps.be">jeroen.evens&#64;dynapps.be</a>&gt;</li>
<li><a class="reference external" href="https://trobz.com">Trobz</a>:<ul>
<li>Thao Le <a class="reference external" href="mailto:thaolt&#64;trobz.com">thaolt&#64;trobz.com</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="other-credits">
<h2><a class="toc-backref" href="#toc-entry-5">Other credits</a></h2>
<p>The migration of this module from 16.0 to 17.0 was financially supported
by Camptocamp.</p>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
<h2><a class="toc-backref" href="#toc-entry-6">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>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
Expand Down
26 changes: 7 additions & 19 deletions account_invoice_start_end_dates/views/account_move.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,8 @@
<field name="arch" type="xml">
<field name="date_maturity" position="after">
<field name="must_have_dates" invisible="1" />
<field
name="start_date"
attrs="{'required': [('must_have_dates', '=', True)]}"
/>
<field
name="end_date"
attrs="{'required': [('must_have_dates', '=', True)]}"
/>
<field name="start_date" required="must_have_dates == True" />
<field name="end_date" required="must_have_dates == True" />
</field>
</field>
</record>
Expand All @@ -29,7 +23,7 @@
<field name="inherit_id" ref="account.view_move_line_tree" />
<field name="arch" type="xml">
<field name="date_maturity" position="after">
<field name="must_have_dates" invisible="1" />
<field name="must_have_dates" column_invisible="1" />
<field name="start_date" optional="hide" />
<field name="end_date" optional="hide" />
</field>
Expand All @@ -47,12 +41,12 @@
<field name="must_have_dates" invisible="1" />
<field
name="start_date"
attrs="{'required': [('must_have_dates', '=', True)]}"
required="must_have_dates == True"
optional="show"
/>
<field
name="end_date"
attrs="{'required': [('must_have_dates', '=', True)]}"
required="must_have_dates == True"
optional="show"
/>
</xpath>
Expand All @@ -61,14 +55,8 @@
position="before"
>
<field name="must_have_dates" invisible="1" />
<field
name="start_date"
attrs="{'required': [('must_have_dates', '=', True)]}"
/>
<field
name="end_date"
attrs="{'required': [('must_have_dates', '=', True)]}"
/>
<field name="start_date" required="must_have_dates == True" />
<field name="end_date" required="must_have_dates == True" />
</xpath>
<xpath
expr="//field[@name='line_ids']/tree/field[@name='credit']"
Expand Down

0 comments on commit 61885c8

Please sign in to comment.