Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
2398 Vistas

Hi all !

I'm exporting RFQ datas in an excel file, everything will be ok in the excel file but when i try to import the exported file for the "Total" the only option i will have is "don't import" i had a look to all other options, none is returning the amount_total field ... could someone explain what i'm doing wrong ? Thanks !

Avatar
Descartar
Autor

I went through by creating a new field inheriting from total_amount field, and make a new view inheriting from purchase.order.tree

Now my problem is i cannot place it as i would like in the view, when i edit the architecture of my new view , even i put position "before" or "after" it won't move, or change the field name in the xpath expression it won't find the field.... Only field "name" works, but in the parent "purchase.order.tree" many other fields exist but it doesn't work.... So i can only get it in first position in the tree view...

If anyone can help on this issue, thanks !


Mejor respuesta

The amount_total field is managed by Odoo.

You cannot edit or import a value into fields that are managed by Odoo.

See https://github.com/odoo/odoo/blob/15.0/addons/purchase/models/purchase.py#L125 

When you see in that same file the function _amount_all you can see it calculates the amount_total by looping through every line and adding up the price_subtotal and price_tax on each line.


See https://github.com/odoo/odoo/blob/15.0/addons/purchase/models/purchase.py#L27 


Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
2
nov 24
1761
1
nov 24
2343
1
oct 23
2978
3
dic 23
20874
0
may 21
7736