forked from michel/Coworking
Kanban first version.
This commit is contained in:
parent
25fadfdb56
commit
7b33b11789
@ -11,17 +11,18 @@ class Coworker(models.Model):
|
||||
_description = 'Coworker model definition'
|
||||
_order = 'id desc'
|
||||
|
||||
full_name = fields.Char(compute='_compute_full_name', store=True, index=True)
|
||||
contact_date = fields.Date(default=fields.Date.context_today)
|
||||
|
||||
full_name = fields.Char(compute='_compute_full_name', store=True, index=True)
|
||||
name = fields.Char(required=True)
|
||||
firstname = fields.Char('First name', required=True)
|
||||
|
||||
coworker_type = fields.Selection([('staffer', 'Staffer'),
|
||||
('worker', 'Worker'), ('member', 'Member'),
|
||||
('volunteer', 'Volunteer'),
|
||||
('visitor', 'Visitor')])
|
||||
company_name = fields.Char('Company')
|
||||
job = fields.Char()
|
||||
contact_date = fields.Date(default=fields.Date.context_today)
|
||||
|
||||
#Adress fields
|
||||
street = fields.Char()
|
||||
@ -35,13 +36,18 @@ class Coworker(models.Model):
|
||||
url = fields.Char('URL')
|
||||
note = fields.Text()
|
||||
|
||||
#Images fields
|
||||
#Images fields
|
||||
contact_image = fields.Binary()
|
||||
|
||||
|
||||
is_done = fields.Boolean('Done?')
|
||||
is_active = fields.Boolean('Active?', default=True)
|
||||
|
||||
# # Kanban
|
||||
# kanban_state = fields.Selection([('normal', 'In Progress'),
|
||||
# ('blocked', 'Blocked'),
|
||||
# ('done', 'Ready for next stage')],
|
||||
# 'Kanban State', default='normal')
|
||||
|
||||
@api.depends('name', 'firstname')
|
||||
def _compute_full_name(self):
|
||||
"""Concaténation du nom et du prénom"""
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<odoo>
|
||||
|
||||
<!-- Form -->
|
||||
<record id="view_form_coworker" model="ir.ui.view">
|
||||
<field name="name">Coworker Form</field>
|
||||
<field name="model">coworking.coworker</field>
|
||||
@ -46,7 +46,7 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Tree -->
|
||||
<record id="view_tree_coworker" model="ir.ui.view">
|
||||
<field name="name">Coworker Tree</field>
|
||||
<field name="model">coworking.coworker</field>
|
||||
@ -61,7 +61,7 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Search -->
|
||||
<record id="view_search_coworker" model="ir.ui.view">
|
||||
<field name="name">Coworker Search</field>
|
||||
<field name="model">coworking.coworker</field>
|
||||
@ -99,6 +99,33 @@
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Kanban -->
|
||||
<record id="view_kanban_coworker" model="ir.ui.view">
|
||||
<field name="name">Coworker Kanban</field>
|
||||
<field name="model">coworking.coworker</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban>
|
||||
<field name="contact_image" />
|
||||
<field name="full_name" />
|
||||
<field name="full_contact_adress" />
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_kanban_vignette oe_semantic_html_override">
|
||||
<div class="o_kanban_image">
|
||||
<img t-if="record.contact_image.raw_value"
|
||||
t-att-src="'data:image/png;base64,'+ record.contact_image.raw_value"/>
|
||||
<t t-if="!record.contact_image.raw_value">
|
||||
</t>
|
||||
</div>
|
||||
<div>
|
||||
<field name="full_name" />
|
||||
<field name="full_contact_adress" />
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
Loading…
Reference in New Issue
Block a user