Update transaction.py
This commit is contained in:
parent
0abf8901d0
commit
7ae1a1038a
|
|
@ -75,9 +75,17 @@ class Transaction(models.Model):
|
|||
('0', 'not'),
|
||||
('1', 'Favorite'),
|
||||
], size=1, string="Favorite")
|
||||
signature = fields.Binary("Signature image")
|
||||
signature = fields.Binary("Signature image",compute='compute_img',store=True)
|
||||
tran_tag = fields.Many2many(comodel_name='transaction.tag', string='Tags')
|
||||
add_rank = fields.Integer(string='Transaction Rank')
|
||||
|
||||
@api.depends('type','subject')
|
||||
def compute_img(self):
|
||||
employee_id = self.env['hr.employee'].search([('user_id', '=', self.env.uid)], limit=1)
|
||||
if employee_id:
|
||||
entity = self.env['cm.entity'].search([('type','=','employee'),('employee_id', '=',employee_id)], limit=1)
|
||||
for rec in self:
|
||||
rec.signature = entity.image
|
||||
|
||||
# @api.onchange('tran_tag')
|
||||
# def get_subject_type(self):
|
||||
|
|
|
|||
Loading…
Reference in New Issue