Skip to content

Commit

Permalink
[MIG] stock_barcodes: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
FranzPoize committed Mar 27, 2024
1 parent cf55c19 commit 5afdd8a
Show file tree
Hide file tree
Showing 37 changed files with 1,125 additions and 1,229 deletions.
12 changes: 6 additions & 6 deletions stock_barcodes/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Stock Barcodes
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:525a93165bdee89662d7cde6315ac154e43ad2bb1db6fd2b6c4f72847a16ac6d
!! source digest: sha256:cc8a4769a4d49396466d2fe0d4ee151e77ecf646a27d11a3700c9bb5c1855b1f
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand All @@ -17,13 +17,13 @@ Stock Barcodes
: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--barcode-lightgray.png?logo=github
:target: https://github.com/OCA/stock-logistics-barcode/tree/15.0/stock_barcodes
:target: https://github.com/OCA/stock-logistics-barcode/tree/16.0/stock_barcodes
:alt: OCA/stock-logistics-barcode
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/stock-logistics-barcode-15-0/stock-logistics-barcode-15-0-stock_barcodes
:target: https://translation.odoo-community.org/projects/stock-logistics-barcode-16-0/stock-logistics-barcode-16-0-stock_barcodes
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-barcode&target_branch=15.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-barcode&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -159,7 +159,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-barcode/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/stock-logistics-barcode/issues/new?body=module:%20stock_barcodes%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/stock-logistics-barcode/issues/new?body=module:%20stock_barcodes%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Expand Down Expand Up @@ -209,6 +209,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.

This module is part of the `OCA/stock-logistics-barcode <https://github.com/OCA/stock-logistics-barcode/tree/15.0/stock_barcodes>`_ project on GitHub.
This module is part of the `OCA/stock-logistics-barcode <https://github.com/OCA/stock-logistics-barcode/tree/16.0/stock_barcodes>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
21 changes: 12 additions & 9 deletions stock_barcodes/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
{
"name": "Stock Barcodes",
"summary": "It provides read barcode on stock operations.",
"version": "15.0.2.0.0",
"version": "16.0.1.0.0",
"author": "Tecnativa, " "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/stock-logistics-barcode",
"license": "AGPL-3",
"category": "Extra Tools",
"depends": ["barcodes", "stock", "web_widget_numeric_step"],
"depends": ["barcodes", "stock", "web_widget_numeric_step", "web"],
"data": [
"security/ir.model.access.csv",
"views/stock_barcodes_action_view.xml",
Expand All @@ -27,13 +27,16 @@
],
"assets": {
"web.assets_backend": [
"/stock_barcodes/static/src/js/barcodes_models_mixin.js",
"/stock_barcodes/static/src/js/basic_controller.js",
"/stock_barcodes/static/src/js/kanban_renderer.js",
"/stock_barcodes/static/src/js/basic_fields.js",
"/stock_barcodes/static/src/js/form_view.js",
"/stock_barcodes/static/src/js/numeric_step.js",
"/stock_barcodes/static/src/css/stock.scss",
"/stock_barcodes/static/src/barcodes_models_utils.esm.js",
"/stock_barcodes/static/src/kanban_renderer.esm.js",
"/stock_barcodes/static/src/boolean_toggle.esm.js",
"/stock_barcodes/static/src/views.esm.js",
"/stock_barcodes/static/src/form_view.esm.js",
"/stock_barcodes/static/src/numeric_step.esm.js",
"/stock_barcodes/static/src/view_button.esm.js",
"/stock_barcodes/static/src/view_compiler.esm.js",
"/stock_barcodes/static/src/view_button.xml",
"/stock_barcodes/static/src/stock.scss",
],
},
"installable": True,
Expand Down
14 changes: 0 additions & 14 deletions stock_barcodes/migrations/15.0.1.0.0/pre-migration.py

This file was deleted.

2 changes: 1 addition & 1 deletion stock_barcodes/models/stock_barcodes_read_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class StockBarcodesReadLog(models.Model):
res_model_id = fields.Many2one(comodel_name="ir.model", index=True)
res_id = fields.Integer(index=True)
product_id = fields.Many2one(comodel_name="product.product", index=True)
lot_id = fields.Many2one(comodel_name="stock.production.lot", string="Lot scanned")
lot_id = fields.Many2one(comodel_name="stock.lot", string="Lot scanned")
location_id = fields.Many2one(comodel_name="stock.location")
packaging_id = fields.Many2one(comodel_name="product.packaging")
packaging_qty = fields.Float(string="Package Qty", digits="Product Unit of Measure")
Expand Down
4 changes: 2 additions & 2 deletions stock_barcodes/models/stock_move_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ class StockMoveLine(models.Model):
store=True,
)

@api.depends("qty_done", "product_uom_qty")
@api.depends("qty_done", "reserved_uom_qty")
def _compute_barcode_scan_state(self):
for line in self:
if line.qty_done >= line.product_uom_qty:
if line.qty_done >= line.reserved_uom_qty:
line.barcode_scan_state = "done"

Check warning on line 22 in stock_barcodes/models/stock_move_line.py

View check run for this annotation

Codecov / codecov/patch

stock_barcodes/models/stock_move_line.py#L22

Added line #L22 was not covered by tests
else:
line.barcode_scan_state = "pending"

Check warning on line 24 in stock_barcodes/models/stock_move_line.py

View check run for this annotation

Codecov / codecov/patch

stock_barcodes/models/stock_move_line.py#L24

Added line #L24 was not covered by tests
Expand Down
8 changes: 4 additions & 4 deletions stock_barcodes/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,9 @@ <h1 class="title">Stock Barcodes</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:525a93165bdee89662d7cde6315ac154e43ad2bb1db6fd2b6c4f72847a16ac6d
!! source digest: sha256:cc8a4769a4d49396466d2fe0d4ee151e77ecf646a27d11a3700c9bb5c1855b1f
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/stock-logistics-barcode/tree/15.0/stock_barcodes"><img alt="OCA/stock-logistics-barcode" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--barcode-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/stock-logistics-barcode-15-0/stock-logistics-barcode-15-0-stock_barcodes"><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/stock-logistics-barcode&amp;target_branch=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<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/stock-logistics-barcode/tree/16.0/stock_barcodes"><img alt="OCA/stock-logistics-barcode" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--barcode-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/stock-logistics-barcode-16-0/stock-logistics-barcode-16-0-stock_barcodes"><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/stock-logistics-barcode&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module provides a barcode reader interface for stock module.</p>
<p>This module contains a base wizard read barcode that can be extended by
other modules.</p>
Expand Down Expand Up @@ -518,7 +518,7 @@ <h1><a class="toc-backref" href="#toc-entry-12">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/stock-logistics-barcode/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/stock-logistics-barcode/issues/new?body=module:%20stock_barcodes%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/stock-logistics-barcode/issues/new?body=module:%20stock_barcodes%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand Down Expand Up @@ -561,7 +561,7 @@ <h2><a class="toc-backref" href="#toc-entry-16">Maintainers</a></h2>
<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>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-barcode/tree/15.0/stock_barcodes">OCA/stock-logistics-barcode</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-barcode/tree/16.0/stock_barcodes">OCA/stock-logistics-barcode</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>
</div>
Expand Down
19 changes: 19 additions & 0 deletions stock_barcodes/static/src/barcodes_models_utils.esm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/** @odoo-module */
/* Copyright 2022 Tecnativa - Alexandre D. Díaz
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */

const barcodeModels = [
"stock.barcodes.action",
"stock.picking",
"stock.picking.type",
"wiz.candidate.picking",
"wiz.stock.barcodes.new.lot",
"wiz.stock.barcodes.read",
"wiz.stock.barcodes.read.inventory",
"wiz.stock.barcodes.read.picking",
"wiz.stock.barcodes.read.todo",
];

export function isAllowedBarcodeModel(modelName) {
return barcodeModels.indexOf(modelName) !== -1;
}
17 changes: 17 additions & 0 deletions stock_barcodes/static/src/boolean_toggle.esm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/** @odoo-module */
/* Copyright 2018-2019 Sergio Teruel <sergio.teruel@tecnativa.com>.
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */

import {BooleanToggleField} from "@web/views/fields/boolean_toggle/boolean_toggle_field";
import {registry} from "@web/core/registry";

class BarcodeBooleanToggleField extends BooleanToggleField {
onChange(newValue) {
super.onChange(newValue);
requestIdleCallback(() => {
document.activeElement.blur();
});
}
}

registry.category("fields").add("barcode_boolean_toggle", BarcodeBooleanToggleField);
15 changes: 15 additions & 0 deletions stock_barcodes/static/src/form_view.esm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/** @odoo-module */
/* Copyright 2021 Tecnativa - Alexandre D. Díaz
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */

import {FormController} from "@web/views/form/form_controller";
import {patch} from "@web/core/utils/patch";

patch(FormController.prototype, "Allow display.controlPanel overriding", {
setup() {
this._super(...arguments);
if (this.props.context.control_panel_hidden) {
this.display.controlPanel = false;
}
},
});
34 changes: 0 additions & 34 deletions stock_barcodes/static/src/js/barcodes_models_mixin.js

This file was deleted.

Loading

0 comments on commit 5afdd8a

Please sign in to comment.