trasaction_commit_reserve
This commit is contained in:
parent
ae736aeca0
commit
5988fa6fbc
|
|
@ -74,7 +74,8 @@ class InternalTransaction(models.Model):
|
|||
self.partner_id = False
|
||||
|
||||
partner_id = fields.Many2one('res.partner', string='Partner', readonly=True,
|
||||
related='to_ids.manager_id.partner_id')
|
||||
related='to_ids.secretary_id.partner_id')
|
||||
# related='to_ids.manager_id.partner_id') commintt
|
||||
cc_ids = fields.Many2many(comodel_name='cm.entity', relation='internal_entity_cc_rel',
|
||||
column1='internal_id', column2='entity_id', string='CC To')
|
||||
|
||||
|
|
@ -150,12 +151,15 @@ class InternalTransaction(models.Model):
|
|||
if record.subject_type_id.transaction_need_approve or record.preparation_id.need_approve:
|
||||
template = 'exp_transaction_documents.internal_approval1_request_email'
|
||||
sent = 'waite'
|
||||
if record.type_sender == 'employee' and record.subject_type_id.transaction_need_approve:
|
||||
record.state='to_approve'
|
||||
elif record.type_sender != 'employee' and record.to_ids.need_approve and record.subject_type_id.transaction_need_approve:
|
||||
record.state = 'to_approve'
|
||||
else:
|
||||
record.state = 'send'
|
||||
|
||||
# record.state = 'to_approve'
|
||||
# commintt
|
||||
# if record.type_sender == 'employee' and record.subject_type_id.transaction_need_approve:
|
||||
# record.state='to_approve'
|
||||
# elif record.type_sender != 'employee' and record.to_ids.need_approve and record.subject_type_id.transaction_need_approve:
|
||||
# record.state = 'to_approve'
|
||||
# else:
|
||||
# record.state = 'send'
|
||||
|
||||
record.trace_create_ids('internal_transaction_id', record, sent)
|
||||
partner_ids = []
|
||||
|
|
@ -169,6 +173,10 @@ class InternalTransaction(models.Model):
|
|||
|
||||
if record.to_user_have_leave:
|
||||
record.forward_user_id = record.receive_id.user_id.id
|
||||
record.state = 'to_approve'
|
||||
# will commintt
|
||||
record.state = 'send'
|
||||
|
||||
|
||||
record.send_message(template=template)
|
||||
subj = _('Message Has been sent!')
|
||||
|
|
@ -191,12 +199,14 @@ class InternalTransaction(models.Model):
|
|||
employee = self.current_employee()
|
||||
|
||||
to_id = self.to_ids.id
|
||||
if self.to_ids.type == 'employee':
|
||||
self.forward_user_id = self.to_ids.user_id.id
|
||||
# commintt
|
||||
# if self.to_ids.type == 'employee':
|
||||
# self.forward_user_id = self.to_ids.user_id.id
|
||||
|
||||
if self.to_ids.type != 'employee':
|
||||
to_id = self.to_ids.secretary_id.id
|
||||
self.forward_user_id = self.to_ids.manager_id.user_id
|
||||
# self.forward_user_id = self.to_ids.manager_id.user_id
|
||||
# commintt
|
||||
self.trace_ids.create({
|
||||
'action': 'sent',
|
||||
'to_id': to_id,
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ class Transaction(models.Model):
|
|||
user = self.env.user
|
||||
em = self.env['cm.entity'].search([('user_id', '=', user.id)], limit=1)
|
||||
return len(em) and em or self.env['cm.entity']
|
||||
#return em
|
||||
# return em
|
||||
|
||||
def compute_receive_id(self):
|
||||
for rec in self:
|
||||
|
|
@ -323,8 +323,8 @@ class Transaction(models.Model):
|
|||
to_id = transaction.to_ids[0].id
|
||||
if transaction.to_ids[0].type != 'employee':
|
||||
to_id = transaction.to_ids.manager_id.id
|
||||
#if transaction.subject_type_id.transaction_need_approve or transaction.preparation_id.need_approve and transaction.state == 'to_approve':
|
||||
if transaction.state == 'to_approve':
|
||||
if transaction.subject_type_id.transaction_need_approve or transaction.preparation_id.need_approve and transaction.state == 'to_approve':
|
||||
|
||||
to_id = transaction.preparation_id.manager_id.id
|
||||
transaction.trace_ids.create({
|
||||
'action': action,
|
||||
|
|
|
|||
|
|
@ -100,21 +100,21 @@
|
|||
<button attrs="{'invisible':['|',('current_is_manager','=',False),('state','!=','to_approve')]}"
|
||||
type="object" name="action_reject_internal" string="Reject" class="oe_highlight"/>
|
||||
|
||||
<!-- <button attrs="{'invisible':['|',('current_is_manager','=',False),('state','!=','to_approve')]}"-->
|
||||
<!-- type="object" name="action_return_internal" string="Return" class="oe_highlight"/>-->
|
||||
<!-- <button attrs="{'invisible':['|',('current_is_forward_user','=',False),('state','not in',['send','reply'])]}"-->
|
||||
<!-- type="object" name="action_forward_internal" string="Forward" class="oe_highlight"/>-->
|
||||
<!-- <button attrs="{'invisible':['|',('current_is_forward_user','=',False),('state','not in',['send','reply'])]}"-->
|
||||
<!-- type="object" name="action_reply_internal" string="Reply" class="oe_highlight"/>-->
|
||||
<!-- <button attrs="{'invisible':['|',('current_is_forward_user','=',False),('state','not in',['send','reply'])]}"-->
|
||||
<!-- type="object" name="action_archive_internal" string="Archive" class="oe_highlight"/>-->
|
||||
<button attrs="{'invisible':['|',('current_is_manager','=',False),('state','!=','to_approve')]}"
|
||||
type="object" name="action_return_internal" string="Return" class="oe_highlight"/>
|
||||
<button attrs="{'invisible':['|',('current_is_forward_user','=',False),('state','not in',['send','reply'])]}"
|
||||
type="object" name="action_forward_internal" string="Forward" class="oe_highlight"/>
|
||||
<button attrs="{'invisible':['|',('current_is_forward_user','=',False),('state','not in',['send','reply'])]}"
|
||||
type="object" name="action_reply_internal" string="Reply" class="oe_highlight"/>
|
||||
<button attrs="{'invisible':['|',('current_is_forward_user','=',False),('state','not in',['send','reply'])]}"
|
||||
type="object" name="action_archive_internal" string="Archive" class="oe_highlight"/>
|
||||
|
||||
|
||||
|
||||
<button attrs="{'invisible':['|',('current_is_manager','=',False),('state','!=','to_approve')]}" type="object" name="action_return_internal" string="Return" class="oe_highlight"/>
|
||||
<button attrs="{'invisible':['|',('current_is_forward_user','=',False),('state','in',['closed','canceled'])]}" type="object" name="action_forward_internal" string="Forward" class="oe_highlight"/>
|
||||
<button attrs="{'invisible':['|',('current_is_forward_user','=',False),('state','in',['closed','canceled'])]}" type="object" name="action_reply_internal" string="Reply" class="oe_highlight"/>
|
||||
<button attrs="{'invisible':['|',('current_is_forward_user','=',False),('state','in',['closed','canceled'])]}" type="object" name="action_archive_internal" string="Archive" class="oe_highlight"/>
|
||||
<!--commintt-->
|
||||
<!-- <button attrs="{'invisible':['|',('current_is_manager','=',False),('state','!=','to_approve')]}" type="object" name="action_return_internal" string="Return" class="oe_highlight"/>-->
|
||||
<!-- <button attrs="{'invisible':['|',('current_is_forward_user','=',False),('state','in',['closed','canceled'])]}" type="object" name="action_forward_internal" string="Forward" class="oe_highlight"/>-->
|
||||
<!-- <button attrs="{'invisible':['|',('current_is_forward_user','=',False),('state','in',['closed','canceled'])]}" type="object" name="action_reply_internal" string="Reply" class="oe_highlight"/>-->
|
||||
<!-- <button attrs="{'invisible':['|',('current_is_forward_user','=',False),('state','in',['closed','canceled'])]}" type="object" name="action_archive_internal" string="Archive" class="oe_highlight"/>-->
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue