[NEW] pad_hedgedoc_connector: create addon

This commit is contained in:
Stéphan Sainléger
2022-08-09 23:02:58 +02:00
parent fb525f95d9
commit 0606229cb5
13 changed files with 314 additions and 0 deletions

View File

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

View 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

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