14 lines
484 B
Python
14 lines
484 B
Python
from odoo import models, fields, api
|
|
|
|
|
|
class ResPartner(models.Model):
|
|
_inherit = 'res.partner'
|
|
|
|
woo_customer_ids = fields.One2many('woo.customer', 'partner_id', string='WooCommerce Links')
|
|
is_woo_customer = fields.Boolean(compute='_compute_is_woo_customer', string='Is WC Customer', store=True)
|
|
|
|
@api.depends('woo_customer_ids')
|
|
def _compute_is_woo_customer(self):
|
|
for partner in self:
|
|
partner.is_woo_customer = bool(partner.woo_customer_ids)
|