mirror of
https://github.com/bringout/oca-crm.git
synced 2026-04-26 03:21:59 +02:00
Add oca-crm submodule with 26 CRM modules
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
0e924979be
commit
0608132c9e
1296 changed files with 142509 additions and 0 deletions
|
|
@ -0,0 +1,23 @@
|
|||
# Copyright 2004-2016 Odoo SA (<http://www.odoo.com>)
|
||||
# Copyright 2017 Tecnativa - Vicent Cubells
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResPartner(models.Model):
|
||||
"""Added the details of phonecall in the partner."""
|
||||
|
||||
_inherit = "res.partner"
|
||||
|
||||
phonecall_ids = fields.One2many(
|
||||
comodel_name="crm.phonecall", inverse_name="partner_id", string="Phonecalls"
|
||||
)
|
||||
phonecall_count = fields.Integer(compute="_compute_phonecall_count")
|
||||
|
||||
def _compute_phonecall_count(self):
|
||||
"""Calculate number of phonecalls."""
|
||||
for partner in self:
|
||||
partner.phonecall_count = self.env["crm.phonecall"].search_count(
|
||||
[("partner_id", "=", partner.id)]
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue