Browse Source

[FIX] templates and beesdoo_shift,

[ADD] small changes on macavrac_base
pull/143/head
odoo-pda 4 years ago
parent
commit
1fce26620c
  1. 6
      beesdoo_shift/models/task.py
  2. 18
      beesdoo_website_shift/views/my_shift_website_templates.xml
  3. 14
      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")
]
def _get_color_mapping(state):
def _get_color_mapping(self, state):
return {
"draft": 0,
"open": 1,
@ -37,7 +37,7 @@ class Task(models.Model):
"cancel": 9,
}[state]
def _get_final_state():
def _get_final_state(self):
return ["done", "absent", "excused"]
name = fields.Char(track_visibility='always')
@ -78,7 +78,7 @@ class Task(models.Model):
@api.depends("state")
def _compute_color(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):
"""

18
beesdoo_website_shift/views/my_shift_website_templates.xml

@ -6,9 +6,9 @@
<odoo>
<!-- 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>
</template>
@ -618,7 +618,7 @@
<template
id="my_shift_non_worker"
name="My Shift for Non Worker"
page="True">
>
<t t-call="website.layout">
<t t-call="beesdoo_website_shift.my_shift_title"/>
@ -644,7 +644,7 @@
<template
id="my_shift_new_worker"
name="My Shift for New Worker"
page="True">
>
<t t-call="website.layout">
<t t-call="beesdoo_website_shift.my_shift_title"/>
@ -670,7 +670,7 @@
<template
id="my_shift_exempted_worker"
name="My Shifts for Exempted Workers"
page="True">
>
<t t-call="website.layout">
<t t-call="beesdoo_website_shift.my_shift_title"/>
@ -723,7 +723,7 @@
<template
id="my_shift_regular_worker_without_shift"
name="My Shifts for regular worker without shift"
page="True">
>
<t t-call="website.layout">
<t t-call="beesdoo_website_shift.my_shift_title"/>
@ -773,7 +773,7 @@
<template
id="my_shift_regular_worker"
name="My Shifts for Regular Workers"
page="True">
>
<t t-call="website.layout">
<t t-call="beesdoo_website_shift.my_shift_title"/>
@ -837,7 +837,7 @@
<template
id="my_shift_irregular_worker"
name="Shifts for Irregular Workers"
page="True">
>
<t t-call="website.layout">
<t t-call="beesdoo_website_shift.my_shift_title"/>

14
beesdoo_website_shift/views/shift_website_templates.xml

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

6
macavrac_base/views/res_partner.xml

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

Loading…
Cancel
Save