Skip to content

Commit

Permalink
[MIG] barcodes_generator_location: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Tisho99 committed Feb 12, 2025
1 parent 535517c commit 4457f74
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion barcodes_generator_location/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Generate Barcodes for Stock Locations",
"version": "16.0.1.0.0",
"version": "17.0.1.0.0",
"category": "Tools",
"author": "LasLabs, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/stock-logistics-barcode",
Expand Down
4 changes: 2 additions & 2 deletions barcodes_generator_location/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).


def uninstall_hook(cr, registry):
def uninstall_hook(env):
"""Delete barcode rules with generate model `stock.location` as they
won't be useful anymore"""
cr.execute(
env.cr.execute(

Check warning on line 8 in barcodes_generator_location/hooks.py

View check run for this annotation

Codecov / codecov/patch

barcodes_generator_location/hooks.py#L8

Added line #L8 was not covered by tests
"""
DELETE FROM barcode_rule
WHERE generate_model = 'stock.location'
Expand Down
16 changes: 4 additions & 12 deletions barcodes_generator_location/views/stock_location.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,22 @@
<field name="generate_type" invisible="1" />
<field
name="barcode_base"
attrs="{
'invisible': [('barcode_rule_id', '=', False)],
'readonly': [('generate_type', '!=', 'manual')],
}"
invisible="not barcode_rule_id"
readonly="generate_type != 'manual'"
groups="barcodes_generator_abstract.generate_barcode"
/>
<button
name="generate_base"
type="object"
string="Generate Base (Using Sequence)"
attrs="{'invisible': ['|',
('generate_type', '!=', 'sequence'),
('barcode_base', '!=', 0),
]}"
invisible="generate_type != 'sequence' or barcode_base"
groups="barcodes_generator_abstract.generate_barcode"
/>
<button
name="generate_barcode"
type="object"
string="Generate Barcode"
attrs="{'invisible': ['|',
('barcode_rule_id', '=', False),
('barcode_base', '=', 0),
]}"
invisible="not barcode_rule_id or not barcode_base"
groups="barcodes_generator_abstract.generate_barcode"
colspan="2"
/>
Expand Down

0 comments on commit 4457f74

Please sign in to comment.