Skip to Content
Menu
This question has been flagged
16 Replies
4502 Views

We've been using Odoo 11 for some time now but cannot install the Purchase Management module. We are using Sales, CRM, Project, Sales Management and Invoicing modules with no issues. We have not done any customization to date aside from minor field display changes in CRM Pipeline Kanban view and have very limited users but a lot of sales and invoicing data.

Whenever we try to install the Purchase Management module, it fails with the following errors

ValueError: Element '<group name="invoicing">' cannot be located in parent view
Error context:
View `product.template.invoice.policy`
[view_id: 661, xml_id: sale.product_template_form_view_invoice_policy, model: product.template, parent_id: 411]

'Error while validating constraint\n\nElement \'<group name="invoicing">\' cannot be located in parent view\n\nError context:\nView `product.template.invoice.policy`\n[view_id: 661, xml_id: sale.product_template_form_view_invoice_policy, model: product.template, parent_id: 411]', None)

odoo.tools.convert.ParseError: "Error while validating constraint
Element '<group name="invoicing">' cannot be located in parent view

We are stuck and don't know what to do to enable this functionality! We did perform a fresh install again and were able to import to the Purchase Management module but then when we imported our database, it disappeared and we ran into the same error on installation as above.

Please help!!!


Avatar
Discard
Author Best Answer

Cyril,

Thanks so much for the response. I did look at the Github thread and am not sure the issue has been acknowledged as a bug? In the meantime, I wanted to see if there is any way for us to 'manually' overcome the issue understanding later upgrades may cause the issue to come back? Can the invoicing group name be manually added? I tried looking at the views referenced in the error report but all of them fail to open with the same missing group error. Please let me know if you can think of a way for us to deal with this temporarily.

Merci!

Brian

Avatar
Discard

Hi,

yes, you can add temporarily a group with name invoicing in product.view product_template_form_view view (you can use patch command to edit sources to trace this modification), modify manually the view in menu settings/technical/user interface/views. Bye

Author

Cyril,

I was able to find the suggested view but wanted to confirm before making any changes. It is product.template.common.form under model product.template with external ID product.product_template_form_view. Please confirm and let me know where it would be best to add the new group. The views contents are:

<?xml version="1.0"?>

<form string="Product">

<header>

<button string="Variant Prices" type="action" name="163" attrs="{'invisible': [('product_variant_count', '&lt;=', 1)]}" groups="product.group_product_variant"/>

</header>

<sheet>

<field name="product_variant_count" invisible="1"/>

<field name="is_product_variant" invisible="1"/>

<field name="id" invisible="True"/>

<div class="oe_button_box" name="button_box">

<button name="toggle_active" type="object" class="oe_stat_button" icon="fa-archive">

<field name="active" widget="boolean_button" options="{&quot;terminology&quot;: &quot;archive&quot;}"/>

</button>

</div>

<field name="image_medium" widget="image" class="oe_avatar"/>

<div class="oe_title">

<label class="oe_edit_only" for="name" string="Product Name"/>

<h1><field name="name" placeholder="Product Name"/></h1>

<div name="options" groups="base.group_user">

<div>

<field name="sale_ok"/>

<label for="sale_ok"/>

</div>

<div>

<field name="purchase_ok"/>

<label for="purchase_ok"/>

</div>

</div>

</div>

<notebook>

<page string="General Information" name="general_information">

<group>

<group name="group_general">

<field name="type"/>

<field name="categ_id" string="Category"/>

</group>

<group name="group_standard_price">

<field name="list_price" widget="monetary" options="{'currency_field': 'currency_id', 'field_digits': True}"/>

<label for="standard_price" groups="base.group_user" attrs="{'invisible': [('product_variant_count', '&gt;', 1), ('is_product_variant', '=', False)]}"/>

<div name="standard_price_uom" groups="base.group_user" attrs="{'invisible': [('product_variant_count', '&gt;', 1), ('is_product_variant', '=', False)]}">

<field name="standard_price" widget="monetary" options="{'currency_field': 'currency_id', 'field_digits': True}"/>

</div>

<field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/>

<field name="uom_id" groups="product.group_uom" options="{'no_create': True}"/>

<field name="uom_po_id" groups="product.group_uom" options="{'no_create': True}"/>

<field name="currency_id" invisible="1"/>

<field name="product_variant_id" invisible="1"/>

</group>

</group>

</page>

<page string="Sales" attrs="{'invisible':[('sale_ok','=',False)]}" name="sales">

<div name="pricelist_item" groups="product.group_product_pricelist">

<separator string="Pricing"/>

<field name="item_ids" nolabel="1" context="{'default_base':'list_price', 'default_applied_on' :'1_product'}">

<tree string="Pricelist Items" editable="bottom">

<field name="pricelist_id" string="Pricelist" required="1"/>

<field name="fixed_price" string="Price" required="1"/>

<field name="min_quantity"/>

<field name="date_start"/>

<field name="date_end"/>

<field name="applied_on" invisible="1"/>

</tree>

</field>

</div>

<group name="sale">

<group name="email_template_and_project" attrs="{'invisible':[('type', '!=', 'service')]}"/>

</group>

</page>

<page string="Inventory" name="inventory" groups="stock.group_stock_user,product.group_stock_packaging" attrs="{'invisible':[('type', '=', 'service')]}">

<group name="packaging" string="Packaging" colspan="4" attrs="{'invisible':['|', ('type', 'not in', ['product', 'consu']), ('product_variant_count', '&gt;', 1)]}" groups="product.group_stock_packaging">

<field name="packaging_ids" nolabel="1" context="{'default_product_id': product_variant_id,'tree_view_ref':'product.product_packaging_tree_view', 'form_view_ref':'product.product_packaging_form_view'}"/>

</group>

</page>

<page string="Notes" name="notes">

<group name="description">

<group string="Description for Customers" attrs="{'invisible': [('sale_ok','=',False)]}">

<field name="description_sale" nolabel="1" placeholder="This note will show up on sales orders."/>

</group>

</group>

<group name="warning">

<group name="sale_warning"/>

<group name="purchase_warning"/>

</group>

</page>

</notebook>

</sheet>

<div class="oe_chatter">

<field name="message_follower_ids" widget="mail_followers"/>

<field name="activity_ids" widget="mail_activity"/>

<field name="message_ids" widget="mail_thread"/>

</div>

</form>

Hi,

xml_id of the view is well product.view product_template_form_view, see up to date code here:

https://github.com/odoo/odoo/blob/11.0/addons/product/views/product_views.xml

recommandations:

save the original view before to modify it, to do first on a test environment (not directly in production environment).

concerning the bug, I created an issue demand, not accepted yet ..., don't forget to follow it, if there is a correction, revert your modification, patch the code (use linux command patch), store the patch by creating a folder patch in your sources to have an history of sources modifications (do not add this folder in addons path)) and modify the view with the correction manually to not update the module (refresh browser page to load manual modification of the view)

I propose to replace (the group is invisible if sale_ok = False):

<group name="sale">

<group name="email_template_and_project" attrs="{'invisible':[('type', '!=', 'service')]}"/>

</group>

by

<group name="sale">

<group name="email_template_and_project" attrs="{'invisible':[('type', '!=', 'service')]}"/>

</group>

<group name="invoicing">

</group>

Bye

question, does the account module is installed ?

Because this group is defined in a view in this module ...

before to make the modification, can you update the list of modules in menu applications (active developper mode), and try to intall purchase module.

other point, can you confirm me that sources odoo you are using actually are this which have been used to build your database ?

Author

I loaded Odoo from a V11 nightly installer packages and did not compile from source. The DB was created by the Odoo package once installed. It has been upgraded a few times over the original installation. Everything else seems to be running fine. I have the Canadian Accounting module installed, the invoicing module, sales module, project module and the CRM modules.

Author

I looked at the git source for product_views.xml and it was quite different than what was on my system. I made the suggested mod to the git version and loaded it on my system and tried to restart odoo and it started but would not present the webpage (just my logo and no menus). Then I reverted back to my original file and restarted odoo and still could not get the full interface back up. Tried restoring from a backup of my DB and same thing. I'll have to reload Odoo which is not that big of a deal but strange it seemed to have such an irreversible effect! Should I try it again once i've reloaded?

sorry,

but what you are doing is not a good thing.if you update sources with git, you must update all modules which have been modified with this update, the risk is to lost / add data, perhaps break integrity of your database ... (remove/add fields, views, reload odoo file data, add/delete constraints ....)

for me to have your database up to date, you have to update list of modules, and update module base, and all modules installed will be automatically update too, and you will have no more problems to install purchase module, but it is not recommended because you don't know what will be add or deleted since last installation / update of your modules with old sources, but I recommand you to not execute this operation.

I recommand you to contact an odoo partner for your case, for Canada, I know and can recommand you Numigi company: https://www.odoo.com/fr_FR/partners/numigi-1567474

if you want to install / update at odoo start, add in command which run server odoo :

-i module_name to install, -u module_name to update

sorry, but I stop here my help, I don't want to be the cause of lost data, database break, because you didn' respect installation method, fix/save sources, and didn't know really what you have done by updating sources.

Good luck.

Author

Cyril,

I should have mentioned I was NOT doing this on my production system (as you recommended) so NO problem at all!!! Thank you for information on the Canadian partner but prior to us contacting them would you mind one more question? It seems to me adding the invoicing group to our existing product_views.xml would be the least risk until we find a more permanent solution. But I am not sure where the best insertion point is. Could you please make a recommendation so we can try in our TEST environment? Here is our current product_views.xml

https://www.dropbox.com/s/k4ya714a7dmz62b/product_views.xml?dl=0

Any help would be greatly appreciated!

Brian

Author

Cyril,

Thanks for your help but I was able to resolve the issue! Merci!

Brian

Hi,

good news, what are you doing to solve your problme, by adding the group in product view ?

Bye

Author

I actually did a fresh install on our test system with all the modules and noticed invoicing wasn't in product_views. I copied the file to my prod system running the same version but still had the issue. Then I went into dev mode on my prod system and checked for app updates but none were listed, However, I manually went into each installed module and clicked on the UPGRADE button and waited. And when I tried to install the Purchasing module...voila! It worked. I suspect something happened to my INVOICING module which caused the issue and doing the update forced its reinstallation resolving the issue.

Again, thanks for your help and i'm glad we're back up and running with this GREAT software!!!

Brian

effectively just update the good module to update the view, the best will be to install module base to have all modules up to date ;)

Good luck for the future, with this complex software, don't update sources as a simple software ;), keep stable sources, and patch code for your problems only ;).

Regards.

Related Posts Replies Views Activity
0
Jan 20
3450
0
Mar 17
2636
1
Jul 15
3655
1
Mar 15
3467
3
Nov 24
1069