from openerp import models, fields, api
import openerp.addons.decimal_precision as dp
#from datetime import datetime, timedelta
class sale_order(models.Model):
_inherit = 'sale.order'
customer_balance = fields.Float(related="partner_id.credit",string="Balance")
total_balance = fields.float(string='Total Balance')
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Księgowość
- Zapasy
- PoS
- Project
- MRP
To pytanie dostało ostrzeżenie
1
Odpowiedz
1980
Widoki
Hi,
You can make the total_balance as compute field depending on the field total_inquiry and early_balance field you mentioned.
@api.depends('total_inquiry', 'early_balance')
def _compute_total_balance(self):
balance = self.early_balance + self.total_inquiry
self.total_balance = balance
total_balance = fields.float(string='Total Balance', compute=_compute_total_balance)
The above code is based on new API, you might have to adjust the code according to old API.
Thanks
Podoba Ci się ta dyskusja? Dołącz do niej!
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj sięPowiązane posty | Odpowiedzi | Widoki | Czynność | |
---|---|---|---|---|
|
0
sty 24
|
1445 | ||
|
0
mar 15
|
3760 | ||
|
0
mar 15
|
3297 | ||
Financial Reports Balance sheet !!
Rozwiązane
|
|
1
cze 22
|
2445 | |
|
0
maj 22
|
1782 |