Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
2400 Tampilan

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
Buang
Penulis

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 !


Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
2
Nov 24
1762
1
Nov 24
2345
1
Okt 23
2978
3
Des 23
20875
0
Mei 21
7736