Skip to content

Commit

Permalink
[MIG] account_cutoff_picking: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
thaolt99 committed Dec 5, 2023
1 parent 57761b8 commit 77cf3ce
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 44 deletions.
16 changes: 7 additions & 9 deletions account_cutoff_picking/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Account Cut-off Picking
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:c4760ddc4c5bdaa231e0019fab6cb247a9d41b23e3e0fa92cbb9b10e9744044d
!! source digest: sha256:2ffc9046ed45f7987a9672f07c761e8aaac1ff9b79c97fc6088a8026df1b558b
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down Expand Up @@ -117,6 +117,12 @@ Contributors

- Alexis de Lattre <[email protected]>

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

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

Maintainers
-----------

Expand All @@ -130,14 +136,6 @@ 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.

.. |maintainer-alexis-via| image:: https://github.com/alexis-via.png?size=40px
:target: https://github.com/alexis-via
:alt: alexis-via

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-alexis-via|

This module is part of the `OCA/account-closing <https://github.com/OCA/account-closing/tree/17.0/account_cutoff_picking>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 2 additions & 2 deletions account_cutoff_picking/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

{
"name": "Account Cut-off Picking",
"version": "16.0.1.2.0",
"version": "17.0.1.0.0",
"category": "Accounting",
"license": "AGPL-3",
"summary": "Accrued and prepaid expense/revenue from pickings",
"author": "Akretion,Odoo Community Association (OCA)",
"maintainers": ["alexis-via"],
"maintainer": "alexis-via",
"website": "https://github.com/OCA/account-closing",
"depends": ["account_cutoff_base", "purchase_stock", "sale_stock"],
"data": ["views/res_config_settings.xml", "views/account_cutoff.xml"],
Expand Down
23 changes: 0 additions & 23 deletions account_cutoff_picking/migrations/16.0.1.0.0/pre-migration.py

This file was deleted.

5 changes: 2 additions & 3 deletions account_cutoff_picking/models/account_cutoff.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class AccountCutoff(models.Model):
picking_interval_days = fields.Integer(
string="Analysis Interval",
default=lambda self: self._default_picking_interval_days(),
states={"done": [("readonly", True)]},
tracking=True,
help="To generate the cutoffs based on picking "
"dates vs invoice dates, Odoo will analyse all the pickings/invoices from "
Expand Down Expand Up @@ -205,15 +204,15 @@ def order_line_update_oline_dict_from_stock_moves(
):
sign = order_type == "purchase" and -1 or 1
move_qty = out_move.product_uom._compute_quantity(
out_move.quantity_done * sign, product_uom
out_move.quantity * sign, product_uom
)
move_logs.append((out_move, move_qty))
for in_move in incoming_moves.filtered(
lambda m: m.state == "done" and m.date <= cutoff_datetime
):
sign = order_type == "sale" and -1 or 1
move_qty = in_move.product_uom._compute_quantity(
in_move.quantity_done * sign, product_uom
in_move.quantity * sign, product_uom
)
move_logs.append((in_move, move_qty))
move_logs_sorted = sorted(move_logs, key=lambda to_sort: to_sort[0].date)
Expand Down
2 changes: 2 additions & 0 deletions account_cutoff_picking/readme/CREDITS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The migration of this module from 16.0 to 17.0 was financially supported
by Camptocamp
15 changes: 9 additions & 6 deletions account_cutoff_picking/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 Down Expand Up @@ -367,7 +366,7 @@ <h1 class="title">Account Cut-off Picking</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:c4760ddc4c5bdaa231e0019fab6cb247a9d41b23e3e0fa92cbb9b10e9744044d
!! source digest: sha256:2ffc9046ed45f7987a9672f07c761e8aaac1ff9b79c97fc6088a8026df1b558b
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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_cutoff_picking"><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_cutoff_picking"><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 generates expense/revenue accruals and prepaid
Expand Down Expand Up @@ -431,7 +430,8 @@ <h1 class="title">Account Cut-off Picking</h1>
<li><a class="reference internal" href="#credits" id="toc-entry-3">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-4">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-5">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-6">Maintainers</a></li>
<li><a class="reference internal" href="#other-credits" id="toc-entry-6">Other credits</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-7">Maintainers</a></li>
</ul>
</li>
</ul>
Expand Down Expand Up @@ -463,15 +463,18 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<li>Alexis de Lattre &lt;<a class="reference external" href="mailto:alexis.delattre&#64;akretion.com">alexis.delattre&#64;akretion.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="other-credits">
<h2><a class="toc-backref" href="#toc-entry-6">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-6">Maintainers</a></h2>
<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>
<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>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<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>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-closing/tree/17.0/account_cutoff_picking">OCA/account-closing</a> project on GitHub.</p>
<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>
</div>
Expand Down
6 changes: 5 additions & 1 deletion account_cutoff_picking/views/account_cutoff.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
<field name="cutoff_date" position="after">
<label for="picking_interval_days" />
<div name="picking_interval_days">
<field name="picking_interval_days" class="oe_inline" /> days
<field
name="picking_interval_days"
class="oe_inline"
readonly="state == 'done'"
/> days
</div>
</field>
</field>
Expand Down

0 comments on commit 77cf3ce

Please sign in to comment.