Description
@@ -218,7 +218,7 @@
[[ repeatIn(o.invoice_line,'l') ]]
-
+
[[ l.name ]]
@@ -315,10 +315,10 @@
-
+
|
- Tax
+ Tax [[ o.tax_line==[] and removeParentNode('blockTable') ]]
|
Base
@@ -335,7 +335,7 @@
[[ repeatIn(o.tax_line,'t') ]]
-
+
|
[[ t.name ]]
@@ -354,11 +354,14 @@
|
+
+
+
[[ (o.comment and format(o.comment )) or removeParentNode('para') ]]
- [[ (o.payment_term.note and format(o.payment_term and o.payment_term.note)) or removeParentNode('para') ]]
+ [[ (o.payment_term and o.payment_term.note and format(o.payment_term and o.payment_term.note)) or removeParentNode('para') ]]
@@ -368,7 +371,7 @@
Fiscal Position Remark :
|
- [[ (o.fiscal_position.note and format(o.fiscal_position and o.fiscal_position.note)) or removeParentNode('blockTable') ]]
+ [[ (o.fiscal_position and o.fiscal_position.note and format(o.fiscal_position.note)) or removeParentNode('blockTable') ]]
|
diff --git a/addons/account/report/account_tax_report.py b/addons/account/report/account_tax_report.py
index d3fb791bfaa..d968ee9029e 100644
--- a/addons/account/report/account_tax_report.py
+++ b/addons/account/report/account_tax_report.py
@@ -37,9 +37,26 @@ class tax_report(rml_parse.rml_parse):
'get_company': self._get_company,
'get_currency': self._get_currency,
'get_lines': self._get_lines,
+ 'get_years': self.get_years,
})
+ def get_years(self,form):
+ res={}
+ fiscal_year_name = self.pool.get('account.fiscalyear').name_get(self.cr,self.uid,form['fiscalyear'])
+
+ if fiscal_year_name:
+ res['fname'] = fiscal_year_name[0][1]
+ res['periods'] = ''
+ if form['periods']:
+ periods_l = self.pool.get('account.period').read(self.cr, self.uid, form['periods'], ['name'])
+ for period in periods_l:
+ if res['periods']=='':
+ res['periods'] = period['name']
+ else:
+ res['periods'] += ", "+ period['name']
+ return res
+
def _get_lines(self, based_on, period_list, company_id=False, parent=False, level=0, context={}):
res = self._get_codes(based_on, company_id, parent, level, period_list, context=context)
diff --git a/addons/account/report/account_tax_report.rml b/addons/account/report/account_tax_report.rml
index 2434437e803..47df92cc3bc 100644
--- a/addons/account/report/account_tax_report.rml
+++ b/addons/account/report/account_tax_report.rml
@@ -105,6 +105,16 @@
Tax Statement
+
+
+
+ | Year : [[ get_years(data['form'])['fname'] ]] |
+
+
+ | Periods : [[ get_years(data['form'])['periods'] or removeParentNode('tr')]] |
+
+
+
| Tax Name |
diff --git a/addons/account/wizard/account_vat.py b/addons/account/wizard/account_vat.py
index 80f4f8360a1..0c33517d428 100644
--- a/addons/account/wizard/account_vat.py
+++ b/addons/account/wizard/account_vat.py
@@ -24,13 +24,14 @@ from osv import osv, fields
class account_vat_declaration(osv.osv_memory):
_name = 'account.vat.declaration'
_description = 'Account Vat Declaration'
-
+ _inherit = "account.common.account.report"
_columns = {
- 'based_on': fields.selection([('invoices','Invoices'),
- ('payments','Payments'),],
+ 'based_on': fields.selection([('invoices','Invoices'),
+ ('payments','Payments'),],
'Based On', required=True),
'company_id': fields.many2one('res.company', 'Company', required=True),
'periods': fields.many2many('account.period', 'vat_period_rel', 'vat_id', 'period_id', 'Periods', help="All periods if empty"),
+ 'fiscalyear': fields.many2many('account.fiscalyear','vat_fiscal_rel','fiscal_id','Fiscal Year',required=True),
}
def _get_company(self, cr, uid, context={}):
@@ -38,14 +39,14 @@ class account_vat_declaration(osv.osv_memory):
company_obj = self.pool.get('res.company')
user = user_obj.browse(cr, uid, uid, context=context)
if user.company_id:
- return user.company_id.id
+ return user.company_id.id
else:
return company_obj.search(cr, uid, [('parent_id', '=', False)])[0]
_defaults = {
- 'based_on': 'invoices',
- 'company_id': _get_company
- }
+ 'based_on': 'invoices',
+ 'company_id': _get_company
+ }
def create_vat(self, cr, uid, ids, context={}):
if context is None:
@@ -57,8 +58,7 @@ class account_vat_declaration(osv.osv_memory):
'type': 'ir.actions.report.xml',
'report_name': 'account.vat.declaration',
'datas': datas,
- }
-
+ }
account_vat_declaration()
#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_vat_view.xml b/addons/account/wizard/account_vat_view.xml
index 16bb39e22cd..41c0faa2c79 100644
--- a/addons/account/wizard/account_vat_view.xml
+++ b/addons/account/wizard/account_vat_view.xml
@@ -10,10 +10,12 @@
| |