[IMP] hr-luncheon-voucher: improve allocation form creation process
This commit is contained in:
@@ -97,6 +97,7 @@ class LuncheonVouchersAllocation(models.Model):
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@api.model_create_multi
|
||||||
def create(self, values):
|
def create(self, values):
|
||||||
res = super(LuncheonVouchersAllocation, self).create(values)
|
res = super(LuncheonVouchersAllocation, self).create(values)
|
||||||
res._calculate_number_acquired_lv()
|
res._calculate_number_acquired_lv()
|
||||||
|
@@ -9,7 +9,8 @@
|
|||||||
<field name="state" />
|
<field name="state" />
|
||||||
<filter name="draft" string="Draft" domain="[('state', '=', 'draft')]" />
|
<filter name="draft" string="Draft" domain="[('state', '=', 'draft')]" />
|
||||||
<filter name="confirmed" string="Confirmed" domain="[('state', '=', 'confirmed')]" />
|
<filter name="confirmed" string="Confirmed" domain="[('state', '=', 'confirmed')]" />
|
||||||
<filter name="distributed" string="Distributed" domain="[('state', '=', 'distributed')]" />
|
<filter name="distributed" string="Distributed"
|
||||||
|
domain="[('state', '=', 'distributed')]" />
|
||||||
</search>
|
</search>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
@@ -20,10 +21,14 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="Luncheon vouchers allocations">
|
<tree string="Luncheon vouchers allocations">
|
||||||
<header>
|
<header>
|
||||||
<button type="object" name="confirm_allocation" string="Confirm" class="btn-primary" />
|
<button type="object" name="confirm_allocation" string="Confirm"
|
||||||
<button type="object" name="distribute_allocation" string="Distribute Vouchers" class="btn-primary" />
|
class="btn-primary" />
|
||||||
<button type="object" name="back_to_draft" string="Back to draft" class="btn-secundary" />
|
<button type="object" name="distribute_allocation" string="Distribute Vouchers"
|
||||||
<button type="object" name="adjust_distribution" string="Adjust distribution" class="btn-secundary" />
|
class="btn-primary" />
|
||||||
|
<button type="object" name="back_to_draft" string="Back to draft"
|
||||||
|
class="btn-secundary" />
|
||||||
|
<button type="object" name="adjust_distribution" string="Adjust distribution"
|
||||||
|
class="btn-secundary" />
|
||||||
</header>
|
</header>
|
||||||
<field name="distrib_campaign_name" />
|
<field name="distrib_campaign_name" />
|
||||||
<field name="employee_id" />
|
<field name="employee_id" />
|
||||||
@@ -43,14 +48,18 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="">
|
<form string="">
|
||||||
<header>
|
<header>
|
||||||
<button type="object" name="confirm_allocation" string="Confirm" class="btn-primary" attrs="{'invisible': [('state', '!=', 'draft')]}" />
|
<button type="object" name="confirm_allocation" string="Confirm"
|
||||||
<button type="object" name="distribute_allocation" string="Distribute Vouchers" class="btn-primary" attrs="{'invisible': [('state', '!=', 'confirmed')]}" />
|
class="btn-primary" attrs="{'invisible': [('state', '!=', 'draft')]}" />
|
||||||
<button type="object" name="back_to_draft" string="Back to draft" class="btn-secundary" attrs="{'invisible': [('state', '=', 'draft')]}" />
|
<button type="object" name="distribute_allocation" string="Distribute Vouchers"
|
||||||
<button type="object" name="adjust_distribution" string="Adjust distribution" class="btn-secundary" attrs="{'invisible': [('state', '!=', 'draft')]}" />
|
class="btn-primary" attrs="{'invisible': [('state', '!=', 'confirmed')]}" />
|
||||||
|
<button type="object" name="back_to_draft" string="Back to draft"
|
||||||
|
class="btn-secundary" attrs="{'invisible': [('state', '=', 'draft')]}" />
|
||||||
|
<button type="object" name="adjust_distribution" string="Adjust distribution"
|
||||||
|
class="btn-secundary" attrs="{'invisible': [('state', '!=', 'draft')]}" />
|
||||||
</header>
|
</header>
|
||||||
<sheet>
|
<sheet>
|
||||||
<h1>
|
<h1>
|
||||||
<field name="name" />
|
<field name="name" readonly="1" />
|
||||||
</h1>
|
</h1>
|
||||||
<group string="Request context">
|
<group string="Request context">
|
||||||
<field name="distrib_campaign_name" />
|
<field name="distrib_campaign_name" />
|
||||||
|
Reference in New Issue
Block a user