[IMP] hr_government_relations, exp_ticket_request: add accounting approva
This commit is contained in:
parent
d06e689491
commit
34bccc0445
|
|
@ -15,9 +15,11 @@ class HrTicketing(models.Model):
|
||||||
STATE_SELECTION = [
|
STATE_SELECTION = [
|
||||||
('draft', _('Draft')),
|
('draft', _('Draft')),
|
||||||
('submit', _('Direct Manager')),
|
('submit', _('Direct Manager')),
|
||||||
|
('accounting', _('Accounting Manager')),
|
||||||
('review', _('Government Relations')),
|
('review', _('Government Relations')),
|
||||||
('confirm', _('HR Manager')),
|
('confirm', _('HR Manager')),
|
||||||
('done', _('Financial Manager')),
|
('accounting_final', _('Accounting Manager')),
|
||||||
|
('done', _('Done')),
|
||||||
('refuse', _('Refused')),
|
('refuse', _('Refused')),
|
||||||
# ('cancelled', _('Cancelled')),
|
# ('cancelled', _('Cancelled')),
|
||||||
]
|
]
|
||||||
|
|
@ -93,11 +95,17 @@ class HrTicketing(models.Model):
|
||||||
self.write({'state': 'submit'})
|
self.write({'state': 'submit'})
|
||||||
|
|
||||||
def review(self):
|
def review(self):
|
||||||
|
self.write({'state': 'accounting'})
|
||||||
|
|
||||||
|
def accounting(self):
|
||||||
self.write({'state': 'review'})
|
self.write({'state': 'review'})
|
||||||
|
|
||||||
def confirm(self):
|
def confirm(self):
|
||||||
self.write({'state': 'confirm'})
|
self.write({'state': 'confirm'})
|
||||||
|
|
||||||
|
def accounting_final(self):
|
||||||
|
self.write({'state': 'accounting_final'})
|
||||||
|
|
||||||
def action_done(self):
|
def action_done(self):
|
||||||
if self.cost_of_tickets > 0:
|
if self.cost_of_tickets > 0:
|
||||||
debit_line_vals = {
|
debit_line_vals = {
|
||||||
|
|
|
||||||
|
|
@ -7,4 +7,9 @@ access_hr_airline_hr,hr.airline.hr.manager,model_hr_airline,hr.group_hr_manager,
|
||||||
access_airline_agent,airline.agent,model_airline_agent,base.group_user,1,0,0,0
|
access_airline_agent,airline.agent,model_airline_agent,base.group_user,1,0,0,0
|
||||||
access_airline_agent_hr,airline.agent.manager,model_airline_agent,hr.group_hr_manager,1,1,1,1
|
access_airline_agent_hr,airline.agent.manager,model_airline_agent,hr.group_hr_manager,1,1,1,1
|
||||||
access_hr_airline_city_user,hr_airline_city_user,model_hr_airline_city,base.group_user,1,0,0,0
|
access_hr_airline_city_user,hr_airline_city_user,model_hr_airline_city,base.group_user,1,0,0,0
|
||||||
access_hr_airline_city_manager,hr_airline_city_manager,model_hr_airline_city,hr.group_hr_manager,1,1,1,1
|
access_hr_airline_city_manager,hr_airline_city_manager,model_hr_airline_city,hr.group_hr_manager,1,1,1,1
|
||||||
|
access_hr_ticket_request_accounting,hr.ticket.request.accounting,model_hr_ticket_request,hr_base.group_account_manager,1,1,1,1
|
||||||
|
access_hr_ticket_request_type_accounting,hr.ticket.request.type.accounting,model_hr_ticket_request_type,hr_base.group_account_manager,1,1,1,1
|
||||||
|
access_hr_airline_accounting,hr.airline.accounting,model_hr_airline,hr_base.group_account_manager,1,1,1,1
|
||||||
|
access_hr_airline_city_accounting,hr.airline.city.accounting,model_hr_airline_city,hr_base.group_account_manager,1,1,1,1
|
||||||
|
access_airline_agent_accounting,airline.agent.accounting,model_airline_agent,hr_base.group_account_manager,1,1,1,1
|
||||||
|
|
|
@ -20,20 +20,24 @@
|
||||||
|
|
||||||
<button name="review" states="submit" string="Direct Manager" type="object" class="oe_highlight"
|
<button name="review" states="submit" string="Direct Manager" type="object" class="oe_highlight"
|
||||||
groups="hr_base.group_division_manager"/>
|
groups="hr_base.group_division_manager"/>
|
||||||
<button name="refuse" states="submit" string="Refuse" type="object" class="oe_highlight"
|
|
||||||
groups="hr_base.group_division_manager"/>
|
<button name="accounting" states="accounting" string="Accounting Manager" type="object" class="oe_highlight"
|
||||||
|
groups="hr_base.group_account_manager"/>
|
||||||
|
|
||||||
<button name="confirm" states="review" string="Government Relations" type="object"
|
<button name="confirm" states="review" string="Government Relations" type="object"
|
||||||
class="oe_highlight"
|
class="oe_highlight"
|
||||||
groups="hr_base.group_government_relations"/>
|
groups="hr_base.group_government_relations"/>
|
||||||
<button name="refuse" states="review" string="Refuse" type="object" class="oe_highlight"
|
|
||||||
groups="hr_base.group_government_relations"/>
|
|
||||||
|
|
||||||
<button name="action_done" states="confirm" string="HR Manager" type="object"
|
<button name="accounting_final" states="confirm" string="HR Manager" type="object"
|
||||||
class="oe_highlight"
|
class="oe_highlight"
|
||||||
groups="hr.group_hr_manager"/>
|
groups="hr.group_hr_manager"/>
|
||||||
<button name="refuse" states="confirm" string="Refuse" type="object" class="oe_highlight"
|
|
||||||
groups="hr.group_hr_manager"/>
|
<button name="action_done" states="accounting_final" string="Financial Manager" type="object"
|
||||||
|
class="oe_highlight"
|
||||||
|
groups="hr_base.group_account_manager"/>
|
||||||
|
|
||||||
|
<button name="refuse" states="submit,accounting_final,confirm,review,accounting" string="Refuse" type="object" class="oe_highlight"
|
||||||
|
groups="hr.group_hr_manager,hr_base.group_government_relations,hr_base.group_account_manager,hr_base.group_division_manager"/>
|
||||||
|
|
||||||
<button name="re_draft" string="Re-Draft" type="object" class="oe_highlight"
|
<button name="re_draft" string="Re-Draft" type="object" class="oe_highlight"
|
||||||
states="refuse,done"
|
states="refuse,done"
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,9 @@ class hr_exit_return(models.Model):
|
||||||
("draft", "Draft"),
|
("draft", "Draft"),
|
||||||
("request", "Employee Request"),
|
("request", "Employee Request"),
|
||||||
("send", "Direct Manager"),
|
("send", "Direct Manager"),
|
||||||
|
("accounting", "Accounting Manager"),
|
||||||
("confirm", "Government Relations"),
|
("confirm", "Government Relations"),
|
||||||
|
("accounting_final", "Accounting Manager"),
|
||||||
("done", "Approved"),
|
("done", "Approved"),
|
||||||
("refuse", "Refuse")
|
("refuse", "Refuse")
|
||||||
], default='draft', tracking=True)
|
], default='draft', tracking=True)
|
||||||
|
|
@ -88,7 +90,7 @@ class hr_exit_return(models.Model):
|
||||||
for item in self:
|
for item in self:
|
||||||
if item.account_move_id:
|
if item.account_move_id:
|
||||||
if item.account_move_id.state == 'draft':
|
if item.account_move_id.state == 'draft':
|
||||||
item.account_move_id.state = 'canceled'
|
item.account_move_id.button_cancel()
|
||||||
item.account_move_id = False
|
item.account_move_id = False
|
||||||
self.state = 'draft'
|
self.state = 'draft'
|
||||||
else:
|
else:
|
||||||
|
|
@ -105,8 +107,14 @@ class hr_exit_return(models.Model):
|
||||||
self.state = 'confirm'
|
self.state = 'confirm'
|
||||||
else:
|
else:
|
||||||
self.state = 'done'
|
self.state = 'done'
|
||||||
|
|
||||||
|
def accounting(self):
|
||||||
|
self.state = 'accounting'
|
||||||
|
|
||||||
def financial_manager(self):
|
def financial_manager(self):
|
||||||
|
self.state = 'accounting_final'
|
||||||
|
|
||||||
|
def accounting_final(self):
|
||||||
for item in self:
|
for item in self:
|
||||||
if item.on_employee_fair == False and item.cost > 0:
|
if item.on_employee_fair == False and item.cost > 0:
|
||||||
debit_line_vals = {
|
debit_line_vals = {
|
||||||
|
|
@ -129,12 +137,12 @@ class hr_exit_return(models.Model):
|
||||||
'ref': 'Exit and Return',
|
'ref': 'Exit and Return',
|
||||||
'line_ids': [(0, 0, debit_line_vals), (0, 0, credit_line_vals)],
|
'line_ids': [(0, 0, debit_line_vals), (0, 0, credit_line_vals)],
|
||||||
'res_model': 'hr.exit.return',
|
'res_model': 'hr.exit.return',
|
||||||
'res_id': self.id
|
'res_id': item.id
|
||||||
})
|
})
|
||||||
self.account_move_id = move_id.id
|
item.account_move_id = move_id.id
|
||||||
|
|
||||||
self.state = 'done'
|
|
||||||
|
|
||||||
|
item.state = 'done'
|
||||||
|
|
||||||
def refuse(self):
|
def refuse(self):
|
||||||
self.state = 'refuse'
|
self.state = 'refuse'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,12 @@ class hr_request_visa(models.Model):
|
||||||
("draft", "Draft"),
|
("draft", "Draft"),
|
||||||
("request", "Employee Request"),
|
("request", "Employee Request"),
|
||||||
("send", "Direct Manager"),
|
("send", "Direct Manager"),
|
||||||
|
("accounting", "Accounting Manager"),
|
||||||
("confirm", "Government Relations"),
|
("confirm", "Government Relations"),
|
||||||
("done", "HR Approve"),
|
("accounting_final", "Accounting Manager"),
|
||||||
|
("done", "Done"),
|
||||||
("refuse", "Refuse")
|
("refuse", "Refuse")
|
||||||
], default='draft', )
|
], default='draft', tracking=True)
|
||||||
religion = fields.Selection(selection=[('muslim', 'Muslim'), ('christian', 'Christian'), ('other', 'Other')],
|
religion = fields.Selection(selection=[('muslim', 'Muslim'), ('christian', 'Christian'), ('other', 'Other')],
|
||||||
default="muslim")
|
default="muslim")
|
||||||
from_hr = fields.Boolean()
|
from_hr = fields.Boolean()
|
||||||
|
|
@ -70,10 +72,13 @@ class hr_request_visa(models.Model):
|
||||||
else:
|
else:
|
||||||
self.state = 'draft'
|
self.state = 'draft'
|
||||||
|
|
||||||
|
def accounting(self):
|
||||||
|
self.state = 'accounting'
|
||||||
|
|
||||||
def hr_manager(self):
|
def hr_manager(self):
|
||||||
self.state = 'confirm'
|
self.state = 'confirm'
|
||||||
|
|
||||||
def financial_manager(self):
|
def accounting_final(self):
|
||||||
for item in self:
|
for item in self:
|
||||||
if item.cost > 0:
|
if item.cost > 0:
|
||||||
debit_line_vals = {
|
debit_line_vals = {
|
||||||
|
|
@ -95,10 +100,13 @@ class hr_request_visa(models.Model):
|
||||||
'ref': 'Exit and Return',
|
'ref': 'Exit and Return',
|
||||||
'line_ids': [(0, 0, debit_line_vals), (0, 0, credit_line_vals)]
|
'line_ids': [(0, 0, debit_line_vals), (0, 0, credit_line_vals)]
|
||||||
})
|
})
|
||||||
self.account_move_id = move_id.id
|
item.account_move_id = move_id.id
|
||||||
|
|
||||||
self.state = 'done'
|
self.state = 'done'
|
||||||
|
|
||||||
|
def financial_manager(self):
|
||||||
|
self.state = 'accounting_final'
|
||||||
|
|
||||||
def refuse(self):
|
def refuse(self):
|
||||||
self.state = 'refuse'
|
self.state = 'refuse'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,3 +9,8 @@ hr_request_visa_emp,hr.request.visa.emp,model_hr_request_visa,base.group_user,1,
|
||||||
hr_request_visa_managr,hr.request.visa.manger,model_hr_request_visa,hr_base.group_division_manager,1,1,1,1
|
hr_request_visa_managr,hr.request.visa.manger,model_hr_request_visa,hr_base.group_division_manager,1,1,1,1
|
||||||
hr_request_visa_hr,hr.request.visa.hr,model_hr_request_visa,hr.group_hr_user,1,1,1,1
|
hr_request_visa_hr,hr.request.visa.hr,model_hr_request_visa,hr.group_hr_user,1,1,1,1
|
||||||
hr_request_visa_gov,hr.request.visa.gov,model_hr_request_visa,hr_base.group_government_relations,1,1,1,1
|
hr_request_visa_gov,hr.request.visa.gov,model_hr_request_visa,hr_base.group_government_relations,1,1,1,1
|
||||||
|
|
||||||
|
access_hr_exit_return_accounting,hr.exit.return.accounting,model_hr_exit_return,hr_base.group_account_manager,1,1,1,1
|
||||||
|
access_hr_renew_official_paper_accounting,hr.renew.official.paper.accounting,model_hr_renew_official_paper,hr_base.group_account_manager,1,1,1,1
|
||||||
|
access_hr_official_paper_line_accounting,hr.official.paper.line.accounting,model_hr_official_paper_line,hr_base.group_account_manager,1,1,1,1
|
||||||
|
access_hr_request_visa_accounting,hr.request.visa.accounting,model_hr_request_visa,hr_base.group_account_manager,1,1,1,1
|
||||||
|
|
|
@ -18,21 +18,37 @@
|
||||||
|
|
||||||
<button string="Direct Manager" name="send" type="object" class="oe_highlight" states="request"
|
<button string="Direct Manager" name="send" type="object" class="oe_highlight" states="request"
|
||||||
groups="hr_base.group_division_manager"/>
|
groups="hr_base.group_division_manager"/>
|
||||||
|
|
||||||
|
<button string="Accounting Manager" name="accounting" type="object" class="oe_highlight" states="send"
|
||||||
|
groups="hr_base.group_account_manager"/>
|
||||||
|
|
||||||
|
<button string="Government Relations" name="hr_manager" type="object" class="oe_highlight"
|
||||||
|
states="accounting"
|
||||||
|
groups="hr_base.group_government_relations"/>
|
||||||
|
|
||||||
|
|
||||||
|
<button string="HR Manager" name="financial_manager" class="oe_highlight" type="object"
|
||||||
|
states="confirm"
|
||||||
|
groups="hr.group_hr_user,hr.group_hr_manager"/>
|
||||||
|
|
||||||
|
<button string="Accounting Manager" name="accounting_final" type="object" class="oe_highlight"
|
||||||
|
states="accounting_final"
|
||||||
|
groups="hr_base.group_account_manager"/>
|
||||||
|
|
||||||
|
<button string="Refuse" name="refuse" type="object" class="oe_highlight" states="accounting"
|
||||||
|
groups="hr_base.group_government_relations"/>
|
||||||
|
<button string="Refuse" name="refuse" type="object" class="oe_highlight" states="accounting_final"
|
||||||
|
groups="hr_base.group_account_manager"/>
|
||||||
<button string="Refuse" name="refuse" type="object" class="oe_highlight" states="request"
|
<button string="Refuse" name="refuse" type="object" class="oe_highlight" states="request"
|
||||||
groups="hr_base.group_division_manager"/>
|
groups="hr_base.group_division_manager"/>
|
||||||
|
|
||||||
<button string="Government Relations" name="hr_manager" type="object" class="oe_highlight"
|
|
||||||
states="send"
|
|
||||||
groups="hr_base.group_government_relations"/>
|
|
||||||
<button string="Refuse" name="refuse" type="object" class="oe_highlight" states="send"
|
<button string="Refuse" name="refuse" type="object" class="oe_highlight" states="send"
|
||||||
groups="hr_base.group_government_relations"/>
|
groups="hr_base.group_account_manager"/>
|
||||||
<button string="HR Manager" name="financial_manager" class="oe_highlight" type="object"
|
<button string="Refuse" name="refuse" type="object" class="oe_highlight" states="confirm"
|
||||||
states="confirm"
|
groups="hr.group_hr_user,hr.group_hr_manager"/>
|
||||||
groups="hr.group_hr_user, hr.group_hr_manager"/>
|
|
||||||
<button string="Re-draft" name="draft" type="object" class="oe_highlight" states="refuse,done"
|
<button string="Re-draft" name="draft" type="object" class="oe_highlight" states="refuse,done"
|
||||||
groups="hr.group_hr_user" confirm="Are you sure to Reset To Draft This Record?"/>
|
groups="hr.group_hr_user" confirm="Are you sure to Reset To Draft This Record?"/>
|
||||||
<button string="Refuse" name="refuse" type="object" class="oe_highlight" states="confirm"
|
|
||||||
groups="hr.group_hr_user, hr.group_hr_manager"/>
|
|
||||||
<field name="state" widget="statusbar"/>
|
<field name="state" widget="statusbar"/>
|
||||||
|
|
||||||
</header>
|
</header>
|
||||||
|
|
|
||||||
|
|
@ -21,18 +21,31 @@
|
||||||
<button string="Refuse" name="refuse" type="object" class="oe_highlight" states="request"
|
<button string="Refuse" name="refuse" type="object" class="oe_highlight" states="request"
|
||||||
groups="hr_base.group_division_manager"/>
|
groups="hr_base.group_division_manager"/>
|
||||||
|
|
||||||
<button string="Government Relations" name="hr_manager" type="object" class="oe_highlight"
|
<button string="Accounting Manager" name="accounting" type="object" class="oe_highlight" states="send"
|
||||||
states="send"
|
groups="hr_base.group_account_manager"/>
|
||||||
groups="hr_base.group_government_relations"/>
|
|
||||||
<button string="Refuse" name="refuse" type="object" class="oe_highlight" states="send"
|
<button string="Refuse" name="refuse" type="object" class="oe_highlight" states="send"
|
||||||
|
groups="hr_base.group_account_manager"/>
|
||||||
|
|
||||||
|
<button string="Government Relations" name="hr_manager" type="object" class="oe_highlight"
|
||||||
|
states="accounting"
|
||||||
groups="hr_base.group_government_relations"/>
|
groups="hr_base.group_government_relations"/>
|
||||||
|
<button string="Refuse" name="refuse" type="object" class="oe_highlight" states="accounting"
|
||||||
|
groups="hr_base.group_government_relations"/>
|
||||||
|
|
||||||
<button string="HR Manager" name="financial_manager" class="oe_highlight" type="object"
|
<button string="HR Manager" name="financial_manager" class="oe_highlight" type="object"
|
||||||
states="confirm"
|
states="confirm"
|
||||||
groups="hr.group_hr_user, hr.group_hr_manager"/>
|
groups="hr.group_hr_user, hr.group_hr_manager"/>
|
||||||
<button string="Re-draft" name="draft" type="object" class="oe_highlight" states="refuse,done"
|
|
||||||
groups="hr.group_hr_user" confirm="Are you sure to Reset To Draft This Record?"/>
|
|
||||||
<button string="Refuse" name="refuse" type="object" class="oe_highlight" states="confirm"
|
<button string="Refuse" name="refuse" type="object" class="oe_highlight" states="confirm"
|
||||||
groups="hr.group_hr_user, hr.group_hr_manager"/>
|
groups="hr.group_hr_user, hr.group_hr_manager"/>
|
||||||
|
|
||||||
|
<button string="Accounting Manager" name="accounting_final" type="object" class="oe_highlight" states="accounting_final"
|
||||||
|
groups="hr_base.group_account_manager"/>
|
||||||
|
<button string="Refuse" name="refuse" type="object" class="oe_highlight" states="accounting_final"
|
||||||
|
groups="hr_base.group_account_manager"/>
|
||||||
|
|
||||||
|
<button string="Re-draft" name="draft" type="object" class="oe_highlight" states="refuse,done"
|
||||||
|
groups="hr.group_hr_user" confirm="Are you sure to Reset To Draft This Record?"/>
|
||||||
<field name="state" widget="statusbar"/>
|
<field name="state" widget="statusbar"/>
|
||||||
|
|
||||||
</header>
|
</header>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue