Skip to content

Commit

Permalink
[MIG] repair_type_sequence: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
miquelalzanillas committed May 30, 2024
1 parent 9908218 commit 9e50a0e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion repair_type_sequence/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"summary": """
Adds sequence to repair orders defined in the repairs's
type""",
"version": "16.0.1.0.0",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"author": "ForgeFlow S.L.," "Odoo Community Association (OCA)",
"maintainers": ["AaronHForgeFlow"],
Expand Down
2 changes: 1 addition & 1 deletion repair_type_sequence/models/repair_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class RepairOrder(models.Model):

@api.model
def create(self, vals):
rorder = super(RepairOrder, self).create(vals)
rorder = super().create(vals)
if rorder.repair_type_id:
sequence_id = (
self.env["repair.type"].browse(vals["repair_type_id"]).sequence_id
Expand Down
4 changes: 2 additions & 2 deletions repair_type_sequence/models/repair_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def create(self, vals):
vals["sequence_prefix"] = (
self.env["ir.sequence"].browse(vals["sequence_id"]).prefix
)
result = super(RepairType, self).create(vals)
result = super().create(vals)
self._compute_rorder_code()
return result

Expand All @@ -84,7 +84,7 @@ def write(self, vals):
vals["sequence_prefix"] = (
self.env["ir.sequence"].browse(vals["sequence_id"]).prefix
)
result = super(RepairType, self).write(vals)
result = super().write(vals)
self._compute_rorder_code()
return result

Expand Down
2 changes: 1 addition & 1 deletion repair_type_sequence/tests/test_repair_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class TestRepairType(TransactionCase):
def setUp(self, *args, **kwargs):
super(TestRepairType, self).setUp(*args, **kwargs)
super().setUp(*args, **kwargs)

# add repair model
self.repair_model = self.env["repair.order"]
Expand Down
8 changes: 3 additions & 5 deletions repair_type_sequence/views/repair_type_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@
<field name="arch" type="xml">
<xpath expr="//sheet" position="inside">
<group>
<field
name="sequence_prefix"
attrs="{'readonly': [('sequence_id', '!=', False)]}"
/>
<field name="sequence_prefix" readonly="sequence_id" />
<field
name="sequence_number_next"
style="padding-right: 1.0em"
attrs="{'readonly': [('sequence_id', '!=', False)], 'invisible': [('sequence_prefix', '=', False)]}"
readonly="sequence_id"
invisible="not sequence_prefix"
/>
<field name="sequence_id" required="0" />
</group>
Expand Down

0 comments on commit 9e50a0e

Please sign in to comment.