clinic/netforce_clinic/models/matching_payment_line.py

31 lines
1.0 KiB
Python
Raw Permalink Normal View History

2015-02-18 18:50:15 +00:00
from netforce.model import Model, fields, get_model
class MatchingPaymentLine(Model):
_name="clinic.matching.payment.line"
_transient=True
2015-02-20 10:59:49 +00:00
def _get_all(self,ids,context={}):
res={}
for obj in self.browse(ids):
res[obj.id]={
'amount': (obj.fee or 0)+(obj.epo or 0)+(obj.srv or 0),
}
return res
2015-07-23 01:25:44 +00:00
2015-02-18 18:50:15 +00:00
_fields={
'match_id': fields.Many2One("clinic.matching.payment","Match",required=True,on_delete="cascade"),
2015-02-19 08:15:41 +00:00
'invoice_id': fields.Many2One("account.invoice","Invoice (Waiting Payment)"),
"date": fields.Char("Date"),
2015-02-18 18:50:15 +00:00
"hn": fields.Char("HN"),
'pid': fields.Char("PID"),
"name": fields.Char("Name"),
'epo': fields.Float("EPO"),
2015-02-20 10:59:49 +00:00
'srv': fields.Float("Service"),
2015-02-18 18:50:15 +00:00
"fee": fields.Float("Fee"),
2015-02-20 10:59:49 +00:00
'amount': fields.Float("Amount",function="_get_all",function_multi=True),
'state': fields.Selection([['match','Match'],['unmatch','Not Match']],'State'),
2015-02-18 18:50:15 +00:00
}
MatchingPaymentLine.register()