Skip to content

Commit 4457f74

Browse files
committed
[MIG] barcodes_generator_location: Migration to 17.0
1 parent 535517c commit 4457f74

File tree

3 files changed

+7
-15
lines changed

3 files changed

+7
-15
lines changed

barcodes_generator_location/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
33
{
44
"name": "Generate Barcodes for Stock Locations",
5-
"version": "16.0.1.0.0",
5+
"version": "17.0.1.0.0",
66
"category": "Tools",
77
"author": "LasLabs, Odoo Community Association (OCA)",
88
"website": "https://github.com/OCA/stock-logistics-barcode",

barcodes_generator_location/hooks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
33

44

5-
def uninstall_hook(cr, registry):
5+
def uninstall_hook(env):
66
"""Delete barcode rules with generate model `stock.location` as they
77
won't be useful anymore"""
8-
cr.execute(
8+
env.cr.execute(
99
"""
1010
DELETE FROM barcode_rule
1111
WHERE generate_model = 'stock.location'

barcodes_generator_location/views/stock_location.xml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,22 @@
2222
<field name="generate_type" invisible="1" />
2323
<field
2424
name="barcode_base"
25-
attrs="{
26-
'invisible': [('barcode_rule_id', '=', False)],
27-
'readonly': [('generate_type', '!=', 'manual')],
28-
}"
25+
invisible="not barcode_rule_id"
26+
readonly="generate_type != 'manual'"
2927
groups="barcodes_generator_abstract.generate_barcode"
3028
/>
3129
<button
3230
name="generate_base"
3331
type="object"
3432
string="Generate Base (Using Sequence)"
35-
attrs="{'invisible': ['|',
36-
('generate_type', '!=', 'sequence'),
37-
('barcode_base', '!=', 0),
38-
]}"
33+
invisible="generate_type != 'sequence' or barcode_base"
3934
groups="barcodes_generator_abstract.generate_barcode"
4035
/>
4136
<button
4237
name="generate_barcode"
4338
type="object"
4439
string="Generate Barcode"
45-
attrs="{'invisible': ['|',
46-
('barcode_rule_id', '=', False),
47-
('barcode_base', '=', 0),
48-
]}"
40+
invisible="not barcode_rule_id or not barcode_base"
4941
groups="barcodes_generator_abstract.generate_barcode"
5042
colspan="2"
5143
/>

0 commit comments

Comments
 (0)