Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to add calculated value in treeview for Sales Order - value of invoice paid?

v7
By
Dawid
on 8/19/14, 3:36 PM 1,087 views

Dear all,

I am trying to customize Sales Order treeview by adding column with value of amount to be paid. Situation is as follows - I have sales orders which has partial invoices attached (and paid). So each Sales order has few invoices. In tree view of Sales Orders main value users can see is Total amount of specific sales order. What I would like to do I would like to add value of amount to be paid.

I have found fields that I can base my calculations (from sale.order object):

  • amount_total
  • invoiced_rate

My calculation for additional field should be something like: amount_total * (100% - invoiced_rate)

The issue is that I do not know how I can create field that will compute it and where should I put it? The main issue is that I do not want to create a moudle for that (it should be customisation from UI).

br

Dawid

 

0
Mariusz Mizgier
On 8/20/14, 1:37 AM

Easiest way to approach that would be by development - you have to add a field.function, which will return the value of amount to be paid - adding that field via UI is impossible, as Settings -> Database structure -> Fields doesn't support fields.function.

Create simple field, add a function, which will return result you want, add that in tree view and voila.

Thanks Mariusz, this is what I was afraid of, that to make such thing You need to code. So it is not easy for Saas version to do that. Thanks anyway. br Dawid

Dawid
on 8/20/14, 5:31 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 8/19/14, 3:36 PM
Seen: 1087 times
Last updated: 3/16/15, 8:10 AM