Browse Source

[ADD][TASK s0048a] working mode

[CHANGE][TASK s0048] occasional -> irregular
pull/105/head
Rémy Taymans 8 years ago
committed by Elouan
parent
commit
5fc4fbff24
  1. 2
      beesdoo_shift/models/__init__.py
  2. 15
      beesdoo_shift/models/res_users.py
  3. 5
      beesdoo_shift/views/res_users.xml

2
beesdoo_shift/models/__init__.py

@ -1,4 +1,4 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import planning import planning
import task import task
import res_users
import res_users

15
beesdoo_shift/models/res_users.py

@ -5,8 +5,21 @@ class ResUsers(models.Model):
_inherit = 'res.users' _inherit = 'res.users'
super = fields.Boolean("Super Cooperative") super = fields.Boolean("Super Cooperative")
working_mode = fields.Selection(
[
('regular', 'Regular worker'),
('irregular', 'Irregular worker'),
('exempt', 'Exempted'),
],
string="Working mode",
)
class ResPartner(models.Model): class ResPartner(models.Model):
_inherit = 'res.partner' _inherit = 'res.partner'
super = fields.Boolean(related='user_ids.super', string="Super Cooperative", readonly=True)
super = fields.Boolean(related='user_ids.super', string="Super Cooperative", readonly=True)
working_mode = fields.Selection(
related='user_ids.working_mode',
string="Working mode",
readonly=True,
)

5
beesdoo_shift/views/res_users.xml

@ -7,20 +7,23 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<field name="partner_id" position="after"> <field name="partner_id" position="after">
<field name="super" /> <field name="super" />
<field name="working_mode" />
</field> </field>
</field> </field>
</record> </record>
<record model="ir.ui.view" id="super_coop_partner_inherited_view_form"> <record model="ir.ui.view" id="super_coop_partner_inherited_view_form">
<field name="name">Partner Super Coop</field>
<field name="name">Partner Super Coop</field>
<field name="model">res.partner</field> <field name="model">res.partner</field>
<field name="inherit_id" ref="beesdoo_base.beesdoo_partner_form_view" /> <field name="inherit_id" ref="beesdoo_base.beesdoo_partner_form_view" />
<field name="arch" type="xml"> <field name="arch" type="xml">
<field name="eater" position="after"> <field name="eater" position="after">
<field name="working_mode" />
<field name="super" /> <field name="super" />
</field> </field>
</field> </field>
</record> </record>
</odoo> </odoo>
Loading…
Cancel
Save