-
Notifications
You must be signed in to change notification settings - Fork 247
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
[FIX] product_variants_no_automatic_creation: Updated for Odoo 9.0 #1098
base: 9.0
Are you sure you want to change the base?
Conversation
@@ -17,18 +17,54 @@ | |||
<field name="model">product.template</field> | |||
<field name="inherit_id" ref="product.product_template_only_form_view" /> | |||
<field name="arch" type="xml"> | |||
<button string="Variant Prices" position="attributes"> | |||
<xpath expr="//button[@name='103']" position="attributes"> |
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.
This number won't work in other database. You have to use the same expression as in original.
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.
Its not a number, its a string.. and the name of the button.
According the view (product.template.common.form) 103 is its name
So instead of looking up the text string "Variant Prices" its looking for
the name of the button
[image: Inline afbeelding 1]
and works just fine.
Its hiding the original variant prices button and adds the new one
[image: Inline afbeelding 2]
2015-12-12 7:36 GMT-05:00 Pedro M. Baeza [email protected]:
In product_variants_no_automatic_creation/views/product_view.xml
#1098 (comment):@@ -17,18 +17,54 @@
product.template
<button string="Variant Prices" position="attributes">
<xpath expr="//button[@name='103']" position="attributes">
This number won't work in any database. You have to use the same
expression as in original.—
Reply to this email directly or view it on GitHub
https://github.com/odoomrp/odoomrp-wip/pull/1098/files#r47431254.
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.
But this is because it's replaced in execution time by its current XML-ID. Here you can see the correct expression: https://github.com/odoo/odoo/blob/9.0/addons/product/product_view.xml#L77
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.
Ok so if i understand right, these IDs are generated upon installation and
can vary per install.
so the 103 name is the name from my current install and therefore working
as intended.
And for that it was looking for the text string
2015-12-14 12:51 GMT-05:00 Pedro M. Baeza [email protected]:
In product_variants_no_automatic_creation/views/product_view.xml
#1098 (comment):@@ -17,18 +17,54 @@
product.template
<button string="Variant Prices" position="attributes">
<xpath expr="//button[@name='103']" position="attributes">
But this is because it's replaced in execution time by its current XML-ID.
Here you can see the correct expression:
https://github.com/odoo/odoo/blob/9.0/addons/product/product_view.xml#L77—
Reply to this email directly or view it on GitHub
https://github.com/odoomrp/odoomrp-wip/pull/1098/files#r47531221.
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.
That's it
No description provided.