[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
|
18
pad_hedgedoc_leads/models/crm_lead.py
Normal file
18
pad_hedgedoc_leads/models/crm_lead.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from odoo import models, fields
|
||||
|
||||
|
||||
class Lead(models.Model):
|
||||
_inherit = "crm.lead"
|
||||
|
||||
hedgedoc_pads = fields.One2many("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",
|
||||
}
|
9
pad_hedgedoc_leads/models/hedgedoc_pad.py
Normal file
9
pad_hedgedoc_leads/models/hedgedoc_pad.py
Normal file
@@ -0,0 +1,9 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from odoo import models, fields, _
|
||||
|
||||
|
||||
class HedgedocPad(models.Model):
|
||||
_inherit = "hedgedoc.pad"
|
||||
|
||||
lead_id = fields.Many2one("crm.lead", string=_("Associated opportunity"), copy=True)
|
Reference in New Issue
Block a user