[NEW] pad_hedgedoc_leads: create addon

This commit is contained in:
Stéphan Sainléger
2022-08-09 23:45:04 +02:00
parent a6d16036ef
commit 1e32e8defb
11 changed files with 239 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
from . import crm_lead
from . import hedgedoc_pad

View File

@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from odoo import models, fields
class Lead(models.Model):
_inherit = "crm.lead"
leads_hedgedoc_pads = fields.One2many("lead.hedgedoc.pad", "lead_id")
def create_hedgedoc_pad(self):
return {
"name": "Create a Hedgedoc pad",
"type": "ir.actions.act_window",
"view_mode": "form",
"res_model": "create.hedgedoc.pad.wizard",
"target": "new",
"context": {'default_lead_id': self.id},
}

View File

@@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-
from odoo import models, fields, _
class LeadHedgedocPad(models.Model):
_name = "lead.hedgedoc.pad"
_inherit = "hedgedoc.pad"
lead_id = fields.Many2one("crm.lead", string=_("Associated opportunity"), copy=True)