Browse Source

[FIX] templates and beesdoo_shift,

[ADD] small changes on macavrac_base
pull/143/head
odoo-pda 5 years ago
parent
commit
1fce26620c
  1. 6
      beesdoo_shift/models/task.py
  2. 18
      beesdoo_website_shift/views/my_shift_website_templates.xml
  3. 8
      beesdoo_website_shift/views/shift_website_templates.xml
  4. 6
      macavrac_base/views/res_partner.xml

6
beesdoo_shift/models/task.py

@ -27,7 +27,7 @@ class Task(models.Model):
("cancel","Cancelled") ("cancel","Cancelled")
] ]
def _get_color_mapping(state):
def _get_color_mapping(self, state):
return { return {
"draft": 0, "draft": 0,
"open": 1, "open": 1,
@ -37,7 +37,7 @@ class Task(models.Model):
"cancel": 9, "cancel": 9,
}[state] }[state]
def _get_final_state():
def _get_final_state(self):
return ["done", "absent", "excused"] return ["done", "absent", "excused"]
name = fields.Char(track_visibility='always') name = fields.Char(track_visibility='always')
@ -78,7 +78,7 @@ class Task(models.Model):
@api.depends("state") @api.depends("state")
def _compute_color(self): def _compute_color(self):
for rec in self: for rec in self:
rec.color = self._state_color_mapping(rec.state)
rec.color = self._get_color_mapping(rec.state)
def _compensation_validation(self, task): def _compensation_validation(self, task):
""" """

18
beesdoo_website_shift/views/my_shift_website_templates.xml

@ -6,9 +6,9 @@
<odoo> <odoo>
<!-- Add menu entries --> <!-- Add menu entries -->
<template id="my_shift_link" name="Link to frontend portal" inherit_id="website.layout">
<xpath expr="//li[@id='o_logout']" position="before">
<li><a href="/my/shift" role="menuitem">My Shift</a></li>
<template id="my_shift_link" name="Link to frontend portal" inherit_id="portal.frontend_layout">
<xpath expr="//a[@id='o_logout']" position="before">
<a href="/my/shift" role="menuitem" class="dropdown-item">My Shift</a>
</xpath> </xpath>
</template> </template>
@ -618,7 +618,7 @@
<template <template
id="my_shift_non_worker" id="my_shift_non_worker"
name="My Shift for Non Worker" name="My Shift for Non Worker"
page="True">
>
<t t-call="website.layout"> <t t-call="website.layout">
<t t-call="beesdoo_website_shift.my_shift_title"/> <t t-call="beesdoo_website_shift.my_shift_title"/>
@ -644,7 +644,7 @@
<template <template
id="my_shift_new_worker" id="my_shift_new_worker"
name="My Shift for New Worker" name="My Shift for New Worker"
page="True">
>
<t t-call="website.layout"> <t t-call="website.layout">
<t t-call="beesdoo_website_shift.my_shift_title"/> <t t-call="beesdoo_website_shift.my_shift_title"/>
@ -670,7 +670,7 @@
<template <template
id="my_shift_exempted_worker" id="my_shift_exempted_worker"
name="My Shifts for Exempted Workers" name="My Shifts for Exempted Workers"
page="True">
>
<t t-call="website.layout"> <t t-call="website.layout">
<t t-call="beesdoo_website_shift.my_shift_title"/> <t t-call="beesdoo_website_shift.my_shift_title"/>
@ -723,7 +723,7 @@
<template <template
id="my_shift_regular_worker_without_shift" id="my_shift_regular_worker_without_shift"
name="My Shifts for regular worker without shift" name="My Shifts for regular worker without shift"
page="True">
>
<t t-call="website.layout"> <t t-call="website.layout">
<t t-call="beesdoo_website_shift.my_shift_title"/> <t t-call="beesdoo_website_shift.my_shift_title"/>
@ -773,7 +773,7 @@
<template <template
id="my_shift_regular_worker" id="my_shift_regular_worker"
name="My Shifts for Regular Workers" name="My Shifts for Regular Workers"
page="True">
>
<t t-call="website.layout"> <t t-call="website.layout">
<t t-call="beesdoo_website_shift.my_shift_title"/> <t t-call="beesdoo_website_shift.my_shift_title"/>
@ -837,7 +837,7 @@
<template <template
id="my_shift_irregular_worker" id="my_shift_irregular_worker"
name="Shifts for Irregular Workers" name="Shifts for Irregular Workers"
page="True">
>
<t t-call="website.layout"> <t t-call="website.layout">
<t t-call="beesdoo_website_shift.my_shift_title"/> <t t-call="beesdoo_website_shift.my_shift_title"/>

8
beesdoo_website_shift/views/shift_website_templates.xml

@ -21,11 +21,10 @@
</record> </record>
</data> </data>
<!-- Public Available Tasks Templates for Regular Workers -->
<template <template
id="public_shift_template_regular_worker" id="public_shift_template_regular_worker"
name="Available Tasks Templates for Regular Workers" name="Available Tasks Templates for Regular Workers"
page="True">
>
<t t-call="website.layout"> <t t-call="website.layout">
<div class="oe_structure"/> <div class="oe_structure"/>
@ -156,7 +155,7 @@
<template <template
id="public_shift_irregular_worker" id="public_shift_irregular_worker"
name="Available Shifts for Irregular Workers" name="Available Shifts for Irregular Workers"
page="True">
>
<t t-call="website.layout"> <t t-call="website.layout">
<div class="oe_structure"/> <div class="oe_structure"/>
@ -206,4 +205,7 @@
</t> </t>
</template> </template>
</odoo> </odoo>

6
macavrac_base/views/res_partner.xml

@ -5,14 +5,18 @@
<field name="inherit_id" ref="base.view_partner_form"/> <field name="inherit_id" ref="base.view_partner_form"/>
<field name="priority">99</field> <field name="priority">99</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//notebook/page[1]" position="attributes">
<attribute name="autofocus">0</attribute>
</xpath>
<xpath expr="//notebook" position="inside"> <xpath expr="//notebook" position="inside">
<page string="Google Sheet Infos" name="google_sheet">
<page string="Google Sheet Infos" name="google_sheet" autofocus="autofocus">
<group> <group>
<field name="date_stamp"/> <field name="date_stamp"/>
<field name="coop_number"/> <field name="coop_number"/>
<field name="gender"/> <field name="gender"/>
<field name="birthdate"/> <field name="birthdate"/>
<field name="national_register_number"/> <field name="national_register_number"/>
<field name="cooperator_type"/>
<field name="share_qty"/> <field name="share_qty"/>
<field name="share_numbers"/> <field name="share_numbers"/>
<field name="share_amount"/> <field name="share_amount"/>

Loading…
Cancel
Save