From 32357068e0e45a2c92148b3eb9f310ad194e34df Mon Sep 17 00:00:00 2001 From: Joan Sisquella Date: Tue, 17 Sep 2024 13:02:00 +0200 Subject: [PATCH] [IMP] stock_cycle_count: remove auto confirmation logic from the cron --- stock_cycle_count/models/stock_warehouse.py | 14 -------------- stock_cycle_count/static/description/index.html | 11 ++++------- stock_cycle_count/views/stock_cycle_count_view.xml | 4 +++- 3 files changed, 7 insertions(+), 22 deletions(-) diff --git a/stock_cycle_count/models/stock_warehouse.py b/stock_cycle_count/models/stock_warehouse.py index 8585dfc1c70e..469ed0ec7d05 100644 --- a/stock_cycle_count/models/stock_warehouse.py +++ b/stock_cycle_count/models/stock_warehouse.py @@ -150,20 +150,6 @@ def cron_cycle_count(self): try: whs = self.search([]) whs.action_compute_cycle_count_rules() - today = fields.Date.today() - cycle_counts = self.env["stock.cycle.count"].search( - [("date_deadline", "<=", today), ("state", "=", "draft")] - ) - for cycle_count in cycle_counts: - open_cycle_counts = self.env["stock.cycle.count"].search( - [ - ("location_id", "=", cycle_count.location_id.id), - ("state", "=", "open"), - ] - ) - if open_cycle_counts: - continue - cycle_count.action_create_inventory_adjustment() except Exception as e: _logger.info("Error while running stock_cycle_count cron job: %s", str(e)) raise diff --git a/stock_cycle_count/static/description/index.html b/stock_cycle_count/static/description/index.html index 17edd7396e84..7cf0ee64c511 100644 --- a/stock_cycle_count/static/description/index.html +++ b/stock_cycle_count/static/description/index.html @@ -8,11 +8,10 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ +:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. -Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -275,7 +274,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: gray; } /* line numbers */ +pre.code .ln { color: grey; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -301,7 +300,7 @@ span.pre { white-space: pre } -span.problematic, pre.problematic { +span.problematic { color: red } span.section-subtitle { @@ -514,9 +513,7 @@

Contributors

Maintainers

This module is maintained by the OCA.

- -Odoo Community Association - +Odoo Community Association

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.

diff --git a/stock_cycle_count/views/stock_cycle_count_view.xml b/stock_cycle_count/views/stock_cycle_count_view.xml index 5eacdd102805..09b7ff1175a5 100644 --- a/stock_cycle_count/views/stock_cycle_count_view.xml +++ b/stock_cycle_count/views/stock_cycle_count_view.xml @@ -11,6 +11,7 @@ decoration-muted="state == 'cancelled'" decoration-info="state == 'draft'" multi_edit="1" + default_order="date_deadline asc" > @@ -126,6 +127,7 @@ domain="[('state','=', 'cancelled')]" help="Cycle Counts Cancelled" /> + tree,form {'search_default_planned':1,'search_default_execution':1,'search_default_date_deadline':1} + >{'search_default_planned':1,'search_default_execution':1}