[FIX] exp_transaction_report
This commit is contained in:
parent
a9f7cc0671
commit
ec2f0563ad
|
|
@ -20,9 +20,12 @@
|
|||
<h4 style="text-align:center;font-weight:bold">Late Transaction Report</h4>
|
||||
<br/>
|
||||
<div style="width:100%;">
|
||||
<h4 style="text-align:right;font-weight:bold;display:inline-block;">Start Date
|
||||
<h4 style="text-align:right;font-weight:bold;display:inline-block;width:30%">Start Date
|
||||
<t t-esc="date_start"/>
|
||||
</h4>
|
||||
<h4 style="text-align:left;font-weight:bold;display:inline-block;width:30%;">End Date
|
||||
<t t-esc="date_end"/>
|
||||
</h4>
|
||||
</div>
|
||||
<t t-foreach="key" t-as="doc">
|
||||
<br/>
|
||||
|
|
|
|||
|
|
@ -132,16 +132,16 @@ class ReportAchievementTransaction(models.AbstractModel):
|
|||
start_date = data['form']['start_date']
|
||||
end_date = data['form']['end_date']
|
||||
# edit by fatma rida to make warning message if no data
|
||||
if final_dic:
|
||||
return {
|
||||
'doc_ids': data['ids'],
|
||||
'doc_model': data['model'],
|
||||
'date_start': start_date,
|
||||
'date_end': end_date,
|
||||
'data': final_dic,
|
||||
}
|
||||
else:
|
||||
raise UserError(_("""No data for your selection\n"""))
|
||||
# if final_dic:
|
||||
return {
|
||||
'doc_ids': data['ids'],
|
||||
'doc_model': data['model'],
|
||||
'date_start': start_date,
|
||||
'date_end': end_date,
|
||||
'data': final_dic,
|
||||
}
|
||||
# else:
|
||||
# raise UserError(_("""No data for your selection\n"""))
|
||||
|
||||
|
||||
class AchievementReportXls(models.AbstractModel):
|
||||
|
|
|
|||
|
|
@ -123,16 +123,16 @@ class ReportForwardTransaction(models.AbstractModel):
|
|||
start_date = data['form']['start_date']
|
||||
end_date = data['form']['end_date']
|
||||
# edit by fatma rida to make warning message if no data
|
||||
if my_key:
|
||||
return {
|
||||
'doc_ids': data['ids'],
|
||||
'doc_model': data['model'],
|
||||
'date_start': start_date,
|
||||
'date_end': end_date,
|
||||
'group_dic': final_dic,
|
||||
'key': my_key,
|
||||
}
|
||||
else:
|
||||
raise UserError(_("""No data for your selection\n"""))
|
||||
# if my_key:
|
||||
return {
|
||||
'doc_ids': data['ids'],
|
||||
'doc_model': data['model'],
|
||||
'date_start': start_date,
|
||||
'date_end': end_date,
|
||||
'group_dic': final_dic,
|
||||
'key': my_key,
|
||||
}
|
||||
# else:
|
||||
# raise UserError(_("""No data for your selection\n"""))
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -143,15 +143,15 @@ class ReportIncomingTransaction(models.AbstractModel):
|
|||
start_date = data['form']['start_date']
|
||||
end_date = data['form']['end_date']
|
||||
# edit by fatma rida to make warning message if no data
|
||||
if my_key:
|
||||
return {
|
||||
'doc_ids': data['ids'],
|
||||
'doc_model': data['model'],
|
||||
'date_start': start_date,
|
||||
'date_end': end_date,
|
||||
'group_dic': final_dic,
|
||||
'key': my_key,
|
||||
}
|
||||
else:
|
||||
raise UserError(_("""No data for your selection\n"""))
|
||||
# if my_key:
|
||||
return {
|
||||
'doc_ids': data['ids'],
|
||||
'doc_model': data['model'],
|
||||
'date_start': start_date,
|
||||
'date_end': end_date,
|
||||
'group_dic': final_dic,
|
||||
'key': my_key,
|
||||
}
|
||||
# else:
|
||||
# raise UserError(_("""No data for your selection\n"""))
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ class LateTransactionReportWizard(models.TransientModel):
|
|||
'type_transact': self.type_transact,
|
||||
'entity_ids': self.entity_ids.ids,
|
||||
'start_date': self.start_date,
|
||||
'end_date': self.end_date,
|
||||
},
|
||||
}
|
||||
return self.env.ref('exp_transaction_report.late_transaction_complete_report').report_action(self, data=data)
|
||||
|
|
@ -62,13 +63,14 @@ class ReportIncomingTransaction(models.AbstractModel):
|
|||
type_transact = data['form']['type_transact']
|
||||
entity_ids = data['form']['entity_ids']
|
||||
start_date = data['form']['start_date']
|
||||
end_date = data['form']['end_date']
|
||||
docs = []
|
||||
x = False
|
||||
if type_transact == 'incoming':
|
||||
domain = []
|
||||
employee_ids = self.env['cm.entity'].browse(entity_ids)
|
||||
domain.extend((('transaction_date', '>=', start_date),
|
||||
('to_ids', 'in', employee_ids.ids), ('state', 'in', ['send', 'reply'])))
|
||||
('transaction_date', '<=', end_date), ('to_ids', 'in', employee_ids.ids), ('state', 'in', ['send', 'reply'])))
|
||||
incoming_ids = self.env['incoming.transaction'].search(domain, order="transaction_date desc")
|
||||
if incoming_ids:
|
||||
today = fields.date.today()
|
||||
|
|
@ -85,7 +87,7 @@ class ReportIncomingTransaction(models.AbstractModel):
|
|||
domain = []
|
||||
employee_ids = self.env['cm.entity'].browse(entity_ids)
|
||||
domain.extend((('transaction_date', '>=', start_date),
|
||||
('to_ids', 'in', employee_ids.ids), ('state', 'in', ['send', 'reply'])))
|
||||
('transaction_date', '<=', end_date), ('to_ids', 'in', employee_ids.ids), ('state', 'in', ['send', 'reply'])))
|
||||
internal_ids = self.env['internal.transaction'].search(domain, order="transaction_date desc")
|
||||
if internal_ids:
|
||||
today = fields.date.today()
|
||||
|
|
@ -102,7 +104,7 @@ class ReportIncomingTransaction(models.AbstractModel):
|
|||
domain = []
|
||||
employee_ids = self.env['cm.entity'].browse(entity_ids)
|
||||
domain.extend((('transaction_date', '>=', start_date),
|
||||
('to_ids', 'in', employee_ids.ids), ('state', 'in', ['send', 'reply'])))
|
||||
('transaction_date', '<=', end_date), ('to_ids', 'in', employee_ids.ids), ('state', 'in', ['send', 'reply'])))
|
||||
incoming_ids = self.env['incoming.transaction'].search(domain, order="transaction_date desc")
|
||||
if incoming_ids:
|
||||
today = fields.date.today()
|
||||
|
|
@ -143,15 +145,17 @@ class ReportIncomingTransaction(models.AbstractModel):
|
|||
def _get_report_values(self, docids, data=None):
|
||||
final_dic, my_key = self.get_value(data)
|
||||
start_date = data['form']['start_date']
|
||||
end_date = data['form']['end_date']
|
||||
# edit by fatma rida to make warning message if no data
|
||||
if my_key:
|
||||
return {
|
||||
'doc_ids': data['ids'],
|
||||
'doc_model': data['model'],
|
||||
'date_start': start_date,
|
||||
'group_dic': final_dic,
|
||||
'key': my_key,
|
||||
}
|
||||
else:
|
||||
raise UserError(_("""No data for your selection\n"""))
|
||||
# if my_key:
|
||||
return {
|
||||
'doc_ids': data['ids'],
|
||||
'doc_model': data['model'],
|
||||
'date_start': start_date,
|
||||
'date_end': end_date,
|
||||
'group_dic': final_dic,
|
||||
'key': my_key,
|
||||
}
|
||||
# else:
|
||||
# raise UserError(_("""No data for your selection\n"""))
|
||||
|
||||
|
|
|
|||
|
|
@ -6,9 +6,6 @@
|
|||
<field name="model">late.transaction.report.wizard</field>
|
||||
<field name="inherit_id" ref="exp_transaction_report.common_transaction_report_wizard_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='end_date']" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//form" position="inside">
|
||||
<footer>
|
||||
<button string="Print Report" type="object" name="print_report" class="oe_highlight"/>
|
||||
|
|
|
|||
|
|
@ -123,15 +123,15 @@ class ReportOutgoingTransaction(models.AbstractModel):
|
|||
start_date = data['form']['start_date']
|
||||
end_date = data['form']['end_date']
|
||||
# edit by fatma rida to make warning message if no data
|
||||
if my_key:
|
||||
return {
|
||||
'doc_ids': data['ids'],
|
||||
'doc_model': data['model'],
|
||||
'date_start': start_date,
|
||||
'date_end': end_date,
|
||||
'group_dic': final_dic,
|
||||
'key': my_key,
|
||||
}
|
||||
else:
|
||||
raise UserError(_("""No data for your selection\n"""))
|
||||
# if my_key:
|
||||
return {
|
||||
'doc_ids': data['ids'],
|
||||
'doc_model': data['model'],
|
||||
'date_start': start_date,
|
||||
'date_end': end_date,
|
||||
'group_dic': final_dic,
|
||||
'key': my_key,
|
||||
}
|
||||
# else:
|
||||
# raise UserError(_("""No data for your selection\n"""))
|
||||
|
||||
|
|
|
|||
|
|
@ -104,16 +104,16 @@ class ReportOutstandingTransaction(models.AbstractModel):
|
|||
start_date = data['form']['start_date']
|
||||
end_date = data['form']['end_date']
|
||||
# edit by fatma rida to make warning message if no data
|
||||
if my_key:
|
||||
return {
|
||||
'doc_ids': data['ids'],
|
||||
'doc_model': data['model'],
|
||||
'date_start': start_date,
|
||||
'date_end': end_date,
|
||||
'name': name,
|
||||
'group_dic': final_dic,
|
||||
'key': my_key,
|
||||
}
|
||||
else:
|
||||
raise UserError(_("""No data for your selection\n"""))
|
||||
# if my_key:
|
||||
return {
|
||||
'doc_ids': data['ids'],
|
||||
'doc_model': data['model'],
|
||||
'date_start': start_date,
|
||||
'date_end': end_date,
|
||||
'name': name,
|
||||
'group_dic': final_dic,
|
||||
'key': my_key,
|
||||
}
|
||||
# else:
|
||||
# raise UserError(_("""No data for your selection\n"""))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue