Skip to content

[18.0][MIG] chained_swapper: Migration to version 18.0 #1123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 16 commits into
base: 18.0
Choose a base branch
from

Conversation

juancarlosonate-tecnativa

@pedrobaeza
Copy link
Member

/ocabot migration chained_swapper

@OCA-git-bot OCA-git-bot added this to the 18.0 milestone Jul 11, 2025
@OCA-git-bot OCA-git-bot mentioned this pull request Jul 11, 2025
25 tasks
Copy link

@carlos-lopez-tecnativa carlos-lopez-tecnativa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created a record like this:
image
When I try to select a record:
image

I get this error. Please review:
image

Comment on lines 22 to 24
allowed_field_ids = fields.Many2many(
comodel_name="ir.model.fields", compute="_compute_allowed_field_ids"
)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't understand the point of this

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! Can you check if it's correct? Thanks!

@juancarlosonate-tecnativa juancarlosonate-tecnativa force-pushed the 18.0-mig-chained_swapper branch 2 times, most recently from 07cba65 to 4d75eca Compare July 16, 2025 14:31
Copy link

@carlos-lopez-tecnativa carlos-lopez-tecnativa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I left a few comments that I think could help improve the UI/UX. If you have any questions, feel free to let me know.

@pedrobaeza could this be improved in this PR, What do you think?

Comment on lines +165 to +172
body = Markup(
self.env._("<b>Chained swap done</b>:<br/>%(field)s: %(old)s ⇒ %(new)s")
) % {
"field": field_desc,
"old": original_value,
"new": new_value,
}
m.message_post(body=body)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
body = Markup(
self.env._("<b>Chained swap done</b>:<br/>%(field)s: %(old)s ⇒ %(new)s")
) % {
"field": field_desc,
"old": original_value,
"new": new_value,
}
m.message_post(body=body)
body = Markup(
self.env._("<b>Chained swap done</b>:<br/>%(field)s: %(old)s ⇒ %(new)s",
field=field_desc,
old=original_value,
new=new_value,
)
}
m.message_post(body=body)

<field name="model">chained.swapper.sub.field</field>
<field name="arch" type="xml">
<list editable="bottom">
<field name="sub_field_chain" />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This way of selecting the field is anti-ergonomic. Could you please use the DynamicModelFieldSelectorChar widget?
An example can be found in server actions when using Update Records. This widget allows navigating through all fields and is more user-friendly.

https://github.com/odoo/odoo/blob/de9e1f3fd22da68dc7784896fe48b7fda49c9b0a/odoo/addons/base/views/ir_actions_views.xml#L344

image

Comment on lines +56 to +58
<page string="Constraints">
<field name="constraint_ids" nolabel="1" />
</page>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you improve the help message to explain all the available variables?
Something similar to what is shown in Server Actions when using the Execute Code option.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.