Skip to content
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

Open
wants to merge 1 commit into
base: 9.0
Choose a base branch
from

Conversation

aduijs
Copy link

@aduijs aduijs commented Dec 10, 2015

No description provided.

@aduijs aduijs changed the title Updated to be compatible with 9.0 [FIX] Updated to be compatible with 9.0 Dec 10, 2015
@aduijs aduijs changed the title [FIX] Updated to be compatible with 9.0 [FIX] product_variants_no_automatic_creation: Updated to be compatible with 9.0 Dec 10, 2015
@aduijs aduijs changed the title [FIX] product_variants_no_automatic_creation: Updated to be compatible with 9.0 [FIX] product_variants_no_automatic_creation: Updated for Odoo 9.0 Dec 10, 2015
@@ -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">
Copy link
Member

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.

Copy link
Author

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.

Copy link
Member

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

Copy link
Author

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.

Copy link
Member

Choose a reason for hiding this comment

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

That's it

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

Successfully merging this pull request may close these issues.

3 participants