Skip to content

Commit

Permalink
🚑 sync: fix reference field name
Browse files Browse the repository at this point in the history
  • Loading branch information
yelizariev committed Feb 28, 2025
1 parent 395a780 commit 87aedb5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
10 changes: 5 additions & 5 deletions sync/models/sync_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class SyncOrder(models.Model):
)
sync_job_id = fields.Many2one("sync.job")
description = fields.Html(related="sync_task_id.sync_order_description")
# DEPRECATED. Use line_ids.record_id instead
# DEPRECATED. Use line_ids.record_ref instead
record_id = fields.Reference(
string="Blackjack",
selection="_selection_record_id",
Expand Down Expand Up @@ -63,10 +63,10 @@ class SyncOrderLine(models.Model):
_name = "sync.order.line"
_description = "Sync Order Records"

sync_order_id = fields.Many2one("sync.order")
record_id = fields.Reference(
sync_order_id = fields.Many2one("sync.order", required=True)
record_ref = fields.Reference(
string="Linked Record",
selection="_selection_record_id",
selection="_selection_record_model",
help="Optional extra information to perform this task",
)
state = fields.Selection(
Expand All @@ -82,7 +82,7 @@ class SyncOrderLine(models.Model):
value = fields.Char("Extra Input")
result = fields.Char("Result")

def _selection_record_id(self):
def _selection_record_model(self):
mm = self.sync_order_id.sync_task_id.sync_order_model_id
if not mm:
return []
Expand Down
3 changes: 1 addition & 2 deletions sync/views/sync_order_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<tree>
<field name="sync_task_id" />
<field name="name" />
<field name="record_id" />
<field name="state" />
</tree>
</field>
Expand Down Expand Up @@ -66,7 +65,7 @@
<page string="Linked Records">
<field name="line_ids">
<tree editable="bottom">
<field name="record_id" />
<field name="record_ref" />
<field name="value" />
<field name="state" readonly="1" />
<field name="result" readonly="1" />
Expand Down

0 comments on commit 87aedb5

Please sign in to comment.