forked from OCA/l10n-switzerland
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Iryna Vyshnevska
committed
Mar 27, 2019
1 parent
29648d5
commit 7ddcafc
Showing
9 changed files
with
81 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
# Copyright 2015 Yannick Vaucher (Camptocamp SA) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
from . import models | ||
from .hooks import import_csv_data | ||
|
||
|
||
def post_init(cr, registry): | ||
"""Import CSV data as it is faster than xml and because we can't use | ||
noupdate anymore with csv""" | ||
from openerp.tools import convert_file | ||
filename = 'data/res.bank.csv' | ||
convert_file(cr, 'l10n_ch_bank', filename, None, mode='init', | ||
noupdate=True, kind='init', report=None) | ||
import_csv_data(cr, registry) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright 2019 Camptocamp SA | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) | ||
|
||
from odoo.tools import convert_file | ||
|
||
|
||
def import_csv_data(cr, registry): | ||
"""Import CSV data as it is faster than xml and because we can't use | ||
noupdate anymore with csv""" | ||
filenames = ['data/res.bank.csv'] | ||
for filename in filenames: | ||
convert_file( | ||
cr, 'l10n_ch_bank', | ||
filename, None, mode='init', noupdate=True, | ||
kind='init', report=None, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,37 @@ | ||
odoo.define('l10n_ch_payment_slip.report', function(require){ | ||
'use strict'; | ||
odoo.define('l10n_ch_payment_slip.report', function (require) { | ||
'use strict'; | ||
|
||
var ActionManager= require('web.ActionManager'); | ||
var crash_manager = require('web.crash_manager'); | ||
var framework = require('web.framework'); | ||
var ActionManager= require('web.ActionManager'); | ||
var crash_manager = require('web.crash_manager'); | ||
var framework = require('web.framework'); | ||
|
||
|
||
ActionManager.include({ | ||
ir_actions_report: function (action, options){ | ||
var report_url = ''; | ||
ActionManager.include({ | ||
ir_actions_report: function (action, options) { | ||
var report_url = ''; | ||
|
||
if (action.report_type !== 'reportlab-pdf') { | ||
return this._super(action, options); | ||
} | ||
framework.blockUI(); | ||
report_url = '/report/reportlab-pdf/'.concat( | ||
action.report_name,'/', | ||
action.context.active_ids.join(',') | ||
); | ||
this.getSession().get_file({ | ||
url: report_url, | ||
data: {data: JSON.stringify([report_url, | ||
action.report_type, | ||
])}, | ||
error: crash_manager.rpc_error.bind(crash_manager), | ||
success: function() { | ||
if(action && options && !action.dialog){ | ||
options.on_close(); | ||
} | ||
}, | ||
}); | ||
framework.unblockUI(); | ||
return; | ||
} | ||
}); | ||
if (action.report_type !== 'reportlab-pdf') { | ||
return this._super(action, options); | ||
} | ||
framework.blockUI(); | ||
report_url = '/report/reportlab-pdf/'.concat( | ||
action.report_name, '/', | ||
action.context.active_ids.join(',') | ||
); | ||
this.getSession().get_file({ | ||
url: report_url, | ||
data: {data: JSON.stringify([report_url, | ||
action.report_type, | ||
])}, | ||
error: crash_manager.rpc_error.bind (crash_manager), | ||
success: function() { | ||
if (action && options && !action.dialog) { | ||
options.on_close(); | ||
} | ||
}, | ||
}); | ||
framework.unblockUI(); | ||
return; | ||
}, | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
# Copyright 2011-2017 Camptocamp SA | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
from . import models | ||
from .hooks import import_csv_data | ||
|
||
|
||
def post_init(cr, registry): | ||
"""Import CSV data as it is faster than xml and because we can't use | ||
noupdate anymore with csv""" | ||
from odoo.tools import convert_file | ||
filename = 'data/res.better.zip.csv' | ||
convert_file(cr, 'l10n_ch_zip', filename, None, mode='init', noupdate=True, | ||
kind='init', report=None) | ||
import_csv_data(cr, registry) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright 2019 Camptocamp SA | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) | ||
|
||
from odoo.tools import convert_file | ||
|
||
|
||
def import_csv_data(cr, registry): | ||
"""Import CSV data as it is faster than xml and because we can't use | ||
noupdate anymore with csv""" | ||
filenames = ['data/res.better.zip.csv'] | ||
for filename in filenames: | ||
convert_file( | ||
cr, 'l10n_ch_zip', | ||
filename, None, mode='init', noupdate=True, | ||
kind='init', report=None, | ||
) |