[NEW] pad_hedgedoc_leads: create addon
This commit is contained in:
4
pad_hedgedoc_leads/models/__init__.py
Normal file
4
pad_hedgedoc_leads/models/__init__.py
Normal file
@@ -0,0 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import crm_lead
|
||||
from . import hedgedoc_pad
|
19
pad_hedgedoc_leads/models/crm_lead.py
Normal file
19
pad_hedgedoc_leads/models/crm_lead.py
Normal 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},
|
||||
}
|
10
pad_hedgedoc_leads/models/hedgedoc_pad.py
Normal file
10
pad_hedgedoc_leads/models/hedgedoc_pad.py
Normal 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)
|
Reference in New Issue
Block a user