Port account_move_line_report_xls: V8 API
parent
ea6635cc0f
commit
3422b554dc
|
@ -21,8 +21,8 @@
|
|||
##############################################################################
|
||||
|
||||
try:
|
||||
from . import account_move_line
|
||||
from . import report
|
||||
import account_move_line
|
||||
import report
|
||||
except ImportError:
|
||||
import logging
|
||||
logging.getLogger('openerp.module').\
|
||||
|
|
|
@ -20,14 +20,15 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
from openerp.osv import orm
|
||||
from openerp import models, api
|
||||
|
||||
|
||||
class account_move_line(orm.Model):
|
||||
class account_move_line(models.Model):
|
||||
_inherit = 'account.move.line'
|
||||
|
||||
# override list in custom module to add/drop columns or change order
|
||||
def _report_xls_fields(self, cr, uid, context=None):
|
||||
@api.multi
|
||||
def _report_xls_fields(self):
|
||||
return [
|
||||
'move', 'name', 'date', 'journal', 'period', 'partner', 'account',
|
||||
'date_maturity', 'debit', 'credit', 'balance',
|
||||
|
@ -40,7 +41,8 @@ class account_move_line(orm.Model):
|
|||
]
|
||||
|
||||
# Change/Add Template entries
|
||||
def _report_xls_template(self, cr, uid, context=None):
|
||||
@api.multi
|
||||
def _report_xls_template(self):
|
||||
"""
|
||||
Template updates, e.g.
|
||||
|
||||
|
|
|
@ -20,4 +20,4 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
from . import move_line_list_xls
|
||||
import move_line_list_xls
|
||||
|
|
|
@ -134,9 +134,9 @@ class move_line_xls(report_xls):
|
|||
'header': [1, 13, 'text', _render("_('Maturity Date')")],
|
||||
'lines':
|
||||
[1, 0,
|
||||
_render("line.date_maturity.val and 'date' or 'text'"),
|
||||
_render("line.date_maturity and 'date' or 'text'"),
|
||||
_render(
|
||||
"line.date_maturity.val \
|
||||
"line.date_maturity \
|
||||
and datetime.strptime(line.date_maturity,'%Y-%m-%d') \
|
||||
or None"),
|
||||
None, self.aml_cell_style_date],
|
||||
|
|
Loading…
Reference in New Issue