26 lines
1016 B
Python
26 lines
1016 B
Python
from odoo import models
|
|
|
|
|
|
class DmsResPartner(models.Model):
|
|
_inherit = 'res.partner'
|
|
|
|
def action_show_document_incoming(self):
|
|
self.ensure_one()
|
|
action = self.env['ir.actions.act_window']._for_xml_id(
|
|
'mklab_dms_document.action_window_incoming')
|
|
action['domain'] = [('partner_id', '=', self.id),
|
|
('type_document', '=', 'incoming')]
|
|
action['context'] = {'default_partner_id': self.id,
|
|
'default_type_document': 'incoming'}
|
|
return action
|
|
|
|
def action_show_document_outgoing(self):
|
|
self.ensure_one()
|
|
action = self.env['ir.actions.act_window']._for_xml_id(
|
|
'mklab_dms_document.action_window_outgoing')
|
|
action['domain'] = [('partner_id', '=', self.id),
|
|
('type_document', '=', 'outgoing')]
|
|
action['context'] = {'default_partner_id': self.id,
|
|
'default_type_document': 'outgoing'}
|
|
return action
|