14 lines
446 B
Python
14 lines
446 B
Python
# -*- coding: utf-8 -*-
|
|
from odoo import api, fields, models, modules
|
|
|
|
|
|
class InheritResPartner(models.Model):
|
|
_inherit = 'res.partner'
|
|
|
|
is_employee = fields.Boolean(string='员工', default=False)
|
|
|
|
def update_is_employee(self):
|
|
partner_ids = self.env["res.partner"].browse(
|
|
self._context.get('active_ids', self._context.get('active_id')))
|
|
for partner in partner_ids:
|
|
partner.is_employee = True |