[NEW] pad_hedgedoc_leads: create addon

This commit is contained in:
Stéphan Sainléger
2022-08-09 23:45:04 +02:00
parent 1561baeae0
commit 2d9984aef7
9 changed files with 231 additions and 0 deletions

View File

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

View File

@@ -0,0 +1,79 @@
# Copyright 2021 Elabore ()
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Pad Hedgedoc Leads",
"version": "14.0.1.0.0",
"author": "Elabore",
"maintainer": "False",
"website": "False",
"license": "AGPL-3",
"category": "False",
"summary": "Add hedgedoc pad to CRM leads",
"description": """
:image: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
==================
Pad Hedgedoc Leads
==================
Add hedgedoc pad to CRM leads
Installation
============
Just install Pad Hedgedoc Leads, all dependencies will be installed by default.
Known issues / Roadmap
======================
Bug Tracker
===========
Bugs are tracked on `GitHub Issues
<https://github.com/elabore-coop/pad-tools/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smashing it by providing a detailed and welcomed feedback.
Credits
=======
Images
------
* Elabore: `Icon <https://elabore.coop/web/image/res.company/1/logo?unique=f3db262>`_.
Contributors
------------
* Stéphan Sainléger <https://github.com/stephansainleger>
Funders
-------
The development of this module has been financially supported by:
* Elabore (https://elabore.coop)
Maintainer
----------
This module is maintained by ELABORE.
""",
# any module necessary for this one to work correctly
"depends": [
"base",
"pad_hedgedoc_connector",
"crm",
],
"external_dependencies": {
"python": [],
},
# always loaded
"data": ["views/crm_lead.xml"],
# only loaded in demonstration mode
"demo": [],
"js": [],
"css": [],
"qweb": [],
"installable": True,
# Install this module automatically if all dependency have been previously
# and independently installed. Used for synergetic or glue modules.
"auto_install": False,
"application": False,
}

View File

@@ -0,0 +1,79 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pad_hedgedoc_leads
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-08-10 06:29+0000\n"
"PO-Revision-Date: 2022-08-10 06:29+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: pad_hedgedoc_leads
#: code:addons/pad_hedgedoc_leads/models/hedgedoc_pad.py:0
#: model:ir.model.fields,field_description:pad_hedgedoc_leads.field_hedgedoc_pad__lead_id
#, python-format
msgid "Associated opportunity"
msgstr "Opportunité associée"
#. module: pad_hedgedoc_leads
#: model:ir.model,name:pad_hedgedoc_leads.model_create_hedgedoc_pad_wizard
msgid "Create a Hedgedoc Pad"
msgstr "Créer un pad Hedgedoc"
#. module: pad_hedgedoc_leads
#: model_terms:ir.ui.view,arch_db:pad_hedgedoc_leads.crm_lead_view_form_hedgedoc
msgid "Create a pad"
msgstr "Créer un pad"
#. module: pad_hedgedoc_leads
#: model_terms:ir.ui.view,arch_db:pad_hedgedoc_leads.crm_lead_view_form_hedgedoc
msgid "Current linked pads"
msgstr "Pads liés"
#. module: pad_hedgedoc_leads
#: model:ir.model.fields,field_description:pad_hedgedoc_leads.field_create_hedgedoc_pad_wizard__display_name
#: model:ir.model.fields,field_description:pad_hedgedoc_leads.field_crm_lead__display_name
#: model:ir.model.fields,field_description:pad_hedgedoc_leads.field_hedgedoc_pad__display_name
msgid "Display Name"
msgstr "Nom affiché"
#. module: pad_hedgedoc_leads
#: model:ir.model,name:pad_hedgedoc_leads.model_hedgedoc_pad
msgid "Hedgedoc Pad"
msgstr "Pad Hedgedoc"
#. module: pad_hedgedoc_leads
#: model:ir.model.fields,field_description:pad_hedgedoc_leads.field_crm_lead__hedgedoc_pads
msgid "Hedgedoc Pads"
msgstr "Pads Hedgedoc"
#. module: pad_hedgedoc_leads
#: model_terms:ir.ui.view,arch_db:pad_hedgedoc_leads.crm_lead_view_form_hedgedoc
msgid "Hedgedoc pads"
msgstr "Pads Hedgedoc"
#. module: pad_hedgedoc_leads
#: model:ir.model.fields,field_description:pad_hedgedoc_leads.field_create_hedgedoc_pad_wizard__id
#: model:ir.model.fields,field_description:pad_hedgedoc_leads.field_crm_lead__id
#: model:ir.model.fields,field_description:pad_hedgedoc_leads.field_hedgedoc_pad__id
msgid "ID"
msgstr "ID"
#. module: pad_hedgedoc_leads
#: model:ir.model.fields,field_description:pad_hedgedoc_leads.field_create_hedgedoc_pad_wizard____last_update
#: model:ir.model.fields,field_description:pad_hedgedoc_leads.field_crm_lead____last_update
#: model:ir.model.fields,field_description:pad_hedgedoc_leads.field_hedgedoc_pad____last_update
msgid "Last Modified on"
msgstr "Dernière modification le"
#. module: pad_hedgedoc_leads
#: model:ir.model,name:pad_hedgedoc_leads.model_crm_lead
msgid "Lead/Opportunity"
msgstr "Piste/opportunité"

View File

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

View 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",
}

View 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)

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="crm_lead_view_form_hedgedoc" model="ir.ui.view">
<field name="name">crm.lead.view.form.hedgedoc</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.crm_lead_view_form" />
<field name="priority" eval="99" />
<field name="arch" type="xml">
<xpath expr="//notebook" position="inside">
<page name="hedgedoc_pads" string="Hedgedoc pads">
<button string="Create a pad" name="create_hedgedoc_pad" type="object" class="oe_stat_button" icon="fa-plus-circle" style="margin: 0px 4px 0px 0px" />
<separator string="Current linked pads" />
<field name="hedgedoc_pads" nolabel="1" mode="tree">
<tree create="0" delete="1">
<field name="name" />
<field name="url" widget="url" />
</tree>
</field>
</page>
</xpath>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import create_pad

View File

@@ -0,0 +1,12 @@
# -*- coding: utf-8 -*-
from odoo import models
class CreateHedgedocPadWizard(models.TransientModel):
_inherit = "create.hedgedoc.pad.wizard"
def _compute_pad_values(self):
values = super(CreateHedgedocPadWizard, self)._compute_pad_values()
values["lead_id"] = self.env["crm.lead"].browse(self._context.get("active_ids")).id
return values