-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
11.0 mig mass editing #1048
11.0 mig mass editing #1048
Conversation
…w when we define it, is why that I remove the tag type in the view to avoid that server shows us a warning
Fixes OCA#15 Check that `domain[2]` is `str` because in some cases it's an `int` and `list` operations don't work on `int`s.
This resulted in frontend searching for ` tree` view, which of course does not exist.
Without this patch, if you created a mass editing definition that included a *2many object and then opened the wizard, you got this exception: Uncaught TypeError: Cannot read property 'list' of undefined http://localhost/web/static/src/js/views/form_view.js:488 Traceback: TypeError: Cannot read property 'list' of undefined at http://localhost/web/static/src/js/views/form_view.js:488:30 at Function._.each._.forEach (http://localhost/web/static/lib/underscore/underscore.js:150:9) at http://localhost/web/static/src/js/views/form_view.js:486:19 at Function._.each._.forEach (http://localhost/web/static/lib/underscore/underscore.js:150:9) at Class._build_onchange_specs (http://localhost/web/static/src/js/views/form_view.js:473:11) at Class.do_onchange (http://localhost/web/static/src/js/views/form_view.js:523:18) at Array.<anonymous> (http://localhost/web/static/src/js/views/form_view.js:377:26) at fire (http://localhost/web/static/lib/jquery/jquery.js:3119:58) at Object.fireWith [as resolveWith] (http://localhost/web/static/lib/jquery/jquery.js:3231:49) at Object.<anonymous> (http://localhost/web/static/lib/jquery/jquery.js:3360:58)
* Made Mass Editing module v10 compatible * Mass Editing module v10 translations * Update ir_model_fields.py * [FIX] mass_editing v10 port openerp->odoo * [FIX] pep8 * [FIX] remove no-longer supported auto_refresh in view
* [FIX] View * [FIX] viewing in community
Without this fix, it is impossible to uninstall an addon that removes a model for which we had a `mass.object`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain why are you removing all things related to ir.values
?
Also, squash all translation-related commits together and fix Travis please.
mass_editing/__manifest__.py
Outdated
'author': 'Serpent Consulting Services Pvt. Ltd., ' | ||
'Tecnativa, ' | ||
'Odoo Community Association (OCA)', | ||
'contributors': [ | ||
'Oihane Crucelaegui <oihanecrucelaegi@gmail.com>', | ||
'Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com>', | ||
'Jay Vora <jay.vora@serpentcs.com>' | ||
'Jay Vora <jay.vora@serpentcs.com>', | ||
'Juan Negrete <jnegrete@casasalce.com>' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Contributors nowadays go into README, this part can be dropped from here.
mass_editing/hooks.py
Outdated
@@ -7,6 +6,5 @@ def uninstall_hook(cr, registry): | |||
cr.execute("""SELECT id FROM ir_act_window | |||
WHERE res_model = 'mass.editing.wizard'""") | |||
for res in cr.dictfetchall(): | |||
value = 'ir.actions.act_window,%s' % res.get('id') | |||
cr.execute("DELETE FROM ir_values WHERE value = %s", (value, )) | |||
cr.execute("DELETE FROM ir_act_window WHERE id = '%s'" % res.get('id')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Is this needed? Doesn't Odoo by itself automatically remove tables when an addon is uninstalled?
- Yes: Add a docstring on why.
- No: remove it.
- This query is a little bit.... well, not KISS. Just
DELETE FROM ir_act_window WHERE res_model = 'mass.editing.wizard'
and you're done
@@ -238,7 +238,7 @@ def create(self, vals): | |||
self._context.get('active_ids')): | |||
model_obj = self.env[self._context.get('active_model')] | |||
values = {} | |||
for key, val in vals.items(): | |||
for key, val in list(vals.items()): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
@@ -208,7 +208,7 @@ def fields_view_get(self, view_id=None, view_type='form', toolbar=False, | |||
'colspan': '4', | |||
}) | |||
# Patch fields with required extra data | |||
for field in all_fields.values(): | |||
for field in list(all_fields.values()): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
Hello Jairo,
ir.values doesn't exist in odoo v11.0
I add the query and remove list, they were added by 2to3 -wnj4 --no-diffs
Regards.
2017-11-13 3:50 GMT-06:00 Jairo Llopis <notifications@github.com>:
… ***@***.**** requested changes on this pull request.
Could you explain why are you removing all things related to ir.values?
------------------------------
In mass_editing/__manifest__.py
<#1048 (comment)>:
> 'author': 'Serpent Consulting Services Pvt. Ltd., '
'Tecnativa, '
'Odoo Community Association (OCA)',
'contributors': [
'Oihane Crucelaegui ***@***.***>',
'Serpent Consulting Services Pvt. Ltd. ***@***.***>',
- 'Jay Vora ***@***.***>'
+ 'Jay Vora ***@***.***>',
+ 'Juan Negrete ***@***.***>'
Contributors nowadays go into README, this part can be dropped from here.
------------------------------
In mass_editing/hooks.py
<#1048 (comment)>:
> @@ -7,6 +6,5 @@ def uninstall_hook(cr, registry):
cr.execute("""SELECT id FROM ir_act_window
WHERE res_model = 'mass.editing.wizard'""")
for res in cr.dictfetchall():
- value = 'ir.actions.act_window,%s' % res.get('id')
- cr.execute("DELETE FROM ir_values WHERE value = %s", (value, ))
+ cr.execute("DELETE FROM ir_act_window WHERE id = '%s'" % res.get('id'))
1. Is this needed? Doesn't Odoo by itself automatically remove tables
when an addon is uninstalled?
- Yes: Add a docstring on why.
- No: remove it.
2. This query is a little bit.... well, not KISS. Just DELETE FROM
ir_act_window WHERE res_model = 'mass.editing.wizard' and you're done
------------------------------
In mass_editing/wizard/mass_editing_wizard.py
<#1048 (comment)>:
> @@ -238,7 +238,7 @@ def create(self, vals):
self._context.get('active_ids')):
model_obj = self.env[self._context.get('active_model')]
values = {}
- for key, val in vals.items():
+ for key, val in list(vals.items()):
why?
------------------------------
In mass_editing/wizard/mass_editing_wizard.py
<#1048 (comment)>:
> @@ -208,7 +208,7 @@ def fields_view_get(self, view_id=None, view_type='form', toolbar=False,
'colspan': '4',
})
# Patch fields with required extra data
- for field in all_fields.values():
+ for field in list(all_fields.values()):
why?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1048 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEhl6q3ymb_wyDkzn7LuvA6DCnbKJhK6ks5s2BD5gaJpZM4QaljY>
.
|
mass_editing/__manifest__.py
Outdated
@@ -9,8 +9,7 @@ | |||
'contributors': [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the key and move contributors to README
I ran a functional test everything worked fine untill I tried to edit some values:
|
Hi Cas Vissers,
Encontré un problema con los campos computados (like standard_price), puede
ser tu caso, prueba con el nuevo cambio
2017-11-15 6:42 GMT-06:00 Cas Vissers <notifications@github.com>:
… I ran a functional test everything worked fine untill I tried to edit some
values:
`Fout:
TypeError: val is null
https://vitamineenzo.odoo.com/web/content/960-ac050f6/web.
assets_backend.js:1245
Traceback:
***@***.***://vitamineenzo.odoo.com/web/
content/960-ac050f6/web.assets_backend.js:1245:545
***@***.***://vitamineenzo.odoo.com/web/content/906-d57f445/web.
assets_common.js:12:558
***@***.***://vitamineenzo.odoo.com/web/
content/960-ac050f6/web.assets_backend.js:1245:288
***@***.***://vitamineenzo.odoo.com/web/content/960-ac050f6/web.
assets_backend.js:1185:81
***@***.***://vitamineenzo.odoo.com/web/content/906-d57f445/web.
assets_common.js:802:678
***@***.***://vitamineenzo.odoo.com/web/content/906-
d57f445/web.assets_common.js:796:281
***@***.***://vitamineenzo.odoo.com/web/content/906-
d57f445/web.assets_common.js:801:198
***@***.***://vitamineenzo.odoo.com/web/content/906-d57f445/web.
assets_common.js:802:849
***@***.***://vitamineenzo.odoo.com/web/content/906-
d57f445/web.assets_common.js:796:281
***@***.***://vitamineenzo.odoo.com/web/content/906-
d57f445/web.assets_common.js:801:198
***@***.***://vitamineenzo.odoo.com/
web/content/906-d57f445/web.assets_common.js:803:31
***@***.***://vitamineenzo.odoo.com/web/content/906-
d57f445/web.assets_common.js:3858:346
***@***.***://vitamineenzo.odoo.com/web/content/906-d57f445/web.
assets_common.js:802:678
***@***.***://vitamineenzo.odoo.com/web/content/906-
d57f445/web.assets_common.js:796:281
***@***.***://vitamineenzo.odoo.com/web/content/906-
d57f445/web.assets_common.js:801:198
***@***.***://vitamineenzo.odoo.com/
web/content/906-d57f445/web.assets_common.js:803:31
***@***.***://vitamineenzo.odoo.com/web/content/906-
d57f445/web.assets_common.js:796:281
***@***.***://vitamineenzo.odoo.com/web/content/906-
d57f445/web.assets_common.js:801:198
***@***.***://vitamineenzo.odoo.com/web/content/906-d57f445/web.
assets_common.js:802:849
***@***.***://vitamineenzo.odoo.com/web/content/906-
d57f445/web.assets_common.js:796:281
***@***.***://vitamineenzo.odoo.com/web/content/906-
d57f445/web.assets_common.js:801:198
***@***.***://vitamineenzo.odoo.com/web/content/906-d57f445/web.
assets_common.js:802:849
***@***.***://vitamineenzo.odoo.com/web/content/906-
d57f445/web.assets_common.js:796:281
***@***.***://vitamineenzo.odoo.com/web/content/906-
d57f445/web.assets_common.js:801:198
***@***.***://vitamineenzo.odoo.com/web/content/906-
d57f445/web.assets_common.js:1192:86
***@***.***://vitamineenzo.odoo.com/web/content/906-
d57f445/web.assets_common.js:1212:15`
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1048 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEhl6tZh8yPnz1ZLYeHVspfnH3bvN1Eaks5s2twlgaJpZM4QaljY>
.
|
Please remove cd3c87e, it was better before. If any computed method fails with that, it should be fixed in the computed method, not there. OTOH, @CasVissers' logs are JS logs, not Python logs, so there's a high chance that the problem is in the client side. As always, those logs are not in |
cd3c87e
to
e33e285
Compare
Shoudn't this be moved to https://github.com/OCA/server-ux/ as per https://docs.google.com/spreadsheets/d/1Xg95cW4TFMf_Lo5i_CZC_qOOfN8RgxPRc0LJTLTkdUI/edit?usp=sharing ( From issue #1008 ) |
Yeah! |
True, closing. Reopen there please. |
No description provided.