# -*- coding: utf-8 -*-
from odoo import models


class DmsResPartner(models.Model):
    _inherit = 'res.partner'
    
    def action_show_document_incoming(self):
        self.ensure_one()
        document_action = self.env['ir.actions.act_window'].for_xml_id('mklab_dms_document','action_window_incoming')
        document_action['domain'] = str([('partner_id','=',self.id),('type_document','=','incoming')])
        return document_action
        
    def action_show_document_outgoing(self):
        self.ensure_one()
        document_action = self.env['ir.actions.act_window'].for_xml_id('mklab_dms_document','action_window_outgoing')
        document_action['domain'] = str([('partner_id','=',self.id),('type_document','=','outgoing')])
        return document_action