mirror of
https://github.com/OCA/server-backend.git
synced 2025-02-18 09:52:42 +02:00
[MIG] server_action_navigate: Migration to 14.0
This commit is contained in:
committed by
Sylvain LE GAL
parent
f621f447ed
commit
6fa280add9
@@ -22,19 +22,21 @@ class IrActionsServerNavigateLine(models.Model):
|
||||
)
|
||||
|
||||
field_id = fields.Many2one(
|
||||
comodel_name="ir.model.fields", string="Field", required=True
|
||||
comodel_name="ir.model.fields",
|
||||
string="Field",
|
||||
required=True,
|
||||
ondelete="cascade",
|
||||
)
|
||||
|
||||
# when adding a record, onchange is called for every field on the
|
||||
# form, also in editable list views
|
||||
@api.onchange("field_id")
|
||||
def _onchange_field_id(self):
|
||||
# check out the docstring of this in odoo/models.py
|
||||
lines = self.action_id.resolve_2many_commands(
|
||||
"navigate_line_ids",
|
||||
self.env.context.get("navigate_line_ids", []),
|
||||
)
|
||||
lines = sum(map(self.new, lines), self.browse([]))
|
||||
|
||||
lines = self.action_id.new(
|
||||
{"navigate_line_ids": self.env.context.get("navigate_line_ids", [])}
|
||||
).navigate_line_ids
|
||||
|
||||
model = lines[-1:].field_id.relation or self.action_id.model_id.model
|
||||
return {
|
||||
"domain": {
|
||||
|
||||
Reference in New Issue
Block a user