diff --git a/stock_cycle_count/README.rst b/stock_cycle_count/README.rst index edcf7c725..5d220eef8 100644 --- a/stock_cycle_count/README.rst +++ b/stock_cycle_count/README.rst @@ -14,13 +14,13 @@ Stock Cycle Count :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github - :target: https://github.com/OCA/stock-logistics-warehouse/tree/11.0/stock_cycle_count + :target: https://github.com/OCA/stock-logistics-warehouse/tree/12.0/stock_cycle_count :alt: OCA/stock-logistics-warehouse .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-11-0/stock-logistics-warehouse-11-0-stock_cycle_count + :target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-12-0/stock-logistics-warehouse-12-0-stock_cycle_count :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/153/11.0 + :target: https://runbot.odoo-community.org/runbot/153/12.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -104,6 +104,12 @@ Known issues / Roadmap Changelog ========= +12.0.1.0.0 (2019-06-24) +~~~~~~~~~~~~~~~~~~~~~~~ + +* [MIG] Migrated to v12. + + 11.0.1.0.0 (2018-09-19) ~~~~~~~~~~~~~~~~~~~~~~~ @@ -115,7 +121,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -132,6 +138,7 @@ Contributors * Lois Rilo * Jordi Ballester Alomar +* Bhavesh Odedra Maintainers ~~~~~~~~~~~ @@ -154,6 +161,6 @@ Current `maintainer `__: |maintainer-lreficent| -This module is part of the `OCA/stock-logistics-warehouse `_ project on GitHub. +This module is part of the `OCA/stock-logistics-warehouse `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/stock_cycle_count/__manifest__.py b/stock_cycle_count/__manifest__.py index 4d17df48f..de84db8e4 100644 --- a/stock_cycle_count/__manifest__.py +++ b/stock_cycle_count/__manifest__.py @@ -5,7 +5,7 @@ "name": "Stock Cycle Count", "summary": "Adds the capability to schedule cycle counts in a " "warehouse through different rules defined by the user.", - "version": "11.0.1.0.1", + "version": "12.0.1.0.1", "development_status": "Mature", "maintainers": ["lreficent"], "author": "Eficent, " diff --git a/stock_cycle_count/models/stock_cycle_count_rule.py b/stock_cycle_count/models/stock_cycle_count_rule.py index 5f033ae07..59e80a6a3 100644 --- a/stock_cycle_count/models/stock_cycle_count_rule.py +++ b/stock_cycle_count/models/stock_cycle_count_rule.py @@ -4,7 +4,6 @@ from odoo import api, fields, models, _ from odoo.exceptions import UserError, ValidationError -from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT from datetime import timedelta, datetime @@ -142,7 +141,7 @@ class StockCycleCountRule(models.Model): @api.model def _propose_cycle_count(self, date, location): cycle_count = { - 'date': date.strftime(DEFAULT_SERVER_DATETIME_FORMAT), + 'date': fields.Datetime.from_string(date), 'location': location, 'rule_type': self } @@ -160,10 +159,8 @@ class StockCycleCountRule(models.Model): try: period = self.periodic_count_period / \ self.periodic_qty_per_period - next_date = datetime.strptime( - latest_inventory_date, - DEFAULT_SERVER_DATETIME_FORMAT) + timedelta( - days=period) + next_date = fields.Datetime.from_string( + latest_inventory_date) + timedelta(days=period) if next_date < datetime.today(): next_date = datetime.today() except Exception as e: diff --git a/stock_cycle_count/models/stock_inventory.py b/stock_cycle_count/models/stock_inventory.py index 32595eb36..de84d1907 100644 --- a/stock_cycle_count/models/stock_inventory.py +++ b/stock_cycle_count/models/stock_inventory.py @@ -40,8 +40,8 @@ class StockInventory(models.Model): return True @api.multi - def action_done(self): - res = super(StockInventory, self).action_done() + def action_validate(self): + res = super(StockInventory, self).action_validate() self._update_cycle_state() return res diff --git a/stock_cycle_count/models/stock_warehouse.py b/stock_cycle_count/models/stock_warehouse.py index 98962a847..ef1a5c23d 100644 --- a/stock_cycle_count/models/stock_warehouse.py +++ b/stock_cycle_count/models/stock_warehouse.py @@ -3,7 +3,6 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import api, fields, models -from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT from datetime import datetime, timedelta import logging @@ -40,8 +39,7 @@ class StockWarehouse(models.Model): @api.model def _get_cycle_count_locations_search_domain( self, parent): - domain = [('parent_left', '>=', parent.parent_left), - ('parent_right', '<=', parent.parent_right), + domain = [('parent_path', '=like', parent.parent_path + '%'), ('cycle_count_disabled', '=', False)] return domain @@ -104,19 +102,22 @@ class StockWarehouse(models.Model): if existing_cycle_counts: existing_earliest_date = sorted( existing_cycle_counts.mapped('date_deadline'))[0] - if (cycle_count_proposed['date'] < + existing_earliest_date = fields.Date.from_string( + existing_earliest_date) + cycle_count_proposed_date = fields.Date.from_string( + cycle_count_proposed['date']) + if (cycle_count_proposed_date < existing_earliest_date): cc_to_update = existing_cycle_counts.search([ ('date_deadline', '=', existing_earliest_date) ]) cc_to_update.write({ - 'date_deadline': cycle_count_proposed['date'], + 'date_deadline': cycle_count_proposed_date, 'cycle_count_rule_id': cycle_count_proposed[ 'rule_type'].id, }) - delta = datetime.strptime( - cycle_count_proposed['date'], - DEFAULT_SERVER_DATETIME_FORMAT) - datetime.today() + delta = (fields.Datetime.from_string( + cycle_count_proposed['date']) - datetime.today()) if not existing_cycle_counts and \ delta.days < rec.cycle_count_planning_horizon: cc_vals = self._prepare_cycle_count( diff --git a/stock_cycle_count/readme/CONTRIBUTORS.rst b/stock_cycle_count/readme/CONTRIBUTORS.rst index f06dd5c05..18282827f 100644 --- a/stock_cycle_count/readme/CONTRIBUTORS.rst +++ b/stock_cycle_count/readme/CONTRIBUTORS.rst @@ -1,2 +1,3 @@ * Lois Rilo * Jordi Ballester Alomar +* Bhavesh Odedra diff --git a/stock_cycle_count/readme/HISTORY.rst b/stock_cycle_count/readme/HISTORY.rst index 1567f6502..7ea18b3f3 100644 --- a/stock_cycle_count/readme/HISTORY.rst +++ b/stock_cycle_count/readme/HISTORY.rst @@ -1,3 +1,9 @@ +12.0.1.0.0 (2019-06-24) +~~~~~~~~~~~~~~~~~~~~~~~ + +* [MIG] Migrated to v12. + + 11.0.1.0.0 (2018-09-19) ~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/stock_cycle_count/reports/report_stock_location_accuracy.py b/stock_cycle_count/reports/report_stock_location_accuracy.py index eee3cacf4..3d9e38738 100644 --- a/stock_cycle_count/reports/report_stock_location_accuracy.py +++ b/stock_cycle_count/reports/report_stock_location_accuracy.py @@ -7,6 +7,7 @@ from odoo import api, models class LocationAccuracyReport(models.AbstractModel): _name = "report.stock_location_accuracy" + _description = "Location Accuracy Report" @api.model def _get_inventory_domain(self, loc_id, exclude_sublocation=True): diff --git a/stock_cycle_count/reports/stock_cycle_count_report.xml b/stock_cycle_count/reports/stock_cycle_count_report.xml index 9c1db2ac5..54bfb5eb9 100644 --- a/stock_cycle_count/reports/stock_cycle_count_report.xml +++ b/stock_cycle_count/reports/stock_cycle_count_report.xml @@ -5,8 +5,8 @@