Skip to content
Snippets Groups Projects
Commit 90e9c66a authored by Benjamin - Le Filament's avatar Benjamin - Le Filament
Browse files

[fix] export CG empty values

parent 85d3b56e
No related branches found
No related tags found
No related merge requests found
...@@ -19,8 +19,10 @@ class ExportJournalCg(http.Controller): ...@@ -19,8 +19,10 @@ class ExportJournalCg(http.Controller):
@http.route('/web/export_journal_cg/', type='http', auth="user") @http.route('/web/export_journal_cg/', type='http', auth="user")
@serialize_exception @serialize_exception
def export_journal_cg( def export_journal_cg(
self, date_start, date_end, date_creation_start, date_creation_end, self, company_id,
company_id, partner_ids, **kwargs): date_start=False, date_end=False,
date_creation_start=False, date_creation_end=False,
partner_ids=False, **kwargs):
""" """
Sélectionne les account.move.line correspondants aux journaux Sélectionne les account.move.line correspondants aux journaux
et à la plage de date définis et à la plage de date définis
...@@ -48,7 +50,7 @@ class ExportJournalCg(http.Controller): ...@@ -48,7 +50,7 @@ class ExportJournalCg(http.Controller):
('date', '>=', date_start), ('date', '>=', date_start),
('date', '<=', date_end), ('date', '<=', date_end),
] ]
if date_start and date_end: if date_creation_start and date_creation_end:
domain += [ domain += [
('create_date', '>=', date_creation_start), ('create_date', '>=', date_creation_start),
('create_date', '<=', date_creation_end), ('create_date', '<=', date_creation_end),
......
...@@ -48,13 +48,20 @@ class ExportJournalWizard(models.TransientModel): ...@@ -48,13 +48,20 @@ class ExportJournalWizard(models.TransientModel):
""" """
datas = { datas = {
'export_type': self.export_type, 'export_type': self.export_type,
'date_start': self.date_start,
'date_end': self.date_end,
'date_creation_start': self.date_creation_start,
'date_creation_end': self.date_creation_end,
'company_id': self.company_id.id, 'company_id': self.company_id.id,
'partner_ids': ','.join(str(x) for x in self.partner_ids.ids),
} }
if self.date_start and self.date_end:
datas.update({
'date_start': self.date_start,
'date_end': self.date_end,
})
if self.date_creation_start and self.date_creation_end:
datas.update({
'date_creation_start': self.date_start,
'date_creation_end': self.date_end,
})
if self.partner_ids:
datas['partner_ids'] = ','.join(str(x) for x in self.partner_ids.ids)
return { return {
'type': 'ir.actions.act_url', 'type': 'ir.actions.act_url',
'url': '/web/export_journal_cg?' + urlencode(datas), 'url': '/web/export_journal_cg?' + urlencode(datas),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment