summaryrefslogtreecommitdiff
path: root/addons/account_edi_proxy_client/models/account_edi_format.py
blob: 0dc8bd9abe01618db50b87cc67878b30a780acb9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# -*- coding: utf-8 -*-
from odoo import models


class AccountEdiFormat(models.Model):
    _inherit = 'account.edi.format'

    # -------------------------------------------------------------------------
    # Helpers
    # -------------------------------------------------------------------------

    def _get_proxy_user(self, company):
        '''Returns the proxy_user associated with this edi format.
        '''
        self.ensure_one()
        return company.account_edi_proxy_client_ids.filtered(lambda u: u.edi_format_id == self)

    # -------------------------------------------------------------------------
    # To override
    # -------------------------------------------------------------------------

    def _get_proxy_identification(self, company):
        '''Returns the key that will identify company uniquely for this edi format (for example, the vat)
        or raises a UserError (if the user didn't fill the related field).
        TO OVERRIDE
        '''
        return False