Missing purchase_price and margin fields for sales order line in Odoo

In the model Sales.order.line in the Odoo DB

the technical name for the cost price field is: purchase_price.

The margin is also visible: that’s margin.

Both belong to the model: sale.order.line

The fields aren’t coming through via the API.

How can this be?

Supplement Information

Is it possible to add an (anonymised) screenshot of the request details in Online Monitoring on Invantive Cloud as described in Meer inzicht met nieuwe Online Monitoring?

You can find the details by clicking on the download request that represents the subject of this topic.

The download request usually contains a SQL statement in which the table name is visible.

Please make sure that at least the following data is visible from both columns:

  • the title bar with the request ID,
  • the status code, network size, path, and times in the left column,
  • the error code and error message at the very bottom of the left column,
  • the entire right column including the SQL statement, table name, and parameter values.

For example:

Check the Correct Server and User

Carefully check that you are logging into the Invantive Cloud website with the same username you use for processing data via, for example, Invantive Bridge Online. You will only see the requests of the Invantive Cloud user you log in with on the website.

Check the Correct Request and Details

Make sure you select the request first to display the details. There should only be one request visible in the screenshot.

Also, carefully check whether the request has a path with odata4, apps or mcp. Requests with other paths are generally not relevant for this purpose.

Error Message and Tips via Email

Additionally, the Invantive Cloud user who received the error message on their email will usually receive an email with an error message and tips if there is an error message in Power BI, Power Query, Azure Data Factory, Qlik or Tableau.

The advice is to check the spam of the involved user for such emails sent from support@invantive.eu.

Advice is to:

  • complete the data as described above;
  • add the relevant content of ir.model.fields that demonstrates the columns are present, for example using the query below;
  • check that the Odoo user being used has the rights to read the fields.

Note that if the module in question has been recently installed in Odoo, it may take up to 10 hours before the cache is updated.

Query:

select *
from   model_fields 
where  true
and    model = 'sale.order.line' 
and    name in ('purchase_price', 'margin')

Deze vraag is automatisch gesloten na 1 week inactiviteit. Het laatste gegeven antwoord is gemarkeerd als oplossing.

Gelieve een nieuwe vraag te stellen via een apart topic als het probleem opnieuw optreedt. Gelieve in de nieuwe vraag een link naar dit topic op te nemen door de URL er van in de tekst te plakken.