[NEW] pad_hedgedoc_connector: create addon
This commit is contained in:
3
pad_hedgedoc_connector/wizard/__init__.py
Normal file
3
pad_hedgedoc_connector/wizard/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import create_pad
|
20
pad_hedgedoc_connector/wizard/create_pad.py
Normal file
20
pad_hedgedoc_connector/wizard/create_pad.py
Normal file
@@ -0,0 +1,20 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from odoo import models, fields
|
||||
|
||||
|
||||
class CreateHedgedocPadWizard(models.TransientModel):
|
||||
_name = "create.hedgedoc.pad.wizard"
|
||||
_description = "Create a Hedgedoc Pad"
|
||||
|
||||
pad_name = fields.Char(string="Title", required=True)
|
||||
|
||||
def _compute_pad_values(self):
|
||||
values = {
|
||||
"name": self.pad_name,
|
||||
"url": self.env.user.company_id.hedgedoc_server_url + "/" + self.pad_name
|
||||
}
|
||||
return values
|
||||
|
||||
def create_hedgedoc_pad(self):
|
||||
return True
|
20
pad_hedgedoc_connector/wizard/create_pad.xml
Normal file
20
pad_hedgedoc_connector/wizard/create_pad.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="create_hedgedoc_pad_wizard" model="ir.ui.view">
|
||||
<field name="name">create.hedgedoc.pad.wizard</field>
|
||||
<field name="model">create.hedgedoc.pad.wizard</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="create a new Hedgedoc pad linked to the current task">
|
||||
<group>
|
||||
<field name="pad_name" />
|
||||
</group>
|
||||
<footer>
|
||||
<button string="Create" name="create_hedgedoc_pad" type="object" class="btn-primary" />
|
||||
<button string="Cancel" class="btn-secondary" special="cancel" />
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
Reference in New Issue
Block a user