Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
5100 Visualizzazioni

When I try to confirm a sale order through the UI, I get the following validation error:

The operation cannot be completed, probably due to the following:
- deletion: you may be trying to delete a record while other records still reference it- creation/update: a mandatory field is not correctly set
[object with reference: Product Template - product.template]

I am simply creating a basic sales order by selecting a few products and saving it, then clicking "Confirm Sale", but I keep getting the error. Does anybody know why this would be occurring?

I am working on what is basically a fresh Odoo 10 install with only a few modications. I created a custom view that inherits from sale.order.form.sale.stock and the content is:

<?xml version="1.0"?>

<data>

<xpath expr="//field[@name='order_line']/tree/field[@name='route_id']" position="before">

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

</xpath>

<xpath expr="//field[@name='order_line']/tree/field[@name='route_id']" position="attributes">

<attribute name="attrs">{'readonly': [('product_id', '=', False)]}</attribute>

<attribute name="domain">[('id', 'in', x_all_route_ids[0][2])]</attribute>

</xpath></data>

However, even when this view is inactive, the error still occurs, so I don't believe it is causing the issue.


Avatar
Abbandona
Risposta migliore

Unfortunately, these kinds of errors are very hard to trace. My best suggestion is to temporarily show all attributes on the form to see if any required fields are not set.


My preferred way to disable this is with Chrome's Developer Tools.

Simply inspect the page and search ("ctrl+f") for an element with the class named "o_form_invisible" or "oe_form_invisible".

Click the element and "uncheck" the "display: none" attribute in the CSS panel.


This will show all fields which would otherwise be hidden. Once you refresh the browser window, the fields will be hidden normally again.


I suggest doing this on both the sale.order.form.sale.stock form and on the product template form. 

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
5
ago 24
47087
5
dic 23
22434
2
apr 24
2799
3
giu 23
6224
2
giu 23
4994