OCA / server-ux

GNU Affero General Public License v3.0
163 stars 532 forks source link

[18.0][MIG] server_action_mass_edit: Migration to 18.0 #951

Open trisdoan opened 1 month ago

pedrobaeza commented 1 month ago

/ocabot migration server_action_mass_edit

florenciafrigieri2 commented 1 month ago

@trisdoan Hi! I tested the module but it didn't worked. I created a server action to change the salesperson in the SOs, but when selecting the action within sales an error came up (I was not able to even see the wizard).

This are the last lines of the error: File "/mnt/data/odoo-addons-dir/server_action_mass_edit/wizard/mass_editing_wizard.py", line 93, in onchange dynamic_fields["selection__" + line.field_id.name] = fields.Selection( File "/opt/odoo/odoo/fields.py", line 2772, in init self._selection = dict(selection) if isinstance(selection, list) else None ValueError: dictionary update sequence element #0 has length 0; 2 is required

I leave here a print of the server action testserveraction

trisdoan commented 1 month ago

@trisdoan Hi! I tested the module but it didn't worked. I created a server action to change the salesperson in the SOs, but when selecting the action within sales an error came up (I was not able to even see the wizard).

This are the last lines of the error: File "/mnt/data/odoo-addons-dir/server_action_mass_edit/wizard/mass_editing_wizard.py", line 93, in onchange dynamic_fields["selection__" + line.field_id.name] = fields.Selection( File "/opt/odoo/odoo/fields.py", line 2772, in init self._selection = dict(selection) if isinstance(selection, list) else None ValueError: dictionary update sequence element #0 has length 0; 2 is required

I leave here a print of the server action testserveraction

Hi @florenciafrigieri2, thank you for the review

I just added a fix, could you please try again?

OCA-git-bot commented 1 month ago

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

stefsava commented 1 month ago

It seems like there is a regression. I can't bulk insert product attributes, while I could do it in 17.0.

Before it asked me to add a line, now it doesn't ask and there are multiple columns.

With 17.0 image image

With 18.0 and this PR image image

trisdoan commented 3 weeks ago

Hello @stefsava, I checked and it looks to me that the issue is not because of the module 1) I tried with different o2m fields in another model server_mass_action_edit

2) For product attribute, after https://github.com/odoo/odoo/pull/160270, there is a list view created and it has attribute create='false'. I changed to create='true' (for testing only), here's result: server_mass_action_edit_2

stefsava commented 3 weeks ago

Hello @trisdoan

your suggestion doesn't solve my use case.

If I change create='true' I can see "Add a row", but the choice doesn't lead to anything useful.

Instead I found a workaround that brings the behavior back to that of 17.0 that I think can help you understand the problem detected.

I discovered that 17.0 only has the view "product.template.attribute.line.form" while 18.0 has added "product.template.attribute.line.view.list", and for some reason that I don't understand the list view is chosen instead of the form view.

My workaround was simply to deactive the list view, although I fear it may introduce regressions elsewhere.

image

trisdoan commented 14 hours ago

DRAFT: working on failed test