Add many2one fields coworker1 and 2. and relation
This commit is contained in:
parent
f0d5897b15
commit
704ac03ca9
@ -10,4 +10,14 @@ class CoworkerRelation(models.Model):
|
||||
_description = 'relation model definition'
|
||||
_order = 'id asc'
|
||||
|
||||
titre = fields.Char()
|
||||
name = fields.Char()
|
||||
|
||||
coworker1 = fields.Many2one(
|
||||
'coworking.coworker', 'Coworker', index=True, required=True,
|
||||
domain="[('coworker_type', 'in', ['staffer', 'member', 'worker', 'volunteer', 'visitor'])]"
|
||||
)
|
||||
coworker2 = fields.Many2one(
|
||||
'coworking.coworker', 'Coworker', index=True, required=True,
|
||||
domain="[('coworker_type', 'in', ['staffer', 'member', 'worker', 'volunteer', 'visitor'])]"
|
||||
)
|
||||
relation = fields.Char(index=True, required=True)
|
||||
|
24
coworking_relation/views/coworker_views.xml
Normal file
24
coworking_relation/views/coworker_views.xml
Normal file
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<odoo>
|
||||
|
||||
<!-- Form -->
|
||||
<record id="view_form_coworker" model="ir.ui.view">
|
||||
<field name="name">Coworker Form adaptations</field>
|
||||
<field name="model">coworking.coworker</field>
|
||||
<field name="inherit_id" ref ="coworking_coworker.view_form_coworker" />
|
||||
<field name="arch" type="xml">
|
||||
<notebook position="inside">
|
||||
<page string="Events" name="Events">
|
||||
<group name="events">
|
||||
<field name="manager_event_ids"
|
||||
context="{'default_manager_id': active_id}" />
|
||||
<field name="event_ids" />
|
||||
<field name="events_coworker_count" />
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
@ -2,15 +2,23 @@
|
||||
|
||||
<odoo>
|
||||
<!-- Form -->
|
||||
<record id="view_form_relation" model="ir.ui.view">
|
||||
<field name="name">Relation Form</field>
|
||||
<field name="model">coworking.relation</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="relation">
|
||||
<sheet>
|
||||
<field name="title" />
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_form_relation" model="ir.ui.view">
|
||||
<field name="name">Relation Form</field>
|
||||
<field name="model">coworking.relation</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="event">
|
||||
<sheet>
|
||||
<group name="group_top">
|
||||
<group name="group_left">
|
||||
<field name="coworker1" />
|
||||
<field name="coworker2" />
|
||||
<field name="relation" />
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
|
Loading…
Reference in New Issue
Block a user