Browse Source

Port account_move_line_report_xls: V8 API

pull/757/head
Guillaume Auger 10 years ago
committed by dsolanki
parent
commit
be297c3558
  1. 4
      account_move_line_report_xls/__init__.py
  2. 10
      account_move_line_report_xls/account_move_line.py
  3. 2
      account_move_line_report_xls/report/__init__.py
  4. 4
      account_move_line_report_xls/report/move_line_list_xls.py

4
account_move_line_report_xls/__init__.py

@ -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').\

10
account_move_line_report_xls/account_move_line.py

@ -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.

2
account_move_line_report_xls/report/__init__.py

@ -20,4 +20,4 @@
#
##############################################################################
from . import move_line_list_xls
import move_line_list_xls

4
account_move_line_report_xls/report/move_line_list_xls.py

@ -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…
Cancel
Save