Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
3472 Lượt xem

I have Odoo v9 installed in CentOS7 on a remote server.  I copied the Ecommerce Catalog without price module folder to the addons folder, activated developer mode, updated module list, clicked on install that module.  I get this error posted below and if I come back to the apps that module shows up as "Installing".

Error details:Element '<xpath expr="//del[@class='text-danger mr8']">' cannot be located in parent view


Error context:View `Suggested Products Without Catalog Price`[view_id: 924, xml_id: n/a, model: n/a, parent_id: 894]None" while parsing None:23, near<data inherit_id="website_sale.cart_lines" name="Suggested Products Without Catalog Price"> <xpath expr="//del[@class='text-danger mr8']" position="replace"> <field name="text-danger" invisible="1" nolabel="1"/> </xpath> </data> 
Here is the code for the xml view being installed:
<?xml version="1.0" encoding="UTF-8"?><openerp> <data>
        <template id="products_item" inherit_id="website_sale.products_item" name="Shop Without Catalog Price"> <xpath expr="//del[@class='text-danger mr8']" position="replace"> <field name="text-danger" invisible="1" nolabel="1"/> </xpath> </template>
        <template id="cart" inherit_id="website_sale.cart_lines" name="Shopping Cart Without Catalog Price"> <xpath expr="//del[@t-field='line.product_id.lst_price']" position="replace"> <field name="text-danger" invisible="1" nolabel="1"/> </xpath> </template>
        <template id="product_price" inherit_id="website_sale.product_price" name="Product Page Without Catalog Price"> <xpath expr="//span[@class='text-danger oe_default_price']" position="replace"> <field name="text-danger oe_default_price" invisible="1" nolabel="1"/> </xpath> </template>
        <template id="suggested_products_list" inherit_id="website_sale.cart_lines" name="Suggested Products Without Catalog Price"> <xpath expr="//del[@class='text-danger mr8']" position="replace"> <field name="text-danger" invisible="1" nolabel="1"/> </xpath> </template>

      <template id="modal_cart" inherit_id="website_sale_options.modal" name="Modal Cart Without Catalog Price"> <xpath expr="//span[@t-attf-class='text-danger oe_default_price']" position="replace"> <field name="text_danger oe_default_price" invisible="1" nolabel="1"/> </xpath> <xpath expr="//span[@class='text-danger oe_optional']" position="replace"> <field name="text-danger oe_optional" invisible="1" nolabel="1"/> </xpath> </template> </data></openerp>


Here is the if-statement:

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Did you install https://apps.openerp.com/apps/modules/9.0/website_sale_options/ before?

Please check the dependencies in the __openerp__.py file:

{
 'name': 'eCommerce Without Catalog Price',
 'version': '9.0.1.1',
 'depends': [ 'website_sale', 'website_sale_options',],
 'author': 'Roberto Barreiro',
 'website': 'https://bitbucket.org/disgalmilladoiro/',
 'summary': 'Hides catalog price',
 "description": """ Hides catalog price on shop and shopping cart.
""",
 'category': 'eCommerce',
 'sequence': 10,
 'data': [ 'views/website_sale_hide_catalog_price.xml',],
 'installable': True,
 'auto_install': False,
 'application': False,
}

Do you see the inherited view website_sale.suggested_products_list here:

Then you should check the t-if statement here:


Ảnh đại diện
Huỷ bỏ
Tác giả

Yes, ive posted images.

Tác giả

Yes I also posted the image for the Views/ShoppingCart and the website_sale.suggested_products_list does show up

Tác giả

yup, its there...i posted the image

Tác giả

Hello? :-)

Now you are on your own. Your error message tells you that the xpath node "//del[@class='text-danger mr8']" is not present. After all other checks, the only possible reason is the evaluation of this t-if statement. If it is not true, the xpath node will not be there.

Tác giả

Ok just to clarify, the problem is with this if statement which is evaluating to false. And that means that product_lst.price-product.price > 0.1?

compute_currency(product.lst_price) to be exactly. This is my assumption based on your information.

Tác giả

Well all my products have a default price of 1 which is what the system assigns. I did create pricelist based on cost & markup because I need to know what the prices are for the products I sell. I just dont want the website to display them because the prices change constantly.

Tác giả

Ok Im looking through the database but cannot find any table called product.lst_price. Presumably the website_sale table would contain it but I cant find the website_sale table either.