[MRG] merge with main addons.
bzr revid: tpa@tinyerp.com-20111215113037-l72c3ld3kqhxoqlq
@@ -104,6 +104,7 @@ module named account_voucher.
|
||||
'account_invoice_view.xml',
|
||||
'partner_view.xml',
|
||||
'data/account_data.xml',
|
||||
'data/data_financial_report.xml',
|
||||
'data/data_account_type.xml',
|
||||
'account_invoice_workflow.xml',
|
||||
'project/project_view.xml',
|
||||
@@ -122,8 +123,6 @@ module named account_voucher.
|
||||
'ir_sequence_view.xml',
|
||||
'company_view.xml',
|
||||
'board_account_view.xml',
|
||||
"wizard/account_report_profit_loss_view.xml",
|
||||
"wizard/account_report_balance_sheet_view.xml",
|
||||
"edi/invoice_action_data.xml",
|
||||
"account_bank_view.xml",
|
||||
"account_pre_install.yml"
|
||||
|
||||
@@ -130,6 +130,43 @@ account_payment_term_line()
|
||||
class account_account_type(osv.osv):
|
||||
_name = "account.account.type"
|
||||
_description = "Account Type"
|
||||
|
||||
def _get_current_report_type(self, cr, uid, ids, name, arg, context=None):
|
||||
obj_data = self.pool.get('ir.model.data')
|
||||
obj_financial_report = self.pool.get('account.financial.report')
|
||||
res = {}
|
||||
financial_report_ref = {
|
||||
'asset': obj_financial_report.browse(cr, uid, obj_data.get_object_reference(cr, uid, 'account','account_financial_report_assets0')[1], context=context),
|
||||
'liability': obj_financial_report.browse(cr, uid, obj_data.get_object_reference(cr, uid, 'account','account_financial_report_liability0')[1], context=context),
|
||||
'income': obj_financial_report.browse(cr, uid, obj_data.get_object_reference(cr, uid, 'account','account_financial_report_income0')[1], context=context),
|
||||
'expense': obj_financial_report.browse(cr, uid, obj_data.get_object_reference(cr, uid, 'account','account_financial_report_expense0')[1], context=context),
|
||||
}
|
||||
for record in self.browse(cr, uid, ids, context=context):
|
||||
res[record.id] = 'none'
|
||||
for key, financial_report in financial_report_ref.items():
|
||||
list_ids = [x.id for x in financial_report.account_type_ids]
|
||||
if record.id in list_ids:
|
||||
res[record.id] = key
|
||||
return res
|
||||
|
||||
def _save_report_type(self, cr, uid, account_type_id, field_name, field_value, arg, context=None):
|
||||
obj_data = self.pool.get('ir.model.data')
|
||||
obj_financial_report = self.pool.get('account.financial.report')
|
||||
#unlink if it exists somewhere in the financial reports related to BS or PL
|
||||
financial_report_ref = {
|
||||
'asset': obj_financial_report.browse(cr, uid, obj_data.get_object_reference(cr, uid, 'account','account_financial_report_assets0')[1], context=context),
|
||||
'liability': obj_financial_report.browse(cr, uid, obj_data.get_object_reference(cr, uid, 'account','account_financial_report_liability0')[1], context=context),
|
||||
'income': obj_financial_report.browse(cr, uid, obj_data.get_object_reference(cr, uid, 'account','account_financial_report_income0')[1], context=context),
|
||||
'expense': obj_financial_report.browse(cr, uid, obj_data.get_object_reference(cr, uid, 'account','account_financial_report_expense0')[1], context=context),
|
||||
}
|
||||
for key, financial_report in financial_report_ref.items():
|
||||
list_ids = [x.id for x in financial_report.account_type_ids]
|
||||
if account_type_id in list_ids:
|
||||
obj_financial_report.write(cr, uid, [financial_report.id], {'account_type_ids': [(3, account_type_id)]})
|
||||
#write it in the good place
|
||||
if field_value != 'none':
|
||||
return obj_financial_report.write(cr, uid, [financial_report_ref[field_value].id], {'account_type_ids': [(4, account_type_id)]})
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Account Type', size=64, required=True, translate=True),
|
||||
'code': fields.char('Code', size=32, required=True),
|
||||
@@ -139,19 +176,16 @@ class account_account_type(osv.osv):
|
||||
'Balance' will generally be used for cash accounts.
|
||||
'Detail' will copy each existing journal item of the previous year, even the reconciled ones.
|
||||
'Unreconciled' will copy only the journal items that were unreconciled on the first day of the new fiscal year."""),
|
||||
'sign': fields.selection([(-1, 'Reverse balance sign'), (1, 'Preserve balance sign')], 'Sign on Reports', required=True, help='For accounts that are typically more debited than credited and that you would like to print as negative amounts in your reports, you should reverse the sign of the balance; e.g.: Expense account. The same applies for accounts that are typically more credited than debited and that you would like to print as positive amounts in your reports; e.g.: Income account.'),
|
||||
'report_type':fields.selection([
|
||||
('none','/'),
|
||||
('income','Profit & Loss (Income Accounts)'),
|
||||
('expense','Profit & Loss (Expense Accounts)'),
|
||||
('asset','Balance Sheet (Asset Accounts)'),
|
||||
('liability','Balance Sheet (Liability Accounts)')
|
||||
],'P&L / BS Category', select=True, readonly=False, help="This field is used to generate legal reports: profit and loss, balance sheet.", required=True),
|
||||
'report_type': fields.function(_get_current_report_type, fnct_inv=_save_report_type, type='selection', string='P&L / BS Category',
|
||||
selection= [('none','/'),
|
||||
('income', _('Profit & Loss (Income account)')),
|
||||
('expense', _('Profit & Loss (Expense account)')),
|
||||
('asset', _('Balance Sheet (Asset account)')),
|
||||
('liability', _('Balance Sheet (Liability account)'))], help="This field is used to generate legal reports: profit and loss, balance sheet.", required=True),
|
||||
'note': fields.text('Description'),
|
||||
}
|
||||
_defaults = {
|
||||
'close_method': 'none',
|
||||
'sign': 1,
|
||||
'report_type': 'none',
|
||||
}
|
||||
_order = "code"
|
||||
@@ -2912,6 +2946,7 @@ class account_financial_report(osv.osv):
|
||||
return res
|
||||
|
||||
def _get_balance(self, cr, uid, ids, name, args, context=None):
|
||||
account_obj = self.pool.get('account.account')
|
||||
res = {}
|
||||
res_all = {}
|
||||
for report in self.browse(cr, uid, ids, context=context):
|
||||
@@ -2922,6 +2957,12 @@ class account_financial_report(osv.osv):
|
||||
# it's the sum of balance of the linked accounts
|
||||
for a in report.account_ids:
|
||||
balance += a.balance
|
||||
elif report.type == 'account_type':
|
||||
# it's the sum of balance of the leaf accounts with such an account type
|
||||
report_types = [x.id for x in report.account_type_ids]
|
||||
account_ids = account_obj.search(cr, uid, [('user_type','in', report_types), ('type','!=','view')], context=context)
|
||||
for a in account_obj.browse(cr, uid, account_ids, context=context):
|
||||
balance += a.balance
|
||||
elif report.type == 'account_report' and report.account_report_id:
|
||||
# it's the amount of the linked report
|
||||
res2 = self._get_balance(cr, uid, [report.account_report_id.id], 'balance', False, context=context)
|
||||
@@ -2944,7 +2985,6 @@ class account_financial_report(osv.osv):
|
||||
'parent_id': fields.many2one('account.financial.report', 'Parent'),
|
||||
'children_ids': fields.one2many('account.financial.report', 'parent_id', 'Account Report'),
|
||||
'sequence': fields.integer('Sequence'),
|
||||
'note': fields.text('Notes'),
|
||||
'balance': fields.function(_get_balance, 'Balance'),
|
||||
'level': fields.function(_get_level, string='Level', store=True, type='integer'),
|
||||
'type': fields.selection([
|
||||
@@ -2954,13 +2994,20 @@ class account_financial_report(osv.osv):
|
||||
('account_report','Report Value'),
|
||||
],'Type'),
|
||||
'account_ids': fields.many2many('account.account', 'account_account_financial_report', 'report_line_id', 'account_id', 'Accounts'),
|
||||
'display_detail': fields.boolean('Display details', help='Display every account with its balance instead of the sum.'),
|
||||
'display_detail': fields.selection([
|
||||
('no_detail','No detail'),
|
||||
('detail_flat','Display children flat'),
|
||||
('detail_with_hierarchy','Display children with hierarchy')
|
||||
], 'Display details'),
|
||||
'account_report_id': fields.many2one('account.financial.report', 'Report Value'),
|
||||
'account_type_ids': fields.many2many('account.account.type', 'account_account_financial_report_type', 'report_id', 'account_type_id', 'Account Types'),
|
||||
'sign': fields.selection([(-1, 'Reverse balance sign'), (1, 'Preserve balance sign')], 'Sign on Reports', required=True, help='For accounts that are typically more debited than credited and that you would like to print as negative amounts in your reports, you should reverse the sign of the balance; e.g.: Expense account. The same applies for accounts that are typically more credited than debited and that you would like to print as positive amounts in your reports; e.g.: Income account.'),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'type': 'sum',
|
||||
'display_detail': 'detail_flat',
|
||||
'sign': 1,
|
||||
}
|
||||
|
||||
account_financial_report()
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
</xpath>
|
||||
<group colspan="8" position="inside">
|
||||
<group colspan="4" width="600">
|
||||
<field name="charts"/>
|
||||
<field name="charts"/>
|
||||
<group colspan="4" groups="account.group_account_user">
|
||||
<separator col="4" colspan="4" string="Configure Fiscal Year"/>
|
||||
<field name="has_default_company" invisible="1" />
|
||||
|
||||
@@ -610,15 +610,15 @@ class account_invoice(osv.osv):
|
||||
res[r[0]].append( r[1] )
|
||||
return res
|
||||
|
||||
def copy(self, cr, uid, id, default={}, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
default = default or {}
|
||||
default.update({
|
||||
'state':'draft',
|
||||
'number':False,
|
||||
'move_id':False,
|
||||
'move_name':False,
|
||||
'internal_number': False,
|
||||
'period_id': False,
|
||||
})
|
||||
if 'date_invoice' not in default:
|
||||
default.update({
|
||||
@@ -1642,12 +1642,7 @@ class res_partner(osv.osv):
|
||||
}
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
if default is None:
|
||||
default = {}
|
||||
|
||||
if context is None:
|
||||
context = {}
|
||||
|
||||
default = default or {}
|
||||
default.update({'invoice_ids' : []})
|
||||
return super(res_partner, self).copy(cr, uid, id, default, context)
|
||||
|
||||
|
||||
@@ -787,7 +787,6 @@
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Reporting Configuration" colspan="4"/>
|
||||
<field name="report_type" select="2"/>
|
||||
<field name="sign" />
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Closing Method" colspan="4"/>
|
||||
@@ -2487,6 +2486,9 @@
|
||||
<field eval="5" name="sequence"/>
|
||||
<field name="code">
|
||||
act_window_ids = pool.get('ir.actions.act_window').search(cr, uid,[('name', 'in', ('Accounting Chart Configuration', 'Generate Chart of Accounts from a Chart Template'))], context=context)
|
||||
ref = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account', 'action_account_configuration_installer')
|
||||
if ref:
|
||||
act_window_ids += [ref[1]]
|
||||
todo_ids = pool.get('ir.actions.todo').search(cr, uid, [('action_id', 'in', act_window_ids)], context=context)
|
||||
pool.get('ir.actions.todo').write(cr, uid, todo_ids, {'state':'open'}, context=context)
|
||||
action = pool.get('res.config').next(cr, uid, [], context)
|
||||
@@ -2778,10 +2780,14 @@ action = pool.get('res.config').next(cr, uid, [], context)
|
||||
<field name="parent_id"/>
|
||||
<field name="sequence"/>
|
||||
<field name="type"/>
|
||||
<field name="sign"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Report" attrs="{'invisible': [('state','!=','confirm')]}">
|
||||
<field name="display_detail" attrs="{'invisible': [('type','!=','accounts')]}"/>
|
||||
<notebook colspan="6">
|
||||
<page string="Report">
|
||||
<group colspan="4" col="4">
|
||||
<field name="display_detail" attrs="{'invisible': [('type','not in',['accounts','account_type'])]}" colspan="2"/>
|
||||
<label string="" colspan="2"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<field name="account_ids" nolabel="1" colspan="6" attrs="{'invisible': [('type', '!=', 'accounts')]}"/>
|
||||
<newline/>
|
||||
@@ -2790,9 +2796,6 @@ action = pool.get('res.config').next(cr, uid, [], context)
|
||||
<field name="account_type_ids" nolabel="1" attrs="{'invisible': [('type', '!=', 'account_type')]}"/>
|
||||
<newline/>
|
||||
</page>
|
||||
<page string="Notes" attrs="{'invisible': [('state','!=','confirm')]}">
|
||||
<field name="note" nolabel="1" colspan="4"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -1,26 +1,6 @@
|
||||
<openerp>
|
||||
<data>
|
||||
<!-- Types -->
|
||||
<record model="account.account.type" id="conf_account_type_receivable">
|
||||
<field name="name">Receivable</field>
|
||||
<field name="code">receivable</field>
|
||||
<field name="report_type">income</field>
|
||||
<field name="close_method">unreconciled</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="conf_account_type_payable">
|
||||
<field name="name">Payable</field>
|
||||
<field name="code">payable</field>
|
||||
<field name="report_type">expense</field>
|
||||
<field name="close_method">unreconciled</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="conf_account_type_view">
|
||||
<field name="name">View</field>
|
||||
<field name="code">view</field>
|
||||
<field name="close_method">none</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="account_type_income_view1">
|
||||
<field name="name">Income View</field>
|
||||
<field name="code">view</field>
|
||||
@@ -41,78 +21,32 @@
|
||||
<field name="code">liability</field>
|
||||
<field name="report_type">liability</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="conf_account_type_income">
|
||||
<field name="name">Income</field>
|
||||
<field name="code">income</field>
|
||||
<field name="report_type">income</field>
|
||||
<field name="close_method">none</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="conf_account_type_expense">
|
||||
<field name="name">Expense</field>
|
||||
<field name="code">expense</field>
|
||||
<field name="report_type">expense</field>
|
||||
<field name="close_method">none</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="conf_account_type_tax">
|
||||
<field name="name">Tax</field>
|
||||
<field name="code">tax</field>
|
||||
<field name="report_type">expense</field>
|
||||
<field name="close_method">unreconciled</field>
|
||||
<field name="report_type">expense</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="conf_account_type_cash">
|
||||
<field name="name">Cash</field>
|
||||
<field name="code">cash</field>
|
||||
<field name="report_type">asset</field>
|
||||
<field name="close_method">balance</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="conf_account_type_liability">
|
||||
<field name="name">Liability</field>
|
||||
<field name="code">liability</field>
|
||||
<field name="report_type">liability</field>
|
||||
<field name="close_method">balance</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="conf_account_type_asset">
|
||||
<field name="name">Asset</field>
|
||||
<field name="code">asset</field>
|
||||
<field name="report_type">asset</field>
|
||||
<field name="close_method">balance</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="conf_account_type_equity">
|
||||
<field name="name">Equity</field>
|
||||
<field name="code">equity</field>
|
||||
<field name="close_method">balance</field>
|
||||
<field name="report_type">liability</field>
|
||||
<field name="close_method">balance</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="conf_account_type_bnk">
|
||||
<field name="name">Bank</field>
|
||||
<field name="code">bank</field>
|
||||
<field name="report_type">asset</field>
|
||||
<field name="close_method">balance</field>
|
||||
</record>
|
||||
<record model="account.account.type" id="conf_account_type_chk">
|
||||
<record model="account.account.type" id="conf_account_type_chk">
|
||||
<field name="name">Check</field>
|
||||
<field name="code">check</field>
|
||||
<field name="report_type">asset</field>
|
||||
<field name="close_method">balance</field>
|
||||
<field name="report_type">asset</field>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
<!-- Account Templates-->
|
||||
<record id="conf_chart0" model="account.account.template">
|
||||
<field name="code">0</field>
|
||||
<field name="name">Configurable Account Chart</field>
|
||||
<field eval="0" name="parent_id"/>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="conf_account_type_view"/>
|
||||
<field name="user_type" ref="data_account_type_view"/>
|
||||
</record>
|
||||
|
||||
<!-- Balance Sheet -->
|
||||
@@ -122,7 +56,7 @@
|
||||
<field name="name">Balance Sheet</field>
|
||||
<field ref="conf_chart0" name="parent_id"/>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="conf_account_type_view"/>
|
||||
<field name="user_type" ref="data_account_type_view"/>
|
||||
</record>
|
||||
|
||||
<record id="conf_fas" model="account.account.template">
|
||||
@@ -162,7 +96,7 @@
|
||||
<field name="name">Purchased Stocks</field>
|
||||
<field ref="conf_cas" name="parent_id"/>
|
||||
<field name="type">other</field>
|
||||
<field name="user_type" ref="conf_account_type_asset"/>
|
||||
<field name="user_type" ref="data_account_type_asset"/>
|
||||
</record>
|
||||
|
||||
<record id="conf_a_recv" model="account.account.template">
|
||||
@@ -171,7 +105,7 @@
|
||||
<field ref="conf_cas" name="parent_id"/>
|
||||
<field name="type">receivable</field>
|
||||
<field eval="True" name="reconcile"/>
|
||||
<field name="user_type" ref="conf_account_type_receivable"/>
|
||||
<field name="user_type" ref="data_account_type_receivable"/>
|
||||
</record>
|
||||
|
||||
<record id="conf_ova" model="account.account.template">
|
||||
@@ -179,7 +113,7 @@
|
||||
<field name="name">Tax Paid</field>
|
||||
<field ref="conf_cas" name="parent_id"/>
|
||||
<field name="type">other</field>
|
||||
<field name="user_type" ref="conf_account_type_asset"/>
|
||||
<field name="user_type" ref="data_account_type_asset"/>
|
||||
</record>
|
||||
|
||||
<record id="conf_bnk" model="account.account.template">
|
||||
@@ -195,7 +129,7 @@
|
||||
<field name="name">Opening Income Account</field>
|
||||
<field ref="conf_cas" name="parent_id"/>
|
||||
<field name="type">other</field>
|
||||
<field name="user_type" ref="conf_account_type_income"/>
|
||||
<field name="user_type" ref="data_account_type_income"/>
|
||||
</record>
|
||||
|
||||
<record id="conf_cli" model="account.account.template">
|
||||
@@ -212,7 +146,7 @@
|
||||
<field ref="conf_cli" name="parent_id"/>
|
||||
<field name="type">payable</field>
|
||||
<field eval="True" name="reconcile"/>
|
||||
<field name="user_type" ref="conf_account_type_payable"/>
|
||||
<field name="user_type" ref="data_account_type_payable"/>
|
||||
</record>
|
||||
|
||||
<record id="conf_iva" model="account.account.template">
|
||||
@@ -220,7 +154,7 @@
|
||||
<field name="name">Tax Received</field>
|
||||
<field ref="conf_cli" name="parent_id"/>
|
||||
<field name="type">other</field>
|
||||
<field name="user_type" ref="conf_account_type_liability"/>
|
||||
<field name="user_type" ref="data_account_type_liability"/>
|
||||
</record>
|
||||
|
||||
<record id="conf_a_reserve_and_surplus" model="account.account.template">
|
||||
@@ -229,7 +163,7 @@
|
||||
<field ref="conf_cli" name="parent_id"/>
|
||||
<field name="type">other</field>
|
||||
<field eval="True" name="reconcile"/>
|
||||
<field name="user_type" ref="conf_account_type_liability"/>
|
||||
<field name="user_type" ref="data_account_type_liability"/>
|
||||
</record>
|
||||
|
||||
<record id="conf_o_expense" model="account.account.template">
|
||||
@@ -237,7 +171,7 @@
|
||||
<field name="name">Opening Expense Account</field>
|
||||
<field ref="conf_cli" name="parent_id"/>
|
||||
<field name="type">other</field>
|
||||
<field name="user_type" ref="conf_account_type_expense"/>
|
||||
<field name="user_type" ref="data_account_type_expense"/>
|
||||
</record>
|
||||
|
||||
<!-- Profit and Loss -->
|
||||
@@ -247,7 +181,7 @@
|
||||
<field name="name">Profit and Loss</field>
|
||||
<field ref="conf_chart0" name="parent_id"/>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="conf_account_type_view"/>
|
||||
<field name="user_type" ref="data_account_type_view"/>
|
||||
</record>
|
||||
|
||||
<record id="conf_rev" model="account.account.template">
|
||||
@@ -263,7 +197,7 @@
|
||||
<field name="name">Product Sales</field>
|
||||
<field ref="conf_rev" name="parent_id"/>
|
||||
<field name="type">other</field>
|
||||
<field name="user_type" ref="conf_account_type_income"/>
|
||||
<field name="user_type" ref="data_account_type_income"/>
|
||||
</record>
|
||||
|
||||
<record id="conf_cos" model="account.account.template">
|
||||
@@ -279,7 +213,7 @@
|
||||
<field name="name">Cost of Goods Sold</field>
|
||||
<field ref="conf_cos" name="parent_id"/>
|
||||
<field name="type">other</field>
|
||||
<field name="user_type" ref="conf_account_type_expense"/>
|
||||
<field name="user_type" ref="data_account_type_expense"/>
|
||||
</record>
|
||||
|
||||
<record id="conf_ovr" model="account.account.template">
|
||||
@@ -295,7 +229,7 @@
|
||||
<field name="name">Expenses</field>
|
||||
<field ref="conf_ovr" name="parent_id"/>
|
||||
<field name="type">other</field>
|
||||
<field name="user_type" ref="conf_account_type_expense"/>
|
||||
<field name="user_type" ref="data_account_type_expense"/>
|
||||
</record>
|
||||
|
||||
<record id="conf_a_salary_expense" model="account.account.template">
|
||||
@@ -303,7 +237,7 @@
|
||||
<field name="name">Salary Expenses</field>
|
||||
<field ref="conf_ovr" name="parent_id"/>
|
||||
<field name="type">other</field>
|
||||
<field name="user_type" ref="conf_account_type_expense"/>
|
||||
<field name="user_type" ref="data_account_type_expense"/>
|
||||
</record>
|
||||
|
||||
<!-- Taxes -->
|
||||
|
||||
@@ -30,21 +30,25 @@
|
||||
<field name="name">Asset</field>
|
||||
<field name="code">asset</field>
|
||||
<field name="close_method">balance</field>
|
||||
<field name="report_type">asset</field>
|
||||
</record>
|
||||
<record model="account.account.type" id="data_account_type_liability">
|
||||
<field name="name">Liability</field>
|
||||
<field name="code">liability</field>
|
||||
<field name="close_method">balance</field>
|
||||
<field name="report_type">liability</field>
|
||||
</record>
|
||||
<record model="account.account.type" id="data_account_type_income">
|
||||
<field name="name">Income</field>
|
||||
<field name="code">income</field>
|
||||
<field name="close_method">none</field>
|
||||
<field name="report_type">income</field>
|
||||
</record>
|
||||
<record model="account.account.type" id="data_account_type_expense">
|
||||
<field name="name">Expense</field>
|
||||
<field name="code">expense</field>
|
||||
<field name="close_method">none</field>
|
||||
<field name="report_type">expense</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
<!--
|
||||
Financial Reports
|
||||
-->
|
||||
<record id="account_financial_report_balancesheet0" model="account.financial.report">
|
||||
<field name="name">Balance Sheet</field>
|
||||
<field name="type">sum</field>
|
||||
</record>
|
||||
<record id="account_financial_report_assets0" model="account.financial.report">
|
||||
<field name="name">Assets</field>
|
||||
<field name="parent_id" ref="account_financial_report_balancesheet0"/>
|
||||
<field name="display_detail">detail_with_hierarchy</field>
|
||||
<field name="type">account_type</field>
|
||||
</record>
|
||||
<record id="account_financial_report_liability0" model="account.financial.report">
|
||||
<field name="name">Liability</field>
|
||||
<field name="parent_id" ref="account_financial_report_balancesheet0"/>
|
||||
<field name="display_detail">detail_with_hierarchy</field>
|
||||
<field name="type">account_type</field>
|
||||
</record>
|
||||
|
||||
<record id="account_financial_report_profitandloss0" model="account.financial.report">
|
||||
<field name="name">Profit and Loss</field>
|
||||
<field name="type">sum</field>
|
||||
</record>
|
||||
<record id="account_financial_report_income0" model="account.financial.report">
|
||||
<field name="name">Income</field>
|
||||
<field name="parent_id" ref="account_financial_report_profitandloss0"/>
|
||||
<field name="display_detail">detail_with_hierarchy</field>
|
||||
<field name="type">account_type</field>
|
||||
</record>
|
||||
<record id="account_financial_report_expense0" model="account.financial.report">
|
||||
<field name="name">Expense</field>
|
||||
<field name="parent_id" ref="account_financial_report_profitandloss0"/>
|
||||
<field name="display_detail">detail_with_hierarchy</field>
|
||||
<field name="type">account_type</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -5,58 +5,11 @@
|
||||
Account Type
|
||||
-->
|
||||
|
||||
<record id="account_type_root" model="account.account.type">
|
||||
<field name="name">View</field>
|
||||
<field name="code">view</field>
|
||||
<field name="close_method">none</field>
|
||||
</record>
|
||||
<record id="account_type_asset" model="account.account.type">
|
||||
<field name="name">Asset</field>
|
||||
<field name="code">asset</field>
|
||||
<field name="report_type">asset</field>
|
||||
<field name="close_method">balance</field>
|
||||
</record>
|
||||
<record id="account_type_receivable" model="account.account.type">
|
||||
<field name="name">Receivable</field>
|
||||
<field name="code">receivable</field>
|
||||
<field name="report_type">asset</field>
|
||||
<field name="close_method">unreconciled</field>
|
||||
</record>
|
||||
<record id="account_type_liability" model="account.account.type">
|
||||
<field name="name">Liability</field>
|
||||
<field name="code">liability</field>
|
||||
<field name="report_type">liability</field>
|
||||
<field name="close_method">balance</field>
|
||||
</record>
|
||||
<record id="account_type_payable" model="account.account.type">
|
||||
<field name="name">Payable</field>
|
||||
<field name="code">payable</field>
|
||||
<field name="report_type">liability</field>
|
||||
<field name="close_method">unreconciled</field>
|
||||
</record>
|
||||
<record id="account_type_income" model="account.account.type">
|
||||
<field name="name">Income</field>
|
||||
<field name="code">income</field>
|
||||
<field name="report_type">income</field>
|
||||
<field name="close_method">none</field>
|
||||
</record>
|
||||
<record id="account_type_expense" model="account.account.type">
|
||||
<field name="name">Expense</field>
|
||||
<field name="code">expense</field>
|
||||
<field name="report_type">expense</field>
|
||||
<field name="close_method">none</field>
|
||||
</record>
|
||||
<record id="account_type_cash_equity" model="account.account.type">
|
||||
<field name="name">Equity</field>
|
||||
<field name="code">equity</field>
|
||||
<field name="close_method">balance</field>
|
||||
<field name="report_type">liability</field>
|
||||
<field name="close_method">balance</field>
|
||||
</record>
|
||||
<record id="account_type_cash_moves" model="account.account.type">
|
||||
<field name="name">Cash</field>
|
||||
<field name="code">cash</field>
|
||||
<field name="report_type">asset</field>
|
||||
<field name="close_method">balance</field>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
@@ -68,7 +21,7 @@
|
||||
<field name="name">Chart For Automated Tests</field>
|
||||
<field eval="0" name="parent_id"/>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_root"/>
|
||||
<field name="user_type" ref="data_account_type_view"/>
|
||||
</record>
|
||||
|
||||
<!-- Balance Sheet -->
|
||||
@@ -78,14 +31,14 @@
|
||||
<field name="name">Balance Sheet - (test)</field>
|
||||
<field ref="chart0" name="parent_id"/>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_root"/>
|
||||
<field name="user_type" ref="data_account_type_view"/>
|
||||
</record>
|
||||
|
||||
<record model="account.account" id="assets_view">
|
||||
<field name="name">Assets - (test)</field>
|
||||
<field name="code">X10</field>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_asset"/>
|
||||
<field name="user_type" ref="data_account_type_asset"/>
|
||||
<field name="reconcile" eval="False"/>
|
||||
<field name="parent_id" ref="bal"/>
|
||||
</record>
|
||||
@@ -95,7 +48,7 @@
|
||||
<field name="name">Fixed Assets - (test)</field>
|
||||
<field ref="assets_view" name="parent_id"/>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_asset"/>
|
||||
<field name="user_type" ref="data_account_type_asset"/>
|
||||
</record>
|
||||
|
||||
<record id="xfa" model="account.account">
|
||||
@@ -103,7 +56,7 @@
|
||||
<field name="name">Fixed Asset Account - (test)</field>
|
||||
<field ref="fas" name="parent_id"/>
|
||||
<field name="type">other</field>
|
||||
<field name="user_type" ref="account_type_asset"/>
|
||||
<field name="user_type" ref="data_account_type_asset"/>
|
||||
</record>
|
||||
|
||||
<record id="nca" model="account.account">
|
||||
@@ -111,7 +64,7 @@
|
||||
<field name="name">Net Current Assets - (test)</field>
|
||||
<field ref="assets_view" name="parent_id"/>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_asset"/>
|
||||
<field name="user_type" ref="data_account_type_asset"/>
|
||||
</record>
|
||||
|
||||
<record id="cas" model="account.account">
|
||||
@@ -119,7 +72,7 @@
|
||||
<field name="name">Current Assets - (test)</field>
|
||||
<field ref="nca" name="parent_id"/>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_asset"/>
|
||||
<field name="user_type" ref="data_account_type_asset"/>
|
||||
</record>
|
||||
|
||||
<record id="stk" model="account.account">
|
||||
@@ -127,7 +80,7 @@
|
||||
<field name="name">Purchased Stocks - (test)</field>
|
||||
<field ref="cas" name="parent_id"/>
|
||||
<field name="type">other</field>
|
||||
<field name="user_type" ref="account_type_asset"/>
|
||||
<field name="user_type" ref="data_account_type_asset"/>
|
||||
</record>
|
||||
|
||||
<record id="a_recv" model="account.account">
|
||||
@@ -136,7 +89,7 @@
|
||||
<field ref="cas" name="parent_id"/>
|
||||
<field name="type">receivable</field>
|
||||
<field eval="True" name="reconcile"/>
|
||||
<field name="user_type" ref="account_type_receivable"/>
|
||||
<field name="user_type" ref="data_account_type_receivable"/>
|
||||
</record>
|
||||
|
||||
<record id="ova" model="account.account">
|
||||
@@ -144,7 +97,7 @@
|
||||
<field name="name">Output VAT - (test)</field>
|
||||
<field ref="cas" name="parent_id"/>
|
||||
<field name="type">other</field>
|
||||
<field name="user_type" ref="account_type_asset"/>
|
||||
<field name="user_type" ref="data_account_type_asset"/>
|
||||
</record>
|
||||
|
||||
<record id="bnk" model="account.account">
|
||||
@@ -152,7 +105,7 @@
|
||||
<field name="name">Bank Current Account - (test)</field>
|
||||
<field ref="cas" name="parent_id"/>
|
||||
<field name="type">liquidity</field>
|
||||
<field name="user_type" ref="account_type_asset"/>
|
||||
<field name="user_type" ref="data_account_type_asset"/>
|
||||
</record>
|
||||
|
||||
<record id="cash" model="account.account">
|
||||
@@ -160,7 +113,7 @@
|
||||
<field name="name">Cash - (test)</field>
|
||||
<field ref="cas" name="parent_id"/>
|
||||
<field name="type">liquidity</field>
|
||||
<field name="user_type" ref="account_type_asset"/>
|
||||
<field name="user_type" ref="data_account_type_asset"/>
|
||||
</record>
|
||||
|
||||
<record id="o_income" model="account.account">
|
||||
@@ -168,14 +121,14 @@
|
||||
<field name="name">Opening Income - (test)</field>
|
||||
<field ref="cas" name="parent_id"/>
|
||||
<field name="type">other</field>
|
||||
<field name="user_type" ref="account_type_income"/>
|
||||
<field name="user_type" ref="data_account_type_income"/>
|
||||
</record>
|
||||
|
||||
<record model="account.account" id="liabilities_view">
|
||||
<field name="name">Liabilities - (test)</field>
|
||||
<field name="code">X11</field>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_liability"/>
|
||||
<field name="user_type" ref="data_account_type_liability"/>
|
||||
<field name="reconcile" eval="False"/>
|
||||
<field name="parent_id" ref="bal"/>
|
||||
</record>
|
||||
@@ -185,7 +138,7 @@
|
||||
<field name="name">Current Liabilities - (test)</field>
|
||||
<field ref="liabilities_view" name="parent_id"/>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_liability"/>
|
||||
<field name="user_type" ref="data_account_type_liability"/>
|
||||
</record>
|
||||
|
||||
<record id="a_pay" model="account.account">
|
||||
@@ -194,7 +147,7 @@
|
||||
<field ref="cli" name="parent_id"/>
|
||||
<field name="type">payable</field>
|
||||
<field eval="True" name="reconcile"/>
|
||||
<field name="user_type" ref="account_type_payable"/>
|
||||
<field name="user_type" ref="data_account_type_payable"/>
|
||||
</record>
|
||||
|
||||
<record id="iva" model="account.account">
|
||||
@@ -202,7 +155,7 @@
|
||||
<field name="name">Input VAT - (test)</field>
|
||||
<field ref="cli" name="parent_id"/>
|
||||
<field name="type">other</field>
|
||||
<field name="user_type" ref="account_type_liability"/>
|
||||
<field name="user_type" ref="data_account_type_liability"/>
|
||||
</record>
|
||||
|
||||
<record id="rsa" model="account.account">
|
||||
@@ -210,7 +163,7 @@
|
||||
<field name="name">Reserve and Profit/Loss - (test)</field>
|
||||
<field ref="cli" name="parent_id"/>
|
||||
<field name="type">other</field>
|
||||
<field name="user_type" ref="account_type_liability"/>
|
||||
<field name="user_type" ref="data_account_type_liability"/>
|
||||
</record>
|
||||
|
||||
<record id="o_expense" model="account.account">
|
||||
@@ -218,7 +171,7 @@
|
||||
<field name="name">Opening Expense - (test)</field>
|
||||
<field ref="cli" name="parent_id"/>
|
||||
<field name="type">other</field>
|
||||
<field name="user_type" ref="account_type_expense"/>
|
||||
<field name="user_type" ref="data_account_type_expense"/>
|
||||
</record>
|
||||
|
||||
<!-- Profit and Loss -->
|
||||
@@ -228,14 +181,14 @@
|
||||
<field name="name">Profit and Loss - (test)</field>
|
||||
<field ref="chart0" name="parent_id"/>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_root"/>
|
||||
<field name="user_type" ref="data_account_type_view"/>
|
||||
</record>
|
||||
|
||||
<record model="account.account" id="income_view">
|
||||
<field name="name">Income - (test)</field>
|
||||
<field name="code">X20</field>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_income"/>
|
||||
<field name="user_type" ref="data_account_type_income"/>
|
||||
<field name="reconcile" eval="False"/>
|
||||
<field name="parent_id" ref="gpf"/>
|
||||
</record>
|
||||
@@ -244,7 +197,7 @@
|
||||
<field name="name">Foreign Exchange Gain - (test)</field>
|
||||
<field name="code">X201</field>
|
||||
<field name="type">other</field>
|
||||
<field name="user_type" ref="account_type_income"/>
|
||||
<field name="user_type" ref="data_account_type_income"/>
|
||||
<field name="reconcile" eval="False"/>
|
||||
<field name="parent_id" ref="income_view"/>
|
||||
</record>
|
||||
@@ -254,7 +207,7 @@
|
||||
<field name="name">Revenue - (test)</field>
|
||||
<field ref="income_view" name="parent_id"/>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_income"/>
|
||||
<field name="user_type" ref="data_account_type_income"/>
|
||||
</record>
|
||||
|
||||
<record id="a_sale" model="account.account">
|
||||
@@ -262,14 +215,14 @@
|
||||
<field name="name">Product Sales - (test)</field>
|
||||
<field ref="rev" name="parent_id"/>
|
||||
<field name="type">other</field>
|
||||
<field name="user_type" ref="account_type_income"/>
|
||||
<field name="user_type" ref="data_account_type_income"/>
|
||||
</record>
|
||||
|
||||
<record model="account.account" id="expense_view">
|
||||
<field name="name">Expense - (test)</field>
|
||||
<field name="code">X21</field>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_expense"/>
|
||||
<field name="user_type" ref="data_account_type_expense"/>
|
||||
<field name="reconcile" eval="False"/>
|
||||
<field name="parent_id" ref="gpf"/>
|
||||
</record>
|
||||
@@ -280,7 +233,7 @@
|
||||
<field name="name">Cost of Sales - (test)</field>
|
||||
<field ref="expense_view" name="parent_id"/>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_expense"/>
|
||||
<field name="user_type" ref="data_account_type_expense"/>
|
||||
</record>
|
||||
|
||||
<record id="cog" model="account.account">
|
||||
@@ -288,7 +241,7 @@
|
||||
<field name="name">Cost of Goods Sold - (test)</field>
|
||||
<field ref="cos" name="parent_id"/>
|
||||
<field name="type">other</field>
|
||||
<field name="user_type" ref="account_type_expense"/>
|
||||
<field name="user_type" ref="data_account_type_expense"/>
|
||||
</record>
|
||||
|
||||
<record id="ovr" model="account.account">
|
||||
@@ -296,7 +249,7 @@
|
||||
<field name="name">Overheads - (test)</field>
|
||||
<field ref="expense_view" name="parent_id"/>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_expense"/>
|
||||
<field name="user_type" ref="data_account_type_expense"/>
|
||||
</record>
|
||||
|
||||
<record id="a_expense" model="account.account">
|
||||
@@ -304,14 +257,14 @@
|
||||
<field name="name">Expenses - (test)</field>
|
||||
<field ref="ovr" name="parent_id"/>
|
||||
<field name="type">other</field>
|
||||
<field name="user_type" ref="account_type_expense"/>
|
||||
<field name="user_type" ref="data_account_type_expense"/>
|
||||
</record>
|
||||
|
||||
<record model="account.account" id="income_fx_expense">
|
||||
<field name="name">Foreign Exchange Loss - (test)</field>
|
||||
<field name="code">X2111</field>
|
||||
<field name="type">other</field>
|
||||
<field name="user_type" ref="account_type_expense"/>
|
||||
<field name="user_type" ref="data_account_type_expense"/>
|
||||
<field name="reconcile" eval="False"/>
|
||||
<field name="parent_id" ref="ovr"/>
|
||||
</record>
|
||||
@@ -321,7 +274,7 @@
|
||||
<field name="name">Salary Expenses - (test)</field>
|
||||
<field ref="ovr" name="parent_id"/>
|
||||
<field name="type">other</field>
|
||||
<field name="user_type" ref="account_type_expense"/>
|
||||
<field name="user_type" ref="data_account_type_expense"/>
|
||||
</record>
|
||||
|
||||
<!-- Properties -->
|
||||
|
||||
@@ -24,6 +24,7 @@ import time
|
||||
import datetime
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from operator import itemgetter
|
||||
from os.path import join as opj
|
||||
|
||||
from tools.translate import _
|
||||
from osv import fields, osv
|
||||
@@ -111,6 +112,11 @@ class account_installer(osv.osv_memory):
|
||||
context = {}
|
||||
fy_obj = self.pool.get('account.fiscalyear')
|
||||
for res in self.read(cr, uid, ids, context=context):
|
||||
if 'charts' in res and res['charts'] == 'configurable':
|
||||
#load generic chart of account
|
||||
fp = tools.file_open(opj('account', 'configurable_account_chart.xml'))
|
||||
tools.convert_xml_import(cr, 'account', fp, {}, 'init', True, None)
|
||||
fp.close()
|
||||
if 'date_start' in res and 'date_stop' in res:
|
||||
f_ids = fy_obj.search(cr, uid, [('date_start', '<=', res['date_start']), ('date_stop', '>=', res['date_stop']), ('company_id', '=', res['company_id'][0])], context=context)
|
||||
if not f_ids:
|
||||
|
||||
@@ -33,13 +33,10 @@ import account_print_overdue
|
||||
import account_aged_partner_balance
|
||||
#import tax_report
|
||||
import account_tax_report
|
||||
import account_balance_landscape
|
||||
import account_invoice_report
|
||||
import account_report
|
||||
import account_entries_report
|
||||
import account_analytic_entries_report
|
||||
import account_balance_sheet
|
||||
import account_profit_loss
|
||||
import account_treasury_report
|
||||
import account_financial_report
|
||||
|
||||
|
||||
@@ -1,393 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
import locale
|
||||
from report import report_sxw
|
||||
|
||||
parents = {
|
||||
'tr':1,
|
||||
'li':1,
|
||||
'story': 0,
|
||||
'section': 0
|
||||
}
|
||||
|
||||
class account_balance_landscape(report_sxw.rml_parse):
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(account_balance_landscape, self).__init__(cr, uid, name, context=context)
|
||||
self.flag=1
|
||||
self.dr_total= 0.00
|
||||
self.cr_total= 0.00
|
||||
self.parent_bal=0
|
||||
self.status=0
|
||||
self.done_total=0
|
||||
self.baldiv={}
|
||||
self.empty_parent=0
|
||||
self.result_total = {}
|
||||
self.total_for_perc=[]
|
||||
self.localcontext.update({
|
||||
'time': time,
|
||||
'lines': self.lines,
|
||||
'get_lines':self.get_lines,
|
||||
'linesForTotal': self.linesForTotal,
|
||||
'linesForYear': self.linesForYear,
|
||||
'get_years':self.get_years,
|
||||
'cal_total':self.cal_total,
|
||||
'total_dr':self.total_dr,
|
||||
'total_cr':self.total_cr
|
||||
})
|
||||
self.context = context
|
||||
|
||||
def linesForYear(self,form):
|
||||
temp=0
|
||||
years={}
|
||||
|
||||
global pattern
|
||||
global show
|
||||
global perc
|
||||
global bal_zero
|
||||
global ref_bal
|
||||
|
||||
pattern=form['compare_pattern']
|
||||
|
||||
if form['show_columns']!=1:
|
||||
show=0
|
||||
else:
|
||||
show=form['show_columns']
|
||||
|
||||
if form['format_perc']!=1:
|
||||
perc=0
|
||||
else:
|
||||
perc=form['format_perc']
|
||||
|
||||
if form['account_choice']=='bal_zero':
|
||||
bal_zero=0
|
||||
else:
|
||||
bal_zero=1
|
||||
|
||||
ctx = self.context.copy()
|
||||
|
||||
if perc==1:
|
||||
if form['select_account']!=False:
|
||||
ref_ac=self.pool.get('account.account').browse(self.cr, self.uid, form['select_account'], ctx.copy())
|
||||
if ref_ac.balance<>0.00:
|
||||
ref_bal=ref_ac.balance
|
||||
else:
|
||||
ref_bal=1.00
|
||||
else:
|
||||
ref_bal='nothing'
|
||||
else:
|
||||
ref_bal='nothing'
|
||||
|
||||
|
||||
self.done_total=1
|
||||
self.total_for_perc=self.linesForTotal(form, ids={}, doneAccount={}, level=1)
|
||||
self.done_total=0
|
||||
|
||||
for t1 in range(0,len(form['fiscalyear'])):
|
||||
locale.setlocale(locale.LC_ALL, '')
|
||||
self.result_total["sum_credit" + str(t1)]=locale.format("%.2f", self.result_total["sum_credit" + str(t1)], grouping=True)
|
||||
self.result_total["sum_debit" + str(t1)]=locale.format("%.2f", self.result_total["sum_debit" + str(t1)], grouping=True)
|
||||
|
||||
for temp in range(0,len(form['fiscalyear'])):
|
||||
fy=self.pool.get('account.fiscalyear').name_get(self.cr, self.uid, form['fiscalyear'][temp])
|
||||
years["year"+str(temp)]=fy[0][1][12:16]
|
||||
|
||||
return [years]
|
||||
|
||||
|
||||
def linesForTotal(self, form, ids={}, doneAccount={}, level=1):
|
||||
if not self.done_total==1:
|
||||
return [self.result_total]
|
||||
accounts=[]
|
||||
if not ids:
|
||||
ids = self.ids
|
||||
if not ids:
|
||||
return []
|
||||
|
||||
ctx = self.context.copy()
|
||||
|
||||
for id in form['fiscalyear']:
|
||||
tmp=[]
|
||||
|
||||
ctx['fiscalyear'] = id
|
||||
ctx['periods'] = form['periods']
|
||||
ctx['period_manner'] = form['period_manner']
|
||||
ctx['state'] = form['context'].get('state','all')
|
||||
tmp = self.pool.get('account.account').browse(self.cr, self.uid, ids, ctx.copy())
|
||||
|
||||
if tmp:
|
||||
accounts.append(tmp)
|
||||
|
||||
merged_accounts=zip(*accounts)
|
||||
# used to check for the frst record so all sum_credit and sum_debit r set to 0.00
|
||||
if level==1:
|
||||
doneAccount={}
|
||||
for entry in merged_accounts:
|
||||
|
||||
if entry[0].id in doneAccount:
|
||||
continue
|
||||
doneAccount[entry[0].id] = 1
|
||||
|
||||
for k in range(0,len(entry)):
|
||||
temp_credit=0.00
|
||||
temp_debit=0.00
|
||||
if entry[0].type <> 'view':
|
||||
temp_credit+=entry[k].credit
|
||||
temp_debit+=entry[k].debit
|
||||
|
||||
if self.flag==1:
|
||||
self.result_total["sum_credit" + str(k)]=0.00
|
||||
self.result_total["sum_debit" + str(k)]=0.00
|
||||
|
||||
if form['account_choice']=='bal_zero':
|
||||
if temp_credit<>temp_debit:
|
||||
self.result_total["sum_credit" + str(k)]+=temp_credit
|
||||
self.result_total["sum_debit" + str(k)]+=temp_debit
|
||||
else:
|
||||
self.result_total["sum_credit" + str(k)]+=temp_credit
|
||||
self.result_total["sum_debit" + str(k)]+=temp_debit
|
||||
|
||||
self.flag=2
|
||||
|
||||
if entry[0].child_id:
|
||||
ids2 = [(x.code,x.id) for x in entry[0].child_id]
|
||||
ids2.sort()
|
||||
|
||||
result_total_parent = self.linesForTotal(form, [x[1] for x in ids2], doneAccount, level+1)
|
||||
|
||||
return [self.result_total]
|
||||
|
||||
def lines(self, form, ids={}, done={}, level=1):
|
||||
accounts=[]
|
||||
if not ids:
|
||||
ids = self.ids
|
||||
if not ids:
|
||||
return []
|
||||
result = []
|
||||
ctx = self.context.copy()
|
||||
tmp1=[]
|
||||
for id in form['fiscalyear']:
|
||||
|
||||
ctx['fiscalyear'] = id
|
||||
ctx['periods'] = form['periods']
|
||||
ctx['period_manner']=form['period_manner']
|
||||
ctx['state'] = form['context'].get('state','all')
|
||||
tmp1 = self.pool.get('account.account').browse(self.cr, self.uid, ids, ctx.copy())
|
||||
|
||||
if tmp1:
|
||||
accounts.append(tmp1)
|
||||
|
||||
if level==1: #if parent is called,done is not empty when called again.
|
||||
done={}
|
||||
|
||||
def cmp_code(x, y):
|
||||
return cmp(x.code, y.code)
|
||||
for n in range(0,len(accounts)):
|
||||
accounts[n].sort(cmp_code)
|
||||
merged_accounts=zip(*accounts)
|
||||
|
||||
for entry in merged_accounts:
|
||||
j=0
|
||||
checked=1
|
||||
|
||||
if form['account_choice']!='all': # if checked,include empty a/c;not otherwise
|
||||
checked=0
|
||||
|
||||
if entry[0].id in done:
|
||||
continue
|
||||
done[entry[0].id] = 1
|
||||
|
||||
if entry[0].child_id: # this is for parent account,dont check 0 for it
|
||||
checked=4
|
||||
self.status=1 # for displaying it Bold
|
||||
else:
|
||||
self.status=0
|
||||
if checked==0:
|
||||
i=0
|
||||
for i in range(0,len(entry)):
|
||||
if bal_zero==0:
|
||||
if entry[i].balance<>0.0:
|
||||
checked=4
|
||||
break
|
||||
else:
|
||||
checked=3
|
||||
i=i+1
|
||||
else:
|
||||
if entry[i].credit <> 0.0 or entry[i].debit <> 0.0:
|
||||
checked=4
|
||||
break
|
||||
else:
|
||||
checked=3
|
||||
i=i+1
|
||||
|
||||
if checked==3:
|
||||
# this is the point where we skip those accounts which are encountered as empty ones
|
||||
continue
|
||||
self.empty_parent=0
|
||||
else:
|
||||
self.empty_parent=1
|
||||
res = {
|
||||
'code': entry[0].code,
|
||||
'name': entry[0].name,
|
||||
'level': level,
|
||||
'status': self.status,
|
||||
}
|
||||
|
||||
for j in range(0,len(entry)):
|
||||
|
||||
locale.setlocale(locale.LC_ALL, '')
|
||||
res["debit"+str(j)]=locale.format("%.2f", entry[j].debit, grouping=True)
|
||||
res["credit"+str(j)]=locale.format("%.2f", entry[j].credit, grouping=True)
|
||||
res["balance"+str(j)]=locale.format("%.2f", entry[j].balance, grouping=True)
|
||||
|
||||
|
||||
if j==0:
|
||||
res["bal_cash"+str(j)]="0.00"
|
||||
res["bal_perc"+str(j)]="0.00%"
|
||||
else:
|
||||
temp_cash=entry[j].balance - entry[j-1].balance
|
||||
res["bal_cash"+str(j)]=locale.format("%.2f", temp_cash, grouping=True)
|
||||
if entry[j-1].balance<>0.00:
|
||||
temp_perc=(entry[j].balance - entry[j-1].balance )*100/entry[j-1].balance
|
||||
else:
|
||||
temp_perc=(entry[j].balance) *100
|
||||
|
||||
res["bal_perc"+str(j)]=locale.format("%.2f", temp_perc) + "%"
|
||||
|
||||
|
||||
if ref_bal=='nothing':
|
||||
if level==1:
|
||||
self.parent_bal=1
|
||||
else:
|
||||
self.parent_bal=0
|
||||
|
||||
if self.parent_bal==1:
|
||||
res["balance_perc"+str(j)]="/"
|
||||
else:
|
||||
if entry[j].balance==0.00:
|
||||
if self.baldiv["baldiv"+str(level-1)+str(j)]<>0.00:
|
||||
res["balance_perc"+str(j)]="0.00%"
|
||||
else:
|
||||
res["balance_perc"+str(j)]="/"
|
||||
else:
|
||||
if self.baldiv["baldiv"+str(level-1)+str(j)]<>0.00:
|
||||
temp=self.baldiv["baldiv"+str(level-1)+str(j)]
|
||||
temp1=(entry[j].balance * 100 )/ float(temp)
|
||||
temp1=round(temp1,2)
|
||||
res["balance_perc" + str(j)]=str(temp1)+"%"
|
||||
else:
|
||||
res["balance_perc"+str(j)]="/"
|
||||
else:
|
||||
res["balance_perc"+str(j)]=str( (entry[j].balance * 100 )/ float(ref_bal)) + "%"
|
||||
|
||||
result.append(res)
|
||||
|
||||
if entry[0].child_id:
|
||||
|
||||
for q in range(0,len(form['fiscalyear'])):
|
||||
self.baldiv["baldiv"+str(level)+str(q)]=entry[q].balance
|
||||
|
||||
ids2 = [(x.code,x.id) for x in entry[0].child_id]
|
||||
ids2.sort()
|
||||
dir=[]
|
||||
dir += self.lines(form, [x[1] for x in ids2], done, level+1)
|
||||
if dir==[]:
|
||||
for w in range(0,len(form['fiscalyear'])):
|
||||
if entry[w].credit <> 0.0 or entry[w].debit <> 0.0 or entry[w].balance<>0.00:
|
||||
dont_pop=1
|
||||
break
|
||||
else:
|
||||
dont_pop=0
|
||||
if dont_pop==1:
|
||||
result +=dir
|
||||
else:
|
||||
result.pop(-1) # here we pop up the parent having its children as emprty accounts
|
||||
else:
|
||||
result +=dir
|
||||
|
||||
return result
|
||||
|
||||
def get_years(self, form):
|
||||
result =[]
|
||||
res={}
|
||||
for temp in range(0, len(form['fiscalyear'])):
|
||||
res={}
|
||||
fy=self.pool.get('account.fiscalyear').name_get(self.cr, self.uid, form['fiscalyear'][temp])
|
||||
res['year']=fy[0][1]
|
||||
res['last_str']=temp
|
||||
|
||||
result.append(res)
|
||||
self.linesForYear(form)
|
||||
return result
|
||||
|
||||
def get_lines(self, year_dict, form):
|
||||
final_result = []
|
||||
res = {}
|
||||
line_l = self.lines(form)
|
||||
self.cal_total(year_dict)
|
||||
if line_l:
|
||||
for l in line_l:
|
||||
res = {}
|
||||
res['code'] = l['code']
|
||||
res['name'] = l['name']
|
||||
res['level'] = l['level']
|
||||
for k,v in l.items():
|
||||
if k.startswith('debit'+str(year_dict['last_str'])):
|
||||
res['debit'] = v
|
||||
if k.startswith('credit'+str(year_dict['last_str'])):
|
||||
res['credit'] = v
|
||||
if k.startswith('balance'+str(year_dict['last_str'])) and not k.startswith('balance_perc'+str(year_dict['last_str'])):
|
||||
res['balance'] =v
|
||||
if k.startswith('balance_perc'+str(year_dict['last_str'])) and not k.startswith('balance'+str(year_dict['last_str'])):
|
||||
res['balance_perc'] = v
|
||||
if form['compare_pattern'] == 'bal_perc':
|
||||
if k.startswith('bal_perc'+str(year_dict['last_str'])):
|
||||
res['pattern'] = v
|
||||
elif form['compare_pattern'] == 'bal_cash':
|
||||
if k.startswith('bal_cash'+str(year_dict['last_str'])):
|
||||
res['pattern'] = v
|
||||
else:
|
||||
res['pattern'] = ''
|
||||
final_result.append(res)
|
||||
return final_result
|
||||
|
||||
def cal_total(self, year_dict):
|
||||
total_l = self.result_total
|
||||
if total_l:
|
||||
for k,v in total_l.items():
|
||||
if k.startswith('sum_debit'+str(year_dict['last_str'])):
|
||||
self.dr_total = v
|
||||
elif k.startswith('sum_credit'+str(year_dict['last_str'])):
|
||||
self.cr_total = v
|
||||
else:
|
||||
continue
|
||||
return True
|
||||
|
||||
def total_dr(self):
|
||||
return self.dr_total
|
||||
|
||||
def total_cr(self):
|
||||
return self.cr_total
|
||||
|
||||
report_sxw.report_sxw('report.account.account.balance.landscape', 'account.account', 'addons/account/report/account_balance_landscape.rml', parser=account_balance_landscape, header="internal landscape")
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -1,317 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<document filename="Account Balance.pdf">
|
||||
<template pageSize="(842.0,595.0)" title="Account Balance" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="28.0" y1="28.0" width="786" height="539"/>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
<blockTableStyle id="Standard_Outline">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Tiltle">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_header_account">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
|
||||
<blockBackground colorName="#b3b3b3" start="0,0" stop="0,-1"/>
|
||||
<blockBackground colorName="#b3b3b3" start="1,0" stop="1,-1"/>
|
||||
<blockBackground colorName="#b3b3b3" start="2,0" stop="2,-1"/>
|
||||
<blockBackground colorName="#b3b3b3" start="3,0" stop="3,-1"/>
|
||||
<blockBackground colorName="#b3b3b3" start="4,0" stop="4,-1"/>
|
||||
<blockBackground colorName="#b3b3b3" start="5,0" stop="5,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table1">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
|
||||
<blockBackground colorName="#b3b3b3" start="0,0" stop="0,-1"/>
|
||||
<blockBackground colorName="#b3b3b3" start="1,0" stop="1,-1"/>
|
||||
<blockBackground colorName="#b3b3b3" start="2,0" stop="2,-1"/>
|
||||
<blockBackground colorName="#b3b3b3" start="3,0" stop="3,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table4">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table2">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="6,-1" stop="6,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table6">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table5">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table3">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="0,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="3,0" stop="3,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="4,0" stop="4,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
|
||||
<blockBackground colorName="#cccccc" start="0,0" stop="0,-1"/>
|
||||
<blockBackground colorName="#cccccc" start="1,0" stop="1,-1"/>
|
||||
<blockBackground colorName="#cccccc" start="2,0" stop="2,-1"/>
|
||||
<blockBackground colorName="#cccccc" start="3,0" stop="3,-1"/>
|
||||
<blockBackground colorName="#cccccc" start="4,0" stop="4,-1"/>
|
||||
</blockTableStyle>
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="Standard" fontName="Helvetica"/>
|
||||
<paraStyle name="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Caption" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Index" fontName="Helvetica" fontSize="9.0" leading="11"/>
|
||||
<paraStyle name="Footer" fontName="Helvetica"/>
|
||||
<paraStyle name="Table Contents" fontName="Helvetica"/>
|
||||
<paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER"/>
|
||||
<paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
|
||||
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_space" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
</stylesheet>
|
||||
<images/>
|
||||
<story>
|
||||
<para style="terp_default_8">[[ repeatIn(get_years(data['form']), 'y') ]]</para>
|
||||
<blockTable colWidths="785.0" style="Table_Tiltle">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_header_Centre">Account Balance - [[ company.currency_id.name ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_space">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_header">Year : [[ y['year'] ]]</para>
|
||||
<blockTable colWidths="56.0,198.0,95.0,110.0,105.0,164.0" style="Table_header_account">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">[[ data['form']['show_columns'] and 'Code' or removeParentNode('blockTable') ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Account Name </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">[[ data['form']['compare_pattern']!='none' and 'C.S.Y.T.(C./P)' or removeParentNode('font') ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Debit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Credit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Balance</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_2">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="56.0,198.0,206.0,268.0" style="Table1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">[[ data['form']['show_columns'] and removeParentNode('blockTable') or 'Code' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Account Name </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details"><font>[[ data['form']['compare_pattern']!='none' and 'C.S.Y.T.(C./P)' or removeParentNode('font') ]]</font></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Balance</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_2">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<section>
|
||||
<para style="terp_default_8">[[ repeatIn(get_lines(y,data['form']), 'a') ]]</para>
|
||||
<blockTable colWidths="56.0,197.0,94.0,110.0,106.0,162.0" style="Table4">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ (data['form']['format_perc'] or not data['form']['show_columns']) and removeParentNode('blockTable') ]] [[ a['code'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9"><font color="white">[['.....'*(a['level']-1) ]]</font><font>[[ a['name'] ]]</font></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ a['pattern'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ a['debit'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ a['credit'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ a['balance'] ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_2"/>
|
||||
<blockTable colWidths="56.0,197.0,94.0,110.0,107.0,85.0,77.0" style="Table2">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ (not data['form']['format_perc'] or not data['form']['show_columns']) and removeParentNode('blockTable') ]] [[ a['code'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9"><font color="white">[['.....'*(a['level']-1) ]]</font> <font>[[ a['name'] ]]</font></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ a['pattern'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ a['debit'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ a['credit'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ a['balance'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ a['balance_perc'] ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_2">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="55.0,197.0,94.0,380.0" style="Table6">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ (data['form']['format_perc'] or data['form']['show_columns']) and removeParentNode('blockTable') ]] [[ a['code'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9"><font color="white">[['.....'*(a['level']-1) ]]</font><font> [[ a['name'] ]]</font></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ a['pattern'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ a['balance'] ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_2">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="54.0,197.0,94.0,275.0,106.0" style="Table5">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ (not data['form']['format_perc'] or data['form']['show_columns']) and removeParentNode('blockTable') ]] [[ a['code'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9"><font color="white">[['.....'*(a['level']-1) ]]</font> <font> [[ a['name'] ]]</font></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ a['pattern'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ a['balance'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ a['balance_perc'] ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_2"/>
|
||||
</section>
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="52.0,291.0,112.0,107.0,164.0" style="Table3">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ not data['form']['show_columns'] and removeParentNode('blockTable') ]] </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Total :</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">[[ total_dr() ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">[[ total_cr() ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_space">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_tblheader_Details">[[ data['form']['compare_pattern']!='none' and "C.S.Y.T.(C./P) : Compare Selected Years In Terms of Cash/Perc" or removeParentNode('font') ]]</para>
|
||||
</story>
|
||||
</document>
|
||||
@@ -1,182 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<document filename="Account Balance.pdf">
|
||||
<template pageSize="(1120.0,770.0)" title="Account Balance" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20" >
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="22.0" y1="31.0" width="1080" height="680"/>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
<blockTableStyle id="Standard_Outline">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table1">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<blockBackground colorName="#e6e6e6" start="0,0" stop="-1,-1"/>
|
||||
<blockBackground colorName="#e6e6e6" start="1,0" stop="-1,-1"/>
|
||||
<blockBackground colorName="#e6e6e6" start="2,0" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table6">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<blockBackground colorName="#e6e6e6" start="0,0" stop="-1,-1"/>
|
||||
<blockBackground colorName="#e6e6e6" start="1,0" stop="-1,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,0" stop="-1,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,0" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table61">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="GRID" colorName="red"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table2">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="GRID" colorName="black"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table5">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,0" stop="-1,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,0" stop="-1,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,0" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table4">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="GRID" colorName="black"/>
|
||||
</blockTableStyle>
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="P1" fontName="Helvetica" fontSize="12.0" leading="18" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P2" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT"/>
|
||||
<paraStyle name="P3" fontName="Helvetica-Bold" fontSize="9.0" leading="10" alignment="RIGHT"/>
|
||||
<paraStyle name="P4" fontName="Helvetica" fontSize="9.0" alignment="CENTER"/>
|
||||
<paraStyle name="P5" fontName="Helvetica" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P6" fontName="Helvetica" fontSize="9.0" leading="12" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P7" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT"/>
|
||||
<paraStyle name="P8" fontName="Helvetica" alignment="CENTER"/>
|
||||
<paraStyle name="P9" fontName="Helvetica" fontSize="11.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P10" fontName="Helvetica" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P11" fontName="Helvetica" fontSize="11.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P12" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P13" rightIndent="17.0" leftIndent="-0.0" fontName="Helvetica-Bold" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="1.0"/>
|
||||
<paraStyle name="Standard" fontName="Helvetica"/>
|
||||
<paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Table Contents" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Caption" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Index" fontName="Helvetica"/>
|
||||
</stylesheet>
|
||||
<story>
|
||||
<blockTable colWidths="143.0,226.0,156.0" repeatRows="1" style="Table1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="Table Contents">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P1">Account Balance</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="Table Contents">[[ company.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P5">Currency: [[ company.currency_id.name ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P8">Printing date: [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]</para>
|
||||
<para style="P8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<section>
|
||||
<para style="P13"> [[repeatIn(linesForYear(data['form']),'year_header',td=len(data['form']['fiscalyear'][0][2]),width=[126],value=['year'],type=['string']) ]]</para>
|
||||
<blockTable colWidths="180.0" style="Table6">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P1">Account Information</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</section>
|
||||
<section>
|
||||
<para style="P13">[[ repeatIn([],'title',td=len(data['form']['fiscalyear'][0][2]),width=[42,42,42],value=['Debit','Credit','Balance'],type=['lable','lable','lable']) ]]</para>
|
||||
<blockTable colWidths="30.0,150.0" style="Table6">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P1">Code</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P1">Account Name</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</section>
|
||||
<section>
|
||||
<para style="P13">[[ repeatIn([],'title',td=len(data['form']['fiscalyear'][0][2]),width=[84,42],value=['Cash','%'],type=['lable','lable']) ]]</para>
|
||||
<blockTable colWidths="180.0" style="Table5">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P4"></para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</section>
|
||||
<para style="P8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<section>
|
||||
<para style="P13">[[ repeatIn(lines(data['form']),'a',td=len(data['form']['fiscalyear'][0][2]),width=[42,42,42],value=['debit','credit','balance'],type=['string','string','string']) ]]</para>
|
||||
<blockTable colWidths="0.0,28.0,152.0" style="Table5">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P3"> </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P7">[[ a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'})) ]][[ a['code'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P2"><font color="white">[['.....'*(a['level']-1) ]]</font><font>[[ a['status']==1 and ( setTag('font','font',{'name':'Helvetica-bold'})) ]][[ a['name'] ]]</font></para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</section>
|
||||
<para style="P8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<section>
|
||||
<para style="P13">[[ repeatIn(linesForTotal(data['form']),'total',td=len(data['form']['fiscalyear'][0][2]),width=[42,42,42],value=['sum_debit','sum_credit',''],type=['string','string','lable'] ) ]]</para>
|
||||
<blockTable colWidths="180.0" style="Table6">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P3">Total:[[ data['form']['show_columns']==0 and removeParentNode('section')]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</section>
|
||||
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</story>
|
||||
</document>
|
||||
@@ -1,179 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<document filename="Account Balance.pdf">
|
||||
<template pageSize="(635.0,842.0)" title="Account Balance" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="15.0" y1="15.0" width="615" height="772"/>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
<blockTableStyle id="Standard_Outline">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table1">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<blockBackground colorName="#e6e6e6" start="0,0" stop="-1,-1"/>
|
||||
<blockBackground colorName="#e6e6e6" start="1,0" stop="-1,-1"/>
|
||||
<blockBackground colorName="#e6e6e6" start="2,0" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table6">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<blockBackground colorName="#e6e6e6" start="0,0" stop="-1,-1"/>
|
||||
<blockBackground colorName="#e6e6e6" start="1,0" stop="-1,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,0" stop="-1,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,0" stop="-1,-1"/>
|
||||
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table61">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="GRID" colorName="red"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table2">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="GRID" colorName="black"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table5">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,0" stop="-1,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,0" stop="-1,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,0" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table4">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="GRID" colorName="black"/>
|
||||
</blockTableStyle>
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="P1" fontName="Helvetica" fontSize="12.0" leading="18" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P2" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0"/>
|
||||
<paraStyle name="P3" fontName="Helvetica-Bold" fontSize="9.0" leading="10" alignment="RIGHT" />
|
||||
<paraStyle name="P4" fontName="Helvetica" fontSize="9.0" alignment="CENTER"/>
|
||||
<paraStyle name="P5" fontName="Helvetica" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P6" fontName="Helvetica" fontSize="9.0" leading="12" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P7" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT"/>
|
||||
<paraStyle name="P8" fontName="Helvetica" alignment="CENTER"/>
|
||||
<paraStyle name="P9" fontName="Helvetica" fontSize="11.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P10" fontName="Helvetica" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P11" fontName="Helvetica" fontSize="11.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P12" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P13" rightIndent="17.0" leftIndent="-0.0" fontName="Helvetica-Bold" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="1.0"/>
|
||||
<paraStyle name="Standard" fontName="Helvetica"/>
|
||||
<paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Table Contents" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Caption" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Index" fontName="Helvetica"/>
|
||||
</stylesheet>
|
||||
<story>
|
||||
<blockTable colWidths="143.0,226.0,156.0" repeatRows="1" style="Table1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="Table Contents"><font color="white"> </font></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P1">Account balance</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3"><font color="white"> </font></para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="Table Contents">[[ company.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4"><font color="white"> </font></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P5">Currency: [[ company.currency_id.name ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P8">Printing date: [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]</para>
|
||||
<para style="P8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<section>
|
||||
<para style="P13"> [[repeatIn(linesForYear(data['form']),'year_header',td=len(data['form']['fiscalyear'][0][2]),width=[126],value=['year'],type=['string']) ]]</para>
|
||||
<blockTable colWidths="190.0" style="Table6">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P1">Account Information</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</section>
|
||||
<section>
|
||||
<para style="P13">[[ repeatIn([],'title',td=len(data['form']['fiscalyear'][0][2]),width=[42,42,42],value=['Debit','Credit','Balance'],type=['lable','lable','lable']) ]]</para>
|
||||
<blockTable colWidths="30.0,160.0" style="Table6">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P1">Code</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P1">Account Name</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</section>
|
||||
<section>
|
||||
<para style="P13">[[ repeatIn([],'title',td=len(data['form']['fiscalyear'][0][2]),width=[84,42],value=['Cash','%'],type=['lable','lable']) ]]</para>
|
||||
<blockTable colWidths="190.0" style="Table5">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P4"><font color="white"> </font></para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</section>
|
||||
<para style="P8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<section>
|
||||
<para style="P13">[[ repeatIn(lines(data['form']),'a',td=len(data['form']['fiscalyear'][0][2]),width=[42,42,42],value=['debit','credit','balance'],type=['string','string','string']) ]]</para>
|
||||
<condPageBreak height="2cm"/>
|
||||
<blockTable colWidths="0.0,28.0,162.0" style="Table5">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P7">[[ a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'})) ]][[ a['code'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P2"><font color="white">[['.....'*(a['level']-1) ]]</font><font>[[ a['status']==1 and ( setTag('font','font',{'name':'Helvetica-bold'})) ]][[ a['name'] ]]</font></para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</section>
|
||||
<para style="P8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<section>
|
||||
<para style="P13">[[ repeatIn(linesForTotal(data['form']),'total',td=len(data['form']['fiscalyear'][0][2]),width=[42,42,42],value=['sum_debit','sum_credit',''],type=['string','string','lable'] ) ]]</para>
|
||||
<blockTable colWidths="190.0" style="Table6">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P3">Total:[[ data['form']['show_columns']==0 and removeParentNode('section')]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</section>
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</story>
|
||||
</document>
|
||||
@@ -1,224 +0,0 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
|
||||
import pooler
|
||||
from report import report_sxw
|
||||
from account.report import account_profit_loss
|
||||
from common_report_header import common_report_header
|
||||
from tools.translate import _
|
||||
|
||||
class report_balancesheet_horizontal(report_sxw.rml_parse, common_report_header):
|
||||
def __init__(self, cr, uid, name, context=None):
|
||||
super(report_balancesheet_horizontal, self).__init__(cr, uid, name, context=context)
|
||||
self.obj_pl = account_profit_loss.report_pl_account_horizontal(cr, uid, name, context=context)
|
||||
self.result_sum_dr = 0.0
|
||||
self.result_sum_cr = 0.0
|
||||
self.result = {}
|
||||
self.res_bl = {}
|
||||
self.result_temp = []
|
||||
self.localcontext.update({
|
||||
'time': time,
|
||||
'get_lines': self.get_lines,
|
||||
'get_lines_another': self.get_lines_another,
|
||||
'get_company': self._get_company,
|
||||
'get_currency': self._get_currency,
|
||||
'sum_dr': self.sum_dr,
|
||||
'sum_cr': self.sum_cr,
|
||||
'get_data':self.get_data,
|
||||
'get_pl_balance':self.get_pl_balance,
|
||||
'get_fiscalyear': self._get_fiscalyear,
|
||||
'get_account': self._get_account,
|
||||
'get_start_period': self.get_start_period,
|
||||
'get_end_period': self.get_end_period,
|
||||
'get_sortby': self._get_sortby,
|
||||
'get_filter': self._get_filter,
|
||||
'get_journal': self._get_journal,
|
||||
'get_start_date':self._get_start_date,
|
||||
'get_end_date':self._get_end_date,
|
||||
'get_company':self._get_company,
|
||||
'get_target_move': self._get_target_move,
|
||||
})
|
||||
self.context = context
|
||||
|
||||
def set_context(self, objects, data, ids, report_type=None):
|
||||
new_ids = ids
|
||||
if (data['model'] == 'ir.ui.menu'):
|
||||
new_ids = 'chart_account_id' in data['form'] and [data['form']['chart_account_id']] or []
|
||||
objects = self.pool.get('account.account').browse(self.cr, self.uid, new_ids)
|
||||
return super(report_balancesheet_horizontal, self).set_context(objects, data, new_ids, report_type=report_type)
|
||||
|
||||
def sum_dr(self):
|
||||
if self.res_bl['type'] == _('Net Profit'):
|
||||
self.result_sum_dr += self.res_bl['balance']*-1
|
||||
return self.result_sum_dr
|
||||
|
||||
def sum_cr(self):
|
||||
if self.res_bl['type'] == _('Net Loss'):
|
||||
self.result_sum_cr += self.res_bl['balance']
|
||||
return self.result_sum_cr
|
||||
|
||||
def get_pl_balance(self):
|
||||
return self.res_bl
|
||||
|
||||
def get_data(self,data):
|
||||
cr, uid = self.cr, self.uid
|
||||
db_pool = pooler.get_pool(self.cr.dbname)
|
||||
|
||||
#Getting Profit or Loss Balance from profit and Loss report
|
||||
self.obj_pl.get_data(data)
|
||||
self.res_bl = self.obj_pl.final_result()
|
||||
|
||||
account_pool = db_pool.get('account.account')
|
||||
currency_pool = db_pool.get('res.currency')
|
||||
|
||||
types = [
|
||||
'liability',
|
||||
'asset'
|
||||
]
|
||||
|
||||
ctx = self.context.copy()
|
||||
ctx['fiscalyear'] = data['form'].get('fiscalyear_id', False)
|
||||
|
||||
if data['form']['filter'] == 'filter_period':
|
||||
ctx['period_from'] = data['form'].get('period_from', False)
|
||||
ctx['period_to'] = data['form'].get('period_to', False)
|
||||
elif data['form']['filter'] == 'filter_date':
|
||||
ctx['date_from'] = data['form'].get('date_from', False)
|
||||
ctx['date_to'] = data['form'].get('date_to', False)
|
||||
ctx['state'] = data['form'].get('target_move', 'all')
|
||||
cal_list = {}
|
||||
pl_dict = {}
|
||||
account_dict = {}
|
||||
account_id = data['form'].get('chart_account_id', False)
|
||||
account_ids = account_pool._get_children_and_consol(cr, uid, account_id, context=ctx)
|
||||
accounts = account_pool.browse(cr, uid, account_ids, context=ctx)
|
||||
|
||||
if not self.res_bl:
|
||||
self.res_bl['type'] = _('Net Profit')
|
||||
self.res_bl['balance'] = 0.0
|
||||
|
||||
if self.res_bl['type'] == _('Net Profit'):
|
||||
self.res_bl['type'] = _('Net Profit')
|
||||
else:
|
||||
self.res_bl['type'] = _('Net Loss')
|
||||
pl_dict = {
|
||||
'code': self.res_bl['type'],
|
||||
'name': self.res_bl['type'],
|
||||
'level': False,
|
||||
'balance':self.res_bl['balance'],
|
||||
}
|
||||
for typ in types:
|
||||
accounts_temp = []
|
||||
for account in accounts:
|
||||
if (account.user_type.report_type) and (account.user_type.report_type == typ):
|
||||
account_dict = {
|
||||
'id': account.id,
|
||||
'code': account.code,
|
||||
'name': account.name,
|
||||
'level': account.level,
|
||||
'balance': account.balance != 0 and account.balance * account.user_type.sign or account.balance,
|
||||
'type': account.type,
|
||||
}
|
||||
currency = account.currency_id and account.currency_id or account.company_id.currency_id
|
||||
if typ == 'liability' and account.type <> 'view' and (account.debit <> account.credit):
|
||||
self.result_sum_dr += account.balance
|
||||
if typ == 'asset' and account.type <> 'view' and (account.debit <> account.credit):
|
||||
self.result_sum_cr += account.balance
|
||||
if data['form']['display_account'] == 'movement':
|
||||
if not currency_pool.is_zero(self.cr, self.uid, currency, account.credit) or not currency_pool.is_zero(self.cr, self.uid, currency, account.debit) or not currency_pool.is_zero(self.cr, self.uid, currency, account.balance):
|
||||
accounts_temp.append(account_dict)
|
||||
elif data['form']['display_account'] == 'not_zero':
|
||||
if not currency_pool.is_zero(self.cr, self.uid, currency, account.balance):
|
||||
accounts_temp.append(account_dict)
|
||||
else:
|
||||
accounts_temp.append(account_dict)
|
||||
if account.id == data['form']['reserve_account_id']:
|
||||
pl_dict['level'] = account['level'] + 1
|
||||
accounts_temp.append(pl_dict)
|
||||
|
||||
self.result[typ] = accounts_temp
|
||||
cal_list[typ]=self.result[typ]
|
||||
|
||||
if cal_list:
|
||||
temp = {}
|
||||
for i in range(0,max(len(cal_list['liability']),len(cal_list['asset']))):
|
||||
if i < len(cal_list['liability']) and i < len(cal_list['asset']):
|
||||
temp={
|
||||
'type': cal_list['liability'][i]['type'],
|
||||
'code': cal_list['liability'][i]['code'],
|
||||
'name': cal_list['liability'][i]['name'],
|
||||
'level': cal_list['liability'][i]['level'],
|
||||
'balance':cal_list['liability'][i]['balance'],
|
||||
'type1': cal_list['asset'][i]['type'],
|
||||
'code1': cal_list['asset'][i]['code'],
|
||||
'name1': cal_list['asset'][i]['name'],
|
||||
'level1': cal_list['asset'][i]['level'],
|
||||
'balance1':cal_list['asset'][i]['balance'],
|
||||
}
|
||||
self.result_temp.append(temp)
|
||||
else:
|
||||
if i < len(cal_list['asset']):
|
||||
temp={
|
||||
'type': '',
|
||||
'code': '',
|
||||
'name': '',
|
||||
'level': False,
|
||||
'balance':False,
|
||||
'type1': cal_list['asset'][i]['type'],
|
||||
'code1': cal_list['asset'][i]['code'],
|
||||
'name1': cal_list['asset'][i]['name'],
|
||||
'level1': cal_list['asset'][i]['level'],
|
||||
'balance1':cal_list['asset'][i]['balance'],
|
||||
}
|
||||
self.result_temp.append(temp)
|
||||
if i < len(cal_list['liability']):
|
||||
temp={
|
||||
'type': cal_list['liability'][i]['type'],
|
||||
'code': cal_list['liability'][i]['code'],
|
||||
'name': cal_list['liability'][i]['name'],
|
||||
'level': cal_list['liability'][i]['level'],
|
||||
'balance':cal_list['liability'][i]['balance'],
|
||||
'type1': '',
|
||||
'code1': '',
|
||||
'name1': '',
|
||||
'level1': False,
|
||||
'balance1':False,
|
||||
}
|
||||
self.result_temp.append(temp)
|
||||
return None
|
||||
|
||||
def get_lines(self):
|
||||
return self.result_temp
|
||||
|
||||
def get_lines_another(self, group):
|
||||
return self.result.get(group, [])
|
||||
|
||||
report_sxw.report_sxw('report.account.balancesheet.horizontal', 'account.account',
|
||||
'addons/account/report/account_balance_sheet_horizontal.rml',parser=report_balancesheet_horizontal,
|
||||
header='internal landscape')
|
||||
|
||||
report_sxw.report_sxw('report.account.balancesheet', 'account.account',
|
||||
'addons/account/report/account_balance_sheet.rml',parser=report_balancesheet_horizontal,
|
||||
header='internal')
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -1,303 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<document filename="Balance Sheet.pdf">
|
||||
<template pageSize="(595.0,842.0)" title="Balance Sheet" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="28.0" y1="28.0" width="539" height="786"/>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
<blockTableStyle id="Standard_Outline">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Heading">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Company_Name">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Date_from_To">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Account_Line_Title">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table5">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Net_Profit_Loss">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,0" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table1">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,1" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table2_header">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,0" stop="-1,0"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="4,0" stop="4,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="4,0" stop="4,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="5,0" stop="5,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="5,0" stop="5,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="6,0" stop="6,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="6,0" stop="6,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="6,0" stop="6,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="6,-1" stop="6,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="7,0" stop="7,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="7,0" stop="7,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="7,0" stop="7,0"/>
|
||||
</blockTableStyle>
|
||||
|
||||
<blockTableStyle id="Table2">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table3">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="-1,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="0,0" stop="-1,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,0" stop="-1,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="P1" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P2" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="Standard" fontName="Times-Roman"/>
|
||||
<paraStyle name="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Caption" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Index" fontName="Helvetica" fontSize="9.0" leading="11"/>
|
||||
<paraStyle name="Footer" fontName="Times-Roman"/>
|
||||
<paraStyle name="Table Contents" fontName="Times-Roman"/>
|
||||
<paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER"/>
|
||||
<paraStyle name="Horizontal Line" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
|
||||
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_header_Left" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Right_9_Bold" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
|
||||
<paraStyle name="terp_level_1_code" fontName="Helvetica-Bold" fontSize="9.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_1_name" fontName="Helvetica-Bold" fontSize="9.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_1_balance" fontName="Helvetica-Bold" fontSize="9.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_2_code" fontName="Helvetica-Bold" fontSize="8.0" leftIndent="0.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_2_name" fontName="Helvetica-Bold" fontSize="8.0" leftIndent="10.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_2_balance" fontName="Helvetica-Bold" fontSize="8.0" leftIndent=".0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_3_code" fontName="Helvetica" fontSize="8.0" leftIndent="0.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_3_code_bold" fontName="Helvetica-Bold" fontSize="8.0" leftIndent="0.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_3_name" fontName="Helvetica" fontSize="8.0" leftIndent="20.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_3_name_bold" fontName="Helvetica-Bold" fontSize="8.0" leftIndent="20.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_3_balance" fontName="Helvetica" fontSize="8.0" leftIndent="0.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_3_balance_bold" fontName="Helvetica-Bold" fontSize="8.0" leftIndent="0.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_4_name" fontName="Helvetica" fontSize="8.0" leftIndent="30.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_4_name_bold" fontName="Helvetica-Bold" fontSize="8.0" leftIndent="30.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
|
||||
<blockTableStyle id="Table1">
|
||||
<blockTopPadding start="0,0" stop="-1,0" length="15"/>
|
||||
<blockFont name="Helvetica-Bold" size="10.0" />
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,1" thickness="1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table2">
|
||||
<blockTopPadding start="0,0" stop="-1,0" length="10"/>
|
||||
<blockAlignment value="LEFT"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#666666" start="1,1" stop="1,1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table3">
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
|
||||
</stylesheet>
|
||||
<images/>
|
||||
<story>
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="539.0" style="Table_Company_Name">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_header_Centre">Balance Sheet</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_8">[[ get_data(data) or removeParentNode('para') ]]</para>
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="120.0,100.0,140.0,90.0,90.0" style="Table2_header" >
|
||||
<tr>
|
||||
<td><para style="terp_tblheader_General_Centre">Chart of Accounts</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Filter By [[ data['form']['filter']!='filter_no' and get_filter(data) ]]</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Display Account</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Target Moves</para></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><para style="terp_default_Centre_8">[[ get_account(data) or removeParentNode('para') ]]</para></td>
|
||||
<td><para style="terp_default_Centre_8">[[ get_fiscalyear(data) or '' ]]</para></td>
|
||||
<td><para style="terp_default_Centre_8">[[ data['form']['filter']=='filter_no' and get_filter(data) or removeParentNode('para') ]] </para>
|
||||
<blockTable colWidths="60.0,60.0" style="Table3">[[ data['form']['filter']=='filter_date' or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="terp_tblheader_Details_Centre">Start Date</para></td>
|
||||
<td><para style="terp_tblheader_Details_Centre">End Date</para></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><para style="terp_default_Centre_8">[[ formatLang(get_start_date(data),date=True) ]]</para></td>
|
||||
<td><para style="terp_default_Centre_8">[[ formatLang(get_end_date(data),date=True) ]]</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="65.0,60.0" style="Table3">[[ data['form']['filter']=='filter_period' or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="terp_tblheader_Details_Centre">Start Period</para></td>
|
||||
<td><para style="terp_tblheader_Details_Centre">End Period</para></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><para style="terp_default_Centre_8">[[ get_start_period(data) or removeParentNode('para') ]]</para></td>
|
||||
<td><para style="terp_default_Centre_8">[[ get_end_period(data) or removeParentNode('para') ]]</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
<td><para style="terp_default_Centre_8">[[ (data['form']['display_account']=='all' and 'All') or (data['form']['display_account']=='movement' and 'With movements') or 'With balance is not equal to 0']]</para></td>
|
||||
<td><para style="terp_default_Centre_8">[[ get_target_move(data) ]] </para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="539.0" style="Table_Company_Name">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_header_Left">Assets</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="100.0,326.0,113.0" style="Table_Account_Line_Title" repeatRows="1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Code</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Account</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Balance</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="Table3">
|
||||
[[ repeatIn(get_lines_another('asset'),'a' ) ]]
|
||||
[[ setTag('tr','tr',{'style': 'Table'+str(min(3,a['level']))}) ]]
|
||||
<td><para style="terp_level_3_code">[[ (a['type'] =='view' and a['level'] >= 3) and setTag('para','para',{'style': 'terp_level_3_code_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(3,a['level']))+'_code'}) ]]<i>[[ a['code'] ]]</i></para></td>
|
||||
<td><para style="terp_level_3_name">[[ (a['type'] =='view' and a['level'] >= 3) and setTag('para','para',{'style': 'terp_level_'+str(min(3,a['level']))+'_name_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(4,a['level']))+'_name'}) ]][[ a['name'] ]]</para></td>
|
||||
<td>[[ (a['level'] <>2) or removeParentNode('td') ]]<para style="terp_level_3_balance">[[ (a['type'] =='view' and a['level'] >= 3) and setTag('para','para',{'style': 'terp_level_3_balance_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(3,a['level']))+'_balance'}) ]][[ formatLang(a['balance'], currency_obj = company.currency_id) ]]</para></td>
|
||||
<td>[[ a['level'] == 2 or removeParentNode('td') ]]<para style="terp_level_2_balance"><u>[[ formatLang(a['balance'], currency_obj = company.currency_id) ]]</u></para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="426.0,113.0" style="Table_Net_Profit_Loss">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Balance:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9_Bold"><u>[[ formatLang(sum_cr(), currency_obj = company.currency_id) ]]</u></para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<condPageBreak height="20cm"/>
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="539.0" style="Table_Company_Name">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_header_Left">Liabilities</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="100.0,326.0,113.0" style="Table_Account_Line_Title" repeatRows="1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Code</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Account</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Balance</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="Table3">
|
||||
[[ repeatIn(get_lines_another('liability'),'a' ) ]]
|
||||
[[ setTag('tr','tr',{'style': 'Table'+str(min(3,a['level']))}) ]]
|
||||
<td><para style="terp_level_3_code">[[ (a['type'] =='view' and a['level'] >= 3) and setTag('para','para',{'style': 'terp_level_3_code_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(3,a['level']))+'_code'}) ]]<i>[[ a['code'] ]]</i></para></td>
|
||||
<td><para style="terp_level_3_name">[[ (a['type'] =='view' and a['level'] >= 3) and setTag('para','para',{'style': 'terp_level_'+str(min(3,a['level']))+'_name_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(4,a['level']))+'_name'}) ]][[ a['name'] ]]</para></td>
|
||||
<td>[[ (a['level'] <>2) or removeParentNode('td') ]]<para style="terp_level_3_balance">[[ (a['type'] =='view' and a['level'] >= 3) and setTag('para','para',{'style': 'terp_level_3_balance_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(3,a['level']))+'_balance'}) ]][[ formatLang(a['balance'], currency_obj = company.currency_id) ]]</para></td>
|
||||
<td>[[ a['level'] == 2 or removeParentNode('td') ]]<para style="terp_level_2_balance"><u>[[ formatLang(a['balance'], currency_obj = company.currency_id) ]]</u></para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="426.0,113.0" style="Table_Net_Profit_Loss">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Balance:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9_Bold"><u>[[ formatLang(sum_dr(), currency_obj = company.currency_id) ]]</u></para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</story>
|
||||
</document>
|
||||
@@ -1,250 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<document filename="Balance Sheet.pdf">
|
||||
<template pageSize="(842.0,595.0)" title="Balance Sheet" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="28.0" y1="57.0" width="772" height="481"/>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
<blockTableStyle id="Standard_Outline">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Heading">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Company_Name">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Date_from_To">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Account_Line_Title">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,1" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Main_Content">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Liability_side">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Asset_Side_Content">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Net_Profit_Loss">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,0" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table2_header">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,0" stop="-1,0"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="4,0" stop="4,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="4,0" stop="4,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="5,0" stop="5,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="5,0" stop="5,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="6,0" stop="6,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="6,0" stop="6,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="6,0" stop="6,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="6,-1" stop="6,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="7,0" stop="7,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="7,0" stop="7,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="7,0" stop="7,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table3">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
|
||||
</blockTableStyle>
|
||||
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="P1" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P2" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P3" rightIndent="0.0" leftIndent="1.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P4" rightIndent="121.0" leftIndent="-1.0" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="Standard" fontName="Times-Roman"/>
|
||||
<paraStyle name="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Caption" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Index" fontName="Helvetica" fontSize="9.0" leading="11"/>
|
||||
<paraStyle name="Footer" fontName="Times-Roman"/>
|
||||
<paraStyle name="Table Contents" fontName="Times-Roman"/>
|
||||
<paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER"/>
|
||||
<paraStyle name="Horizontal Line" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
|
||||
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Right_9_Bold" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
</stylesheet>
|
||||
<images/>
|
||||
<story>
|
||||
<para style="terp_header_Centre">Balance Sheet</para>
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_default_8">[[ get_data(data) or removeParentNode('para') ]]</para>
|
||||
|
||||
<blockTable colWidths="250.0,100.0,150.0,120.0,150.0" style="Table2_header" >
|
||||
<tr>
|
||||
<td><para style="terp_tblheader_General_Centre">Chart of Accounts</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Filter By [[ data['form']['filter']!='filter_no' and get_filter(data) ]]</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Display Account</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Target Moves</para></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><para style="terp_default_Centre_8">[[ get_account(data) or removeParentNode('para') ]]</para></td>
|
||||
<td><para style="terp_default_Centre_8">[[ get_fiscalyear(data) or '' ]]</para></td>
|
||||
<td><para style="terp_default_Centre_8">[[ data['form']['filter']=='filter_no' and get_filter(data) or removeParentNode('para') ]] </para>
|
||||
<blockTable colWidths="70.0,70.0" style="Table3">[[ data['form']['filter']=='filter_date' or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="terp_tblheader_Details_Centre">Start Date</para></td>
|
||||
<td><para style="terp_tblheader_Details_Centre">End Date</para></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><para style="terp_default_Centre_8">[[ formatLang(get_start_date(data),date=True) ]]</para></td>
|
||||
<td><para style="terp_default_Centre_8">[[ formatLang(get_end_date(data),date=True) ]]</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="70.0,70.0" style="Table3">[[ data['form']['filter']=='filter_period' or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="terp_tblheader_Details_Centre">Start Period</para></td>
|
||||
<td><para style="terp_tblheader_Details_Centre">End Period</para></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><para style="terp_default_Centre_8">[[ get_start_period(data) or removeParentNode('para') ]]</para></td>
|
||||
<td><para style="terp_default_Centre_8">[[ get_end_period(data) or removeParentNode('para') ]]</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
<td><para style="terp_default_Centre_8">[[ (data['form']['display_account']=='all' and 'All') or (data['form']['display_account']=='movement' and 'With movements') or 'With balance is not equal to 0']]</para></td>
|
||||
<td><para style="terp_default_Centre_8">[[ get_target_move(data) ]]</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="80.0,210.16,100.32,80.0,210.16,100.32" style="Table_Account_Line_Title" repeatRows="1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Code</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Assets</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Balance</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Code</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Liabilities</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Balance</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">
|
||||
<font>[[ repeatIn(get_lines(),'a' ) ]] </font>[[ a['code1'] ]]<font>[[ a['level1']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]]</font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">
|
||||
<font color="white">[[ '. '*(a['level1']-1) ]]</font><font>[[ a['level1']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name1'] ]]</font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">
|
||||
<font>[[ a['level1']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]]</font><font>[[ formatLang(a['balance1'], currency_obj=company.currency_id) ]]</font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">
|
||||
[[ a['code'] ]]<font>[[ ( a['level']<4 or a['name']=='Net Profit') and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]]</font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">
|
||||
<font color="white">[[ '. '*(a['level']-1) ]]</font>
|
||||
<font>[[ ( a['level']<4 or a['name']=='Net Profit') and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name'] ]]</font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">
|
||||
<font>[[ ( a['level']<4 or a['name']=='Net Profit') and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]]</font>
|
||||
<font>[[(a['code'] and a['name']) and formatLang(a['balance'], currency_obj=company.currency_id) or removeParentNode('font')]]</font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="290.16,100.32,290.16,100.32" style="Table_Net_Profit_Loss">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Balance:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9_Bold"><u>[[ formatLang(sum_cr(), currency_obj=company.currency_id) ]]</u></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Balance:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9_Bold"><u>[[ formatLang(sum_dr(), currency_obj=company.currency_id) ]]</u></para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</story>
|
||||
</document>
|
||||
|
||||
@@ -64,29 +64,30 @@ class report_account_common(report_sxw.rml_parse, common_report_header):
|
||||
vals['balance_cmp'] = self.pool.get('account.financial.report').browse(self.cr, self.uid, report.id, context=data['form']['comparison_context']).balance
|
||||
lines.append(vals)
|
||||
account_ids = []
|
||||
if report.type == 'accounts' and report.display_detail and report.account_ids:
|
||||
if report.type == 'accounts' and report.account_ids:
|
||||
account_ids = account_obj._get_children_and_consol(self.cr, self.uid, [x.id for x in report.account_ids])
|
||||
elif report.type == 'account_type' and report.account_type_ids:
|
||||
account_ids = account_obj.search(self.cr, self.uid, [('user_type','in', [x.id for x in report.account_type_ids])])
|
||||
if account_ids:
|
||||
for account in account_obj.browse(self.cr, self.uid, account_ids, context=data['form']['used_context']):
|
||||
if account.type != 'view':
|
||||
flag = False
|
||||
vals = {
|
||||
'name': account.code + ' ' + account.name,
|
||||
'balance': account.balance != 0 and account.balance * account.user_type.sign or account.balance,
|
||||
'type': 'account',
|
||||
'level': 6,
|
||||
'account_type': account.type,
|
||||
}
|
||||
if not currency_obj.is_zero(self.cr, self.uid, account.company_id.currency_id, vals['balance']):
|
||||
if report.display_detail == 'detail_flat' and account.type == 'view':
|
||||
continue
|
||||
flag = False
|
||||
vals = {
|
||||
'name': account.code + ' ' + account.name,
|
||||
'balance': account.balance != 0 and account.balance * report.sign or account.balance,
|
||||
'type': 'account',
|
||||
'level': report.display_detail == 'detail_with_hierarchy' and min(account.level,6) or 6,
|
||||
'account_type': account.type,
|
||||
}
|
||||
if not currency_obj.is_zero(self.cr, self.uid, account.company_id.currency_id, vals['balance']):
|
||||
flag = True
|
||||
if data['form']['enable_filter']:
|
||||
vals['balance_cmp'] = account_obj.browse(self.cr, self.uid, account.id, context=data['form']['comparison_context']).balance
|
||||
if not currency_obj.is_zero(self.cr, self.uid, account.company_id.currency_id, vals['balance_cmp']):
|
||||
flag = True
|
||||
if data['form']['enable_filter']:
|
||||
vals['balance_cmp'] = account_obj.browse(self.cr, self.uid, account.id, context=data['form']['comparison_context']).balance
|
||||
if not currency_obj.is_zero(self.cr, self.uid, account.company_id.currency_id, vals['balance_cmp']):
|
||||
flag = True
|
||||
if flag:
|
||||
lines.append(vals)
|
||||
if flag:
|
||||
lines.append(vals)
|
||||
return lines
|
||||
|
||||
report_sxw.report_sxw('report.account.financial.report', 'account.financial.report',
|
||||
|
||||
@@ -130,15 +130,13 @@
|
||||
<paraStyle name="terp_level_1_name" fontName="Helvetica-Bold" fontSize="9.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_1_balance" fontName="Helvetica-Bold" fontSize="9.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_2_name" fontName="Helvetica-Bold" fontSize="8.0" leftIndent="10.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_2_balance" fontName="Helvetica-Bold" fontSize="8.0" leftIndent=".0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_3_name" fontName="Helvetica-Bold" fontSize="8.0" leftIndent="20.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_3_balance" fontName="Helvetica-Bold" fontSize="8.0" leftIndent=".0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_2_balance" fontName="Helvetica-Bold" fontSize="8.0" leftIndent="10.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_3_name" fontName="Helvetica" fontSize="8.0" leftIndent="20.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_3_name_bold" fontName="Helvetica-Bold" fontSize="8.0" leftIndent="20.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_3_balance" fontName="Helvetica" fontSize="8.0" leftIndent="0.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_3_balance_bold" fontName="Helvetica-Bold" fontSize="8.0" leftIndent="0.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_4_name" fontName="Helvetica" fontSize="8.0" leftIndent="30.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_4_balance" fontName="Helvetica" fontSize="8.0" leftIndent="0.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_5_name" fontName="Helvetica" fontSize="8.0" leftIndent="40.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_5_balance" fontName="Helvetica-Oblique" fontSize="8.0" leftIndent="0.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_6_name" fontName="Helvetica" fontSize="8.0" leftIndent="50.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_6_balance" fontName="Helvetica" fontSize="8.0" leftIndent="0.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_4_name_bold" fontName="Helvetica-Bold" fontSize="8.0" leftIndent="30.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
|
||||
<blockTableStyle id="Table1">
|
||||
<blockTopPadding start="0,0" stop="-1,0" length="15"/>
|
||||
@@ -229,13 +227,13 @@
|
||||
<para style="terp_tblheader_Details_Right">Balance</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="Table1">
|
||||
<tr style="Table3">
|
||||
[[ repeatIn(get_lines(data), 'a') ]]
|
||||
[[ (a.get('level') <> 0) or removeParentNode('tr') ]]
|
||||
[[ setTag('tr','tr',{'style': 'Table'+str(min(3,'level' in a and a.get('level') or 1))}) ]]
|
||||
<td><para style="terp_level_1_name">[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_name'}) ]] [[ a.get('name') ]]</para></td>
|
||||
<td>[[ a.get('level') == 4 or removeParentNode('td') ]]<para style="terp_level_1_balance"><u>[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_balance'}) ]][[ formatLang(a.get('balance'))]] [[company.currency_id.symbol]]</u></para></td>
|
||||
<td>[[ a.get('level') <> 4 or removeParentNode('td') ]]<para style="terp_level_1_balance">[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_balance'}) ]][[ formatLang(a.get('balance'))]] [[company.currency_id.symbol]]</para></td>
|
||||
<td><para style="terp_level_3_name">[[ (a.get('account_type') =='view' and a.get('level') >= 3) and setTag('para','para',{'style': 'terp_level_'+str(min(3,a.get('level')))+'_name_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(4,a.get('level')))+'_name'}) ]][[ a.get('name') ]]</para></td>
|
||||
<td>[[ (a.get('level') <>2) or removeParentNode('td') ]]<para style="terp_level_3_balance">[[ (a.get('account_type') =='view' and a.get('level') >= 3) and setTag('para','para',{'style': 'terp_level_3_balance_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(3,a.get('level')))+'_balance'}) ]][[ formatLang(a.get('balance'), currency_obj = company.currency_id) ]]</para></td>
|
||||
<td>[[ a.get('level') == 2 or removeParentNode('td') ]]<para style="terp_level_2_balance"><u>[[ formatLang(a.get('balance'), currency_obj = company.currency_id) ]]</u></para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="Standard">
|
||||
@@ -258,11 +256,11 @@
|
||||
[[ repeatIn(get_lines(data), 'a') ]]
|
||||
[[ (a.get('level') <> 0) or removeParentNode('tr') ]]
|
||||
[[ setTag('tr','tr',{'style': 'Table'+str(min(3,'level' in a and a.get('level') or 1))}) ]]
|
||||
<td><para style="terp_level_1_name">[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_name'}) ]] [[ a.get('name') ]]</para></td>
|
||||
<td>[[ a.get('level') == 4 or removeParentNode('td') ]]<para style="terp_level_1_balance"><u>[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_balance'}) ]][[ formatLang(a.get('balance'))]] [[company.currency_id.symbol]]</u></para></td>
|
||||
<td>[[ a.get('level') <> 4 or removeParentNode('td') ]]<para style="terp_level_1_balance">[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_balance'}) ]][[ formatLang(a.get('balance'))]] [[company.currency_id.symbol]]</para></td>
|
||||
<td>[[ a.get('level') == 4 or removeParentNode('td') ]]<para style="terp_level_1_balance"><u>[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_balance'}) ]][[ formatLang(a.get('balance_cmp'))]] [[company.currency_id.symbol]]</u></para></td>
|
||||
<td>[[ a.get('level') <> 4 or removeParentNode('td') ]]<para style="terp_level_1_balance">[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_balance'}) ]][[ formatLang(a.get('balance_cmp'))]] [[company.currency_id.symbol]]</para></td>
|
||||
<td><para style="terp_level_3_name">[[ (a.get('account_type') =='view' and a.get('level') >= 3) and setTag('para','para',{'style': 'terp_level_'+str(min(3,a.get('level')))+'_name_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(4,a.get('level')))+'_name'}) ]][[ a.get('name') ]]</para></td>
|
||||
<td>[[ (a.get('level') <>2) or removeParentNode('td') ]]<para style="terp_level_3_balance">[[ (a.get('account_type') =='view' and a.get('level') >= 3) and setTag('para','para',{'style': 'terp_level_3_balance_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(3,a.get('level')))+'_balance'}) ]][[ formatLang(a.get('balance'), currency_obj = company.currency_id) ]]</para></td>
|
||||
<td>[[ a.get('level') == 2 or removeParentNode('td') ]]<para style="terp_level_2_balance"><u>[[ formatLang(a.get('balance'), currency_obj = company.currency_id) ]]</u></para></td>
|
||||
<td>[[ (a.get('level') <>2) or removeParentNode('td') ]]<para style="terp_level_3_balance">[[ (a.get('account_type') =='view' and a.get('level') >= 3) and setTag('para','para',{'style': 'terp_level_3_balance_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(3,a.get('level')))+'_balance'}) ]][[ formatLang(a.get('balance_cmp'), currency_obj = company.currency_id) ]]</para></td>
|
||||
<td>[[ a.get('level') == 2 or removeParentNode('td') ]]<para style="terp_level_2_balance"><u>[[ formatLang(a.get('balance_cmp'), currency_obj = company.currency_id) ]]</u></para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="Standard">
|
||||
|
||||
@@ -1,282 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<document filename="Profit and Loss.pdf">
|
||||
<template pageSize="(842.0,595.0)" title="Profit And Loss" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="28.0" y1="57.0" width="772" height="481"/>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
<blockTableStyle id="Standard_Outline">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Heading">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Company_Name">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Date_from_To">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_debit_credit">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Account_Line_Title">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,1" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Main_Content">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Expense_Content">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Income_Content">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table3">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Net_Profit_Loss">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,0" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Final_Result">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="1,0" stop="1,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table2_header">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,0" stop="-1,0"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="4,0" stop="4,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="4,0" stop="4,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="5,0" stop="5,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="5,0" stop="5,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="6,0" stop="6,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="6,0" stop="6,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="6,0" stop="6,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="6,-1" stop="6,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="7,0" stop="7,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="7,0" stop="7,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="7,0" stop="7,0"/>
|
||||
</blockTableStyle>
|
||||
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="P1" rightIndent="2.0" leftIndent="0.0" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P2" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="Standard" fontName="Times-Roman"/>
|
||||
<paraStyle name="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Caption" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Index" fontName="Helvetica" fontSize="9.0" leading="11"/>
|
||||
<paraStyle name="Footer" fontName="Times-Roman"/>
|
||||
<paraStyle name="Table Contents" fontName="Times-Roman"/>
|
||||
<paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER"/>
|
||||
<paraStyle name="Horizontal Line" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
|
||||
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Right_9_Bold" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
</stylesheet>
|
||||
<images/>
|
||||
<story>
|
||||
<blockTable colWidths="539.0" style="Table_Company_Name">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_header_Centre">Profit And Loss</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P2">[[ get_data(data) or removeParentNode('para')]]</para>
|
||||
<blockTable colWidths="250.0,100.0,150.0,120.0,150.0" style="Table2_header">
|
||||
<tr>
|
||||
<td><para style="terp_tblheader_General_Centre">Chart of Accounts</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Filter By [[ data['form']['filter']!='filter_no' and get_filter(data) ]]</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Display Account</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Target Moves</para></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><para style="terp_default_Centre_8">[[ get_account(data) or removeParentNode('para') ]]</para></td>
|
||||
<td><para style="terp_default_Centre_8">[[ get_fiscalyear(data) or '' ]]</para></td>
|
||||
<td><para style="terp_default_Centre_8">[[ data['form']['filter']=='filter_no' and get_filter(data) or removeParentNode('para') ]] </para>
|
||||
<blockTable colWidths="70.0,70.0" style="Table3">[[ data['form']['filter']=='filter_date' or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="terp_tblheader_General_Centre">Start Date</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">End Date</para></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><para style="terp_default_Centre_8">[[ formatLang(get_start_date(data),date=True) ]]</para></td>
|
||||
<td><para style="terp_default_Centre_8">[[ formatLang(get_end_date(data),date=True) ]]</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="70.0,70.0" style="Table3">[[ data['form']['filter']=='filter_period' or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="terp_tblheader_General_Centre">Start Period</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">End Period</para></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><para style="terp_default_Centre_8">[[ get_start_period(data) or removeParentNode('para') ]]</para></td>
|
||||
<td><para style="terp_default_Centre_8">[[ get_end_period(data) or removeParentNode('para') ]]</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
<td><para style="terp_default_Centre_8">[[ (data['form']['display_account']=='all' and 'All') or (data['form']['display_account']=='movement' and 'With movements') or 'With balance is not equal to 0']]</para></td>
|
||||
<td><para style="terp_default_Centre_8">[[ get_target_move(data) ]]</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="80.0,210.16,100.32,80.0,210.16,100.32" style="Table_Account_Line_Title" repeatRows="1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Code</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Expenses</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Balance</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Code</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Income</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P1">Balance</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">
|
||||
|
||||
<font>[[ repeatIn(get_lines(),'a' ) ]] </font>[[ a['code'] ]]<font>[[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]]</font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">
|
||||
<font color="white">[[ '. '*(a['level']-1) ]]</font><font>[[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name'] ]]</font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9"><font>[[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]]</font><font>[[ formatLang(abs(a['balance']), currency_obj=company.currency_id) ]]</font></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">
|
||||
[[ a['code1'] ]]<font>[[ a['level1']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]]</font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">
|
||||
<font color="white">[[ '. '*(a['level1']-1) ]]</font><font>[[ a['level1']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name1'] ]]</font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9"><font>[[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]]</font><font>[[(a['code1'] and a['name1']) and formatLang(abs(a['balance1']), currency_obj=company.currency_id) or removeParentNode('font') ]]</font></para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="80.0,210.16,100.32,80.0,210.16,100.32" style="Table_Net_Profit_Loss">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">[[ final_result()['type'] == 'Net Profit' and final_result()['type'] or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9_Bold">[[ final_result()['balance'] and final_result()['type'] == 'Net Profit' and formatLang(abs(final_result()['balance']), currency_obj=company.currency_id) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">[[ final_result()['type'] == 'Net Loss' and final_result()['type'] or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9_Bold">[[ final_result()['balance'] and final_result()['type'] == 'Net Loss' and formatLang(abs(final_result()['balance']), currency_obj=company.currency_id) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
<blockTable colWidths="290.16,100.32,290.16,100.32" style="Table_Net_Profit_Loss">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Total:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9_Bold"><u>[[ formatLang(abs(sum_dr()), currency_obj=company.currency_id) ]]</u></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Total:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9_Bold"><u>[[ formatLang(abs(sum_cr()), currency_obj=company.currency_id) ]]</u></para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</story>
|
||||
</document>
|
||||
|
||||
@@ -1,198 +0,0 @@
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
import pooler
|
||||
from report import report_sxw
|
||||
from common_report_header import common_report_header
|
||||
from tools.translate import _
|
||||
|
||||
class report_pl_account_horizontal(report_sxw.rml_parse, common_report_header):
|
||||
|
||||
def __init__(self, cr, uid, name, context=None):
|
||||
super(report_pl_account_horizontal, self).__init__(cr, uid, name, context=context)
|
||||
self.result_sum_dr = 0.0
|
||||
self.result_sum_cr = 0.0
|
||||
self.res_pl = {}
|
||||
self.result = {}
|
||||
self.result_temp = []
|
||||
self.localcontext.update( {
|
||||
'time': time,
|
||||
'get_lines': self.get_lines,
|
||||
'get_lines_another': self.get_lines_another,
|
||||
'get_currency': self._get_currency,
|
||||
'get_data': self.get_data,
|
||||
'sum_dr': self.sum_dr,
|
||||
'sum_cr': self.sum_cr,
|
||||
'final_result': self.final_result,
|
||||
'get_fiscalyear': self._get_fiscalyear,
|
||||
'get_account': self._get_account,
|
||||
'get_start_period': self.get_start_period,
|
||||
'get_end_period': self.get_end_period,
|
||||
'get_sortby': self._get_sortby,
|
||||
'get_filter': self._get_filter,
|
||||
'get_journal': self._get_journal,
|
||||
'get_start_date':self._get_start_date,
|
||||
'get_end_date':self._get_end_date,
|
||||
'get_company':self._get_company,
|
||||
'get_target_move': self._get_target_move,
|
||||
})
|
||||
self.context = context
|
||||
|
||||
def set_context(self, objects, data, ids, report_type=None):
|
||||
new_ids = ids
|
||||
if (data['model'] == 'ir.ui.menu'):
|
||||
new_ids = 'chart_account_id' in data['form'] and [data['form']['chart_account_id']] or []
|
||||
objects = self.pool.get('account.account').browse(self.cr, self.uid, new_ids)
|
||||
return super(report_pl_account_horizontal, self).set_context(objects, data, new_ids, report_type=report_type)
|
||||
|
||||
|
||||
def final_result(self):
|
||||
return self.res_pl
|
||||
|
||||
def sum_dr(self):
|
||||
if self.res_pl['type'] == _('Net Profit'):
|
||||
self.result_sum_dr += self.res_pl['balance']
|
||||
return self.result_sum_dr
|
||||
|
||||
def sum_cr(self):
|
||||
if self.res_pl['type'] == _('Net Loss'):
|
||||
self.result_sum_cr += self.res_pl['balance']
|
||||
return self.result_sum_cr
|
||||
|
||||
def get_data(self, data):
|
||||
cr, uid = self.cr, self.uid
|
||||
db_pool = pooler.get_pool(self.cr.dbname)
|
||||
|
||||
account_pool = db_pool.get('account.account')
|
||||
currency_pool = db_pool.get('res.currency')
|
||||
|
||||
types = [
|
||||
'expense',
|
||||
'income'
|
||||
]
|
||||
|
||||
ctx = self.context.copy()
|
||||
ctx['fiscalyear'] = data['form'].get('fiscalyear_id', False)
|
||||
|
||||
if data['form']['filter'] == 'filter_period':
|
||||
ctx['period_from'] = data['form'].get('period_from', False)
|
||||
ctx['period_to'] = data['form'].get('period_to', False)
|
||||
elif data['form']['filter'] == 'filter_date':
|
||||
ctx['date_from'] = data['form'].get('date_from', False)
|
||||
ctx['date_to'] = data['form'].get('date_to', False)
|
||||
|
||||
cal_list = {}
|
||||
account_id = data['form'].get('chart_account_id', False)
|
||||
company_currency = account_pool.browse(self.cr, self.uid, account_id).company_id.currency_id
|
||||
account_ids = account_pool._get_children_and_consol(cr, uid, account_id, context=ctx)
|
||||
accounts = account_pool.browse(cr, uid, account_ids, context=ctx)
|
||||
|
||||
for typ in types:
|
||||
accounts_temp = []
|
||||
for account in accounts:
|
||||
if (account.user_type.report_type) and (account.user_type.report_type == typ):
|
||||
currency = account.currency_id and account.currency_id or account.company_id.currency_id
|
||||
if typ == 'expense' and account.type <> 'view' and (account.debit <> account.credit):
|
||||
self.result_sum_dr += account.debit - account.credit
|
||||
if typ == 'income' and account.type <> 'view' and (account.debit <> account.credit):
|
||||
self.result_sum_cr += account.credit - account.debit
|
||||
if data['form']['display_account'] == 'movement':
|
||||
if not currency_pool.is_zero(self.cr, self.uid, currency, account.credit) or not currency_pool.is_zero(self.cr, self.uid, currency, account.debit) or not currency_pool.is_zero(self.cr, self.uid, currency, account.balance):
|
||||
accounts_temp.append(account)
|
||||
elif data['form']['display_account'] == 'not_zero':
|
||||
if not currency_pool.is_zero(self.cr, self.uid, currency, account.balance):
|
||||
accounts_temp.append(account)
|
||||
else:
|
||||
accounts_temp.append(account)
|
||||
if currency_pool.is_zero(self.cr, self.uid, company_currency, (self.result_sum_dr-self.result_sum_cr)):
|
||||
self.res_pl['type'] = None
|
||||
self.res_pl['balance'] = 0.0
|
||||
elif self.result_sum_dr > self.result_sum_cr:
|
||||
self.res_pl['type'] = _('Net Loss')
|
||||
self.res_pl['balance'] = (self.result_sum_dr - self.result_sum_cr)
|
||||
else:
|
||||
self.res_pl['type'] = _('Net Profit')
|
||||
self.res_pl['balance'] = (self.result_sum_cr - self.result_sum_dr)
|
||||
self.result[typ] = accounts_temp
|
||||
cal_list[typ] = self.result[typ]
|
||||
if cal_list:
|
||||
temp = {}
|
||||
for i in range(0,max(len(cal_list['expense']),len(cal_list['income']))):
|
||||
if i < len(cal_list['expense']) and i < len(cal_list['income']):
|
||||
temp={
|
||||
'code': cal_list['expense'][i].code,
|
||||
'name': cal_list['expense'][i].name,
|
||||
'level': cal_list['expense'][i].level,
|
||||
'balance': cal_list['expense'][i].balance != 0 and \
|
||||
cal_list['expense'][i].balance * cal_list['expense'][i].user_type.sign or \
|
||||
cal_list['expense'][i].balance,
|
||||
'code1': cal_list['income'][i].code,
|
||||
'name1': cal_list['income'][i].name,
|
||||
'level1': cal_list['income'][i].level,
|
||||
'balance1': cal_list['income'][i].balance != 0 and \
|
||||
cal_list['income'][i].balance * cal_list['income'][i].user_type.sign or \
|
||||
cal_list['income'][i].balance,
|
||||
}
|
||||
self.result_temp.append(temp)
|
||||
else:
|
||||
if i < len(cal_list['income']):
|
||||
temp={
|
||||
'code': '',
|
||||
'name': '',
|
||||
'level': False,
|
||||
'balance':False,
|
||||
'code1': cal_list['income'][i].code,
|
||||
'name1': cal_list['income'][i].name,
|
||||
'level1': cal_list['income'][i].level,
|
||||
'balance1': cal_list['income'][i].balance != 0 and \
|
||||
cal_list['income'][i].balance * cal_list['income'][i].user_type.sign \
|
||||
or cal_list['income'][i].balance,
|
||||
}
|
||||
self.result_temp.append(temp)
|
||||
if i < len(cal_list['expense']):
|
||||
temp={
|
||||
'code': cal_list['expense'][i].code,
|
||||
'name': cal_list['expense'][i].name,
|
||||
'level': cal_list['expense'][i].level,
|
||||
'balance': cal_list['expense'][i].balance != 0 and \
|
||||
cal_list['expense'][i].balance * cal_list['expense'][i].user_type.sign \
|
||||
or cal_list['expense'][i].balance,
|
||||
'code1': '',
|
||||
'name1': '',
|
||||
'level1': False,
|
||||
'balance1':False,
|
||||
}
|
||||
self.result_temp.append(temp)
|
||||
return None
|
||||
|
||||
def get_lines(self):
|
||||
return self.result_temp
|
||||
|
||||
def get_lines_another(self, group):
|
||||
return self.result.get(group, [])
|
||||
|
||||
report_sxw.report_sxw('report.pl.account.horizontal', 'account.account',
|
||||
'addons/account/report/account_profit_horizontal.rml',parser=report_pl_account_horizontal, header='internal landscape')
|
||||
|
||||
report_sxw.report_sxw('report.pl.account', 'account.account',
|
||||
'addons/account/report/account_profit_loss.rml',parser=report_pl_account_horizontal, header='internal')
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -1,314 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<document filename="Profit and Loss.pdf">
|
||||
<template pageSize="(595.0,842.0)" title="Profit and Loss" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="28.0" y1="28.0" width="539" height="786"/>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
<blockTableStyle id="Standard_Outline">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Heading">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Company_Name">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Date_from_To">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Account_Line_Title">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="MIDDLE"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table3">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table6">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Net_Profit_Loss">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,0" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table4">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,0" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Final_Result">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="1,0" stop="1,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table2_header">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,0" stop="-1,0"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="4,0" stop="4,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="4,0" stop="4,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="5,0" stop="5,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="5,0" stop="5,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="6,0" stop="6,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="6,0" stop="6,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="6,0" stop="6,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="6,-1" stop="6,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="7,0" stop="7,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="7,0" stop="7,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="7,0" stop="7,0"/>
|
||||
</blockTableStyle>
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="P1" rightIndent="2.0" leftIndent="0.0" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P2" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="Standard" fontName="Times-Roman"/>
|
||||
<paraStyle name="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Caption" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Index" fontName="Helvetica" fontSize="9.0" leading="11"/>
|
||||
<paraStyle name="Footer" fontName="Times-Roman"/>
|
||||
<paraStyle name="Table Contents" fontName="Times-Roman"/>
|
||||
<paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER"/>
|
||||
<paraStyle name="Horizontal Line" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
|
||||
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Right_9_Bold" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
|
||||
<paraStyle name="terp_level_1_code" fontName="Helvetica-Bold" fontSize="9.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_1_name" fontName="Helvetica-Bold" fontSize="9.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_1_balance" fontName="Helvetica-Bold" fontSize="9.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_2_code" fontName="Helvetica-Bold" fontSize="8.0" leftIndent="0.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_2_name" fontName="Helvetica-Bold" fontSize="8.0" leftIndent="10.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_2_balance" fontName="Helvetica-Bold" fontSize="8.0" leftIndent=".0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_3_code" fontName="Helvetica" fontSize="8.0" leftIndent="0.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_3_code_bold" fontName="Helvetica-Bold" fontSize="8.0" leftIndent="0.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_3_name" fontName="Helvetica" fontSize="8.0" leftIndent="20.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_3_name_bold" fontName="Helvetica-Bold" fontSize="8.0" leftIndent="20.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_3_balance" fontName="Helvetica" fontSize="8.0" leftIndent="0.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_3_balance_bold" fontName="Helvetica-Bold" fontSize="8.0" leftIndent="0.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_4_name" fontName="Helvetica" fontSize="8.0" leftIndent="30.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_4_name_bold" fontName="Helvetica-Bold" fontSize="8.0" leftIndent="30.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
|
||||
<blockTableStyle id="Table1">
|
||||
<blockTopPadding start="0,0" stop="-1,0" length="15"/>
|
||||
<blockFont name="Helvetica-Bold" size="10.0" />
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,1" thickness="1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table2">
|
||||
<blockTopPadding start="0,0" stop="-1,0" length="10"/>
|
||||
<blockAlignment value="LEFT"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#666666" start="1,1" stop="1,1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table3">
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
|
||||
|
||||
</stylesheet>
|
||||
<images/>
|
||||
<story>
|
||||
<blockTable colWidths="539.0" style="Table_Company_Name">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_header_Centre">Profit And Loss</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
<para style="P2">[[ get_data(data) or removeParentNode('para')]]</para>
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="125.0,100.0,140.0,80.0,90.0" style="Table2_header">
|
||||
<tr>
|
||||
<td><para style="terp_tblheader_General_Centre">Chart of Accounts</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Filter By [[ data['form']['filter']!='filter_no' and get_filter(data) ]]</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Display Account</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Target Moves</para></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><para style="terp_default_Centre_8">[[ get_account(data) or removeParentNode('para') ]]</para></td>
|
||||
<td><para style="terp_default_Centre_8">[[ get_fiscalyear(data) or '' ]]</para></td>
|
||||
<td><para style="terp_default_Centre_8">[[ data['form']['filter']=='filter_no' and get_filter(data) or removeParentNode('para') ]] </para>
|
||||
<blockTable colWidths="60.0,60.0" style="Table3">[[ data['form']['filter']=='filter_date' or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="terp_tblheader_General_Centre">Start Date</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">End Date</para></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><para style="terp_default_Centre_8">[[ formatLang(get_start_date(data),date=True) ]]</para></td>
|
||||
<td><para style="terp_default_Centre_8">[[ formatLang(get_end_date(data),date=True) ]]</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="65.0,60.0" style="Table3">[[ data['form']['filter']=='filter_period' or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="terp_tblheader_General_Centre">Start Period</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">End Period</para></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><para style="terp_default_Centre_8">[[ get_start_period(data) or removeParentNode('para') ]]</para></td>
|
||||
<td><para style="terp_default_Centre_8">[[ get_end_period(data) or removeParentNode('para') ]]</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
<td><para style="terp_default_Centre_8">[[ (data['form']['display_account']=='all' and 'All') or (data['form']['display_account']=='movement' and 'With movements') or 'With balance is not equal to 0']]</para></td>
|
||||
<td><para style="terp_default_Centre_8">[[ get_target_move(data) ]] </para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_header">Expenses</para>
|
||||
<blockTable colWidths="100.0,326.0,113.0" style="Table_Account_Line_Title" repeatRows="1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Code</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Account</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Balance</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="Table3">
|
||||
[[ repeatIn(get_lines_another('expense'),'a' ) ]]
|
||||
[[ setTag('tr','tr',{'style': 'Table'+str(min(3,a.level))}) ]]
|
||||
<td><para style="terp_level_3_code">[[ (a.type =='view' and a.level >= 3) and setTag('para','para',{'style': 'terp_level_3_code_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(3,a.level))+'_code'}) ]]<i>[[ a.code ]]</i></para></td>
|
||||
<td><para style="terp_level_3_name">[[ (a.type =='view' and a.level >= 3) and setTag('para','para',{'style': 'terp_level_'+str(min(3,a.level))+'_name_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(4,a.level))+'_name'}) ]][[ a.name ]]</para></td>
|
||||
<td>[[ (a.level <>2) or removeParentNode('td') ]]<para style="terp_level_3_balance">[[ (a.type =='view' and a.level >= 3) and setTag('para','para',{'style': 'terp_level_3_balance_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(3,a.level))+'_balance'}) ]][[ formatLang(a.balance * a.user_type.sign, currency_obj=company.currency_id) ]]</para></td>
|
||||
<td>[[ a.level == 2 or removeParentNode('td') ]]<para style="terp_level_2_balance"><u>[[ formatLang(a.balance * a.user_type.sign, currency_obj=company.currency_id) ]]</u></para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="100.0,326.0,113.0" style="Table_Net_Profit_Loss">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">[[ final_result()['type'] == 'Net Profit' and final_result()['type'] or removeParentNode('blockTable') ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9_Bold">[[ final_result()['balance'] and final_result()['type'] == 'Net Profit' and formatLang(final_result()['balance'], currency_obj=company.currency_id) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="426.0,113.0" style="Table_Net_Profit_Loss">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Total:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9_Bold"><u>[[ formatLang(sum_dr(), currency_obj=company.currency_id) ]]</u></para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<condPageBreak height="20cm"/>
|
||||
<para style="terp_default_Right_9_Bold">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_header">Incomes</para>
|
||||
<blockTable colWidths="100.0,326.0,113.0" style="Table_Account_Line_Title" repeatRows="1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Code</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Account</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P1">Balance</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="Table3">
|
||||
[[ repeatIn(get_lines_another('income'),'a' ) ]]
|
||||
[[ setTag('tr','tr',{'style': 'Table'+str(min(3,a.level))}) ]]
|
||||
<td><para style="terp_level_3_code">[[ (a.type =='view' and a.level >= 3) and setTag('para','para',{'style': 'terp_level_3_code_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(3,a.level))+'_code'}) ]]<i>[[ a.code ]]</i></para></td>
|
||||
<td><para style="terp_level_3_name">[[ (a.type =='view' and a.level >= 3) and setTag('para','para',{'style': 'terp_level_'+str(min(3,a.level))+'_name_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(4,a.level))+'_name'}) ]][[ a.name ]]</para></td>
|
||||
<td>[[ (a.level <>2) or removeParentNode('td') ]]<para style="terp_level_3_balance">[[ (a.type =='view' and a.level >= 3) and setTag('para','para',{'style': 'terp_level_3_balance_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(3,a.level))+'_balance'}) ]][[ formatLang(a.balance * a.user_type.sign, currency_obj=company.currency_id) ]]</para></td>
|
||||
<td>[[ a.level == 2 or removeParentNode('td') ]]<para style="terp_level_2_balance"><u>[[ formatLang(a.balance * a.user_type.sign, currency_obj=company.currency_id) ]]</u></para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="100.0,326.0,113.0" style="Table4">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">[[ final_result()['type'] == 'Net Loss' and final_result()['type'] or removeParentNode('blockTable') ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9_Bold">[[ final_result()['balance'] and final_result()['type'] == 'Net Loss' and formatLang(final_result()['balance'], currency_obj=company.currency_id) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="426.0,113.0" style="Table4">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Total:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9_Bold"><u>[[ formatLang(sum_cr(), currency_obj=company.currency_id) ]]</u></para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_default_Right_9_Bold">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</story>
|
||||
</document>
|
||||
@@ -2,14 +2,17 @@
|
||||
<openerp><data>
|
||||
|
||||
<record id="group_account_invoice" model="res.groups">
|
||||
<field name="name">Accounting / Invoicing & Payments</field>
|
||||
<field name="name">Invoicing & Payments</field>
|
||||
<field name="category_id" ref="base.module_category_accounting_and_finance"/>
|
||||
</record>
|
||||
<record id="group_account_user" model="res.groups" context="{'noadmin':True}">
|
||||
<field name="name">Accounting / Accountant</field>
|
||||
<field name="name">Accountant</field>
|
||||
<field name="category_id" ref="base.module_category_accounting_and_finance"/>
|
||||
<field name="implied_ids" eval="[(4, ref('group_account_invoice'))]"/>
|
||||
</record>
|
||||
<record id="group_account_manager" model="res.groups" context="{'noadmin':True}">
|
||||
<field name="name">Accounting / Manager</field>
|
||||
<field name="name">Manager</field>
|
||||
<field name="category_id" ref="base.module_category_accounting_and_finance"/>
|
||||
<field name="implied_ids" eval="[(4, ref('group_account_user'))]"/>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -37,24 +37,15 @@
|
||||
data_dict = {'chart_account_id':ref('account.chart0')}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_aged_balance_view',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
-
|
||||
Print the Account Balance Sheet in Horizontal mode
|
||||
-
|
||||
!python {model: account.account}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
|
||||
data_dict = {'chart_account_id':ref('account.chart0'),'display_type': True}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_bs_report',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
-
|
||||
Print the Account Balance Sheet in Normal mode
|
||||
-
|
||||
!python {model: account.account}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
|
||||
data_dict = {'chart_account_id':ref('account.chart0'),'display_type': False}
|
||||
data_dict = {'chart_account_id':ref('account.chart0'),'display_type': False, 'account_report_id': ref('account_financial_report_balancesheet0')}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_bs_report',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
test_reports.try_report_action(cr, uid, 'action_account_report',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
-
|
||||
Print the Account Balance Report in Normal mode through the wizard - From Account Chart
|
||||
-
|
||||
@@ -147,18 +138,9 @@
|
||||
!python {model: account.account}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
|
||||
data_dict = {'chart_account_id':ref('account.chart0'),'display_type': False,'target_move': 'all'}
|
||||
data_dict = {'chart_account_id':ref('account.chart0'),'display_type': False,'target_move': 'all', 'account_report_id': ref('account_financial_report_balancesheet0')}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_pl_report',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
-
|
||||
Print the Profit-Loss Report in Horizontal Mode
|
||||
-
|
||||
!python {model: account.account}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
|
||||
data_dict = {'chart_account_id':ref('account.chart0'),'display_type': True,'target_move': 'all'}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_pl_report',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
test_reports.try_report_action(cr, uid, 'action_account_report',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
-
|
||||
Print the Analytic Balance Report through the wizard
|
||||
-
|
||||
|
||||
@@ -64,8 +64,6 @@ import account_report_account_balance
|
||||
|
||||
import account_change_currency
|
||||
|
||||
import account_report_balance_sheet
|
||||
import account_report_profit_loss
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
|
||||
@@ -38,9 +38,19 @@ class accounting_report(osv.osv_memory):
|
||||
'date_to_cmp': fields.date("End Date"),
|
||||
}
|
||||
|
||||
def _get_account_report(self, cr, uid, context=None):
|
||||
menu_obj = self.pool.get('ir.ui.menu')
|
||||
report_obj = self.pool.get('account.financial.report')
|
||||
report_ids = []
|
||||
if context.get('active_id'):
|
||||
menu = menu_obj.browse(cr, uid, context.get('active_id')).name
|
||||
report_ids = report_obj.search(cr, uid, [('name','ilike',menu)])
|
||||
return report_ids and report_ids[0] or False
|
||||
|
||||
_defaults = {
|
||||
'filter_cmp': 'filter_no',
|
||||
'target_move': 'posted',
|
||||
'account_report_id': _get_account_report,
|
||||
}
|
||||
|
||||
def _build_comparison_context(self, cr, uid, ids, data, context=None):
|
||||
|
||||
@@ -40,6 +40,24 @@
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
parent="account.menu_finance_legal_statement"
|
||||
id="final_accounting_reports"
|
||||
name="Accounting Reports"/>
|
||||
|
||||
<menuitem icon="STOCK_PRINT"
|
||||
name="Profit And Loss"
|
||||
action="account.action_account_report"
|
||||
id="menu_account_pl_report"
|
||||
parent="final_accounting_reports"/>
|
||||
|
||||
<menuitem icon="STOCK_PRINT"
|
||||
name="Balance Sheet"
|
||||
action="account.action_account_report"
|
||||
groups="group_account_user,group_account_manager"
|
||||
id="menu_account_bs_report"
|
||||
parent="final_accounting_reports"/>
|
||||
|
||||
<menuitem icon="STOCK_PRINT"
|
||||
name="Financial Report"
|
||||
action="action_account_report"
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import osv, fields
|
||||
from tools.translate import _
|
||||
|
||||
class account_bs_report(osv.osv_memory):
|
||||
"""
|
||||
This wizard will provide the account balance sheet report by periods, between any two dates.
|
||||
"""
|
||||
_name = 'account.bs.report'
|
||||
_inherit = "account.common.account.report"
|
||||
_description = 'Account Balance Sheet Report'
|
||||
|
||||
def _get_def_reserve_account(self, cr, uid, context=None):
|
||||
chart_id = self._get_account(cr, uid, context=context)
|
||||
res = self.onchange_chart_id(cr, uid, [], chart_id, context=context)
|
||||
if not res:
|
||||
return False
|
||||
return res['value']['reserve_account_id']
|
||||
|
||||
_columns = {
|
||||
'display_type': fields.boolean("Landscape Mode"),
|
||||
'reserve_account_id': fields.many2one('account.account', 'Reserve & Profit/Loss Account',
|
||||
help='This account is used for transferring Profit/Loss (If It is Profit: Amount will be added, Loss : Amount will be deducted.), as calculated in Profit & Loss Report',
|
||||
domain = [('type','=','other')]),
|
||||
'journal_ids': fields.many2many('account.journal', 'account_bs_report_journal_rel', 'account_id', 'journal_id', 'Journals', required=True),
|
||||
}
|
||||
|
||||
_defaults={
|
||||
'display_type': False,
|
||||
'journal_ids': [],
|
||||
'reserve_account_id': _get_def_reserve_account,
|
||||
}
|
||||
|
||||
def onchange_chart_id(self, cr, uid, ids, chart_id, context=None):
|
||||
if not chart_id:
|
||||
return {}
|
||||
account = self.pool.get('account.account').browse(cr, uid, chart_id , context=context)
|
||||
if not account.company_id.property_reserve_and_surplus_account:
|
||||
return {'value': {'reserve_account_id': False}}
|
||||
return {'value': {'reserve_account_id': account.company_id.property_reserve_and_surplus_account.id}}
|
||||
|
||||
|
||||
def _print_report(self, cr, uid, ids, data, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
data['form'].update(self.read(cr, uid, ids, ['display_type','reserve_account_id'])[0])
|
||||
if not data['form']['reserve_account_id']:
|
||||
raise osv.except_osv(_('Warning'),_('Please define the Reserve and Profit/Loss account for current user company !'))
|
||||
data = self.pre_print_report(cr, uid, ids, data, context=context)
|
||||
if data['form']['display_type']:
|
||||
return {
|
||||
'type': 'ir.actions.report.xml',
|
||||
'report_name': 'account.balancesheet.horizontal',
|
||||
'datas': data,
|
||||
}
|
||||
else:
|
||||
return {
|
||||
'type': 'ir.actions.report.xml',
|
||||
'report_name': 'account.balancesheet',
|
||||
'datas': data,
|
||||
}
|
||||
|
||||
account_bs_report()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -1,50 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="account_bs_report_view" model="ir.ui.view">
|
||||
<field name="name">Account Balance Sheet</field>
|
||||
<field name="model">account.bs.report</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="account.account_common_report_view" />
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//field[@name='chart_account_id']" position="replace">
|
||||
<field name="chart_account_id" widget="selection" on_change="onchange_chart_id(chart_account_id)"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='journal_ids']" position="replace">
|
||||
<field name="journal_ids" colspan="4" nolabel="1" required="0" readonly="1"/>
|
||||
</xpath>
|
||||
<xpath expr="/form/label[@string='']" position="replace">
|
||||
<separator string="Balance Sheet" colspan="4"/>
|
||||
<label nolabel="1" colspan="4" string="This report allows you to print or generate a pdf of your trial balance allowing you to quickly check the balance of each of your accounts in a single report"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='target_move']" position="after">
|
||||
<field name="display_account"/>
|
||||
<field name="reserve_account_id"/>
|
||||
<field name="display_type"/>
|
||||
<newline/>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_bs_report" model="ir.actions.act_window">
|
||||
<field name="name">Balance Sheet</field>
|
||||
<field name="res_model">account.bs.report</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="account_bs_report_view"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<menuitem icon="STOCK_PRINT"
|
||||
name="Balance Sheet"
|
||||
action="action_account_bs_report"
|
||||
groups="group_account_user,group_account_manager"
|
||||
id="menu_account_bs_report"
|
||||
parent="final_accounting_reports"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -1,62 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import osv, fields
|
||||
|
||||
class account_pl_report(osv.osv_memory):
|
||||
"""
|
||||
This wizard will provide the account profit and loss report by periods, between any two dates.
|
||||
"""
|
||||
_inherit = "account.common.account.report"
|
||||
_name = "account.pl.report"
|
||||
_description = "Account Profit And Loss Report"
|
||||
|
||||
_columns = {
|
||||
'display_type': fields.boolean("Landscape Mode"),
|
||||
'journal_ids': fields.many2many('account.journal', 'account_pl_report_journal_rel', 'account_id', 'journal_id', 'Journals', required=True),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'display_type': False,
|
||||
'journal_ids': [],
|
||||
}
|
||||
|
||||
def _print_report(self, cr, uid, ids, data, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
data = self.pre_print_report(cr, uid, ids, data, context=context)
|
||||
data['form'].update(self.read(cr, uid, ids, ['display_type'])[0])
|
||||
if data['form']['display_type']:
|
||||
return {
|
||||
'type': 'ir.actions.report.xml',
|
||||
'report_name': 'pl.account.horizontal',
|
||||
'datas': data,
|
||||
}
|
||||
else:
|
||||
return {
|
||||
'type': 'ir.actions.report.xml',
|
||||
'report_name': 'pl.account',
|
||||
'datas': data,
|
||||
}
|
||||
|
||||
account_pl_report()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -1,49 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="account_pl_report_view" model="ir.ui.view">
|
||||
<field name="name">Profit and Loss</field>
|
||||
<field name="model">account.pl.report</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="account.account_common_report_view" />
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//field[@name='journal_ids']" position="replace">
|
||||
<field name="journal_ids" required="0" colspan="4" nolabel="1" readonly="1"/>
|
||||
</xpath>
|
||||
<xpath expr="/form/label[@string='']" position="replace">
|
||||
<separator string="Profit And Loss" colspan="4"/>
|
||||
<label nolabel="1" colspan="4" string="The Profit and Loss report gives you an overview of your company profit and loss in a single document"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='fiscalyear_id']" position="after">
|
||||
<field name="display_account"/>
|
||||
<field name="display_type"/>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_pl_report" model="ir.actions.act_window">
|
||||
<field name="name">Account Profit And Loss</field>
|
||||
<field name="res_model">account.pl.report</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="account_pl_report_view"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
parent="account.menu_finance_legal_statement"
|
||||
id="final_accounting_reports"
|
||||
name="Accounting Reports"/>
|
||||
|
||||
<menuitem icon="STOCK_PRINT"
|
||||
name="Profit And Loss"
|
||||
action="action_account_pl_report"
|
||||
id="menu_account_pl_report"
|
||||
parent="final_accounting_reports"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 20 KiB |
@@ -68,7 +68,7 @@ class account_followup_stat(osv.osv):
|
||||
cr.execute("""
|
||||
create or replace view account_followup_stat as (
|
||||
SELECT
|
||||
l.id as id,
|
||||
l.partner_id AS id,
|
||||
l.partner_id AS partner_id,
|
||||
min(l.date) AS date_move,
|
||||
max(l.date) AS date_move_last,
|
||||
|
||||
@@ -93,7 +93,7 @@ class account_followup_stat_by_partner(osv.osv):
|
||||
cr.execute("""
|
||||
create or replace view account_followup_stat_by_partner as (
|
||||
SELECT
|
||||
l.partner_id * 10000 + l.company_id as id,
|
||||
l.partner_id AS id,
|
||||
l.partner_id AS partner_id,
|
||||
min(l.date) AS date_move,
|
||||
max(l.date) AS date_move_last,
|
||||
|
||||
@@ -8,19 +8,19 @@ msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2011-01-11 11:14+0000\n"
|
||||
"PO-Revision-Date: 2010-12-23 15:17+0000\n"
|
||||
"Last-Translator: Olivier Dony (OpenERP) <Unknown>\n"
|
||||
"PO-Revision-Date: 2011-12-13 15:21+0000\n"
|
||||
"Last-Translator: Milan Milosevic <Unknown>\n"
|
||||
"Language-Team: Serbian latin <sr@latin@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2011-11-05 05:22+0000\n"
|
||||
"X-Generator: Launchpad (build 14231)\n"
|
||||
"X-Launchpad-Export-Date: 2011-12-14 04:45+0000\n"
|
||||
"X-Generator: Launchpad (build 14487)\n"
|
||||
|
||||
#. module: account_payment
|
||||
#: field:payment.order,date_scheduled:0
|
||||
msgid "Scheduled date if fixed"
|
||||
msgstr "Zakazani datum ako je fiskno"
|
||||
msgstr "Zakazani datum ako je fiksiran"
|
||||
|
||||
#. module: account_payment
|
||||
#: field:payment.line,currency:0
|
||||
@@ -30,7 +30,7 @@ msgstr "Valuta partnera"
|
||||
#. module: account_payment
|
||||
#: view:payment.order:0
|
||||
msgid "Set to draft"
|
||||
msgstr "Postavi za obradu"
|
||||
msgstr "Postavi kao pripremu"
|
||||
|
||||
#. module: account_payment
|
||||
#: help:payment.order,mode:0
|
||||
@@ -41,7 +41,7 @@ msgstr "Odaberite način plaćanja koji će biti primenjen."
|
||||
#: view:payment.mode:0
|
||||
#: view:payment.order:0
|
||||
msgid "Group By..."
|
||||
msgstr "Grupirano po"
|
||||
msgstr "Grupiši po..."
|
||||
|
||||
#. module: account_payment
|
||||
#: model:ir.module.module,description:account_payment.module_meta_information
|
||||
@@ -52,6 +52,11 @@ msgid ""
|
||||
"* a basic mechanism to easily plug various automated payment.\n"
|
||||
" "
|
||||
msgstr ""
|
||||
"\n"
|
||||
"Ovaj modul omogućava:\n"
|
||||
"*efikasniji način za upravljanje isplaćivanja faktura\n"
|
||||
"*osnovni mehanizam za lako obrađivanje automatizovanih načina isplate\n"
|
||||
" "
|
||||
|
||||
#. module: account_payment
|
||||
#: field:payment.order,line_ids:0
|
||||
@@ -98,7 +103,7 @@ msgstr "Zeljeni Datum"
|
||||
#. module: account_payment
|
||||
#: selection:payment.line,state:0
|
||||
msgid "Free"
|
||||
msgstr "slobodno"
|
||||
msgstr "Slobodno"
|
||||
|
||||
#. module: account_payment
|
||||
#: field:payment.order.create,entries:0
|
||||
@@ -108,18 +113,18 @@ msgstr "Stavke"
|
||||
#. module: account_payment
|
||||
#: report:payment.order:0
|
||||
msgid "Used Account"
|
||||
msgstr "Koristeni Nalog"
|
||||
msgstr "Korišteni nalog"
|
||||
|
||||
#. module: account_payment
|
||||
#: field:payment.line,ml_maturity_date:0
|
||||
#: field:payment.order.create,duedate:0
|
||||
msgid "Due Date"
|
||||
msgstr "Datum dospeća"
|
||||
msgstr "Krajnji rok"
|
||||
|
||||
#. module: account_payment
|
||||
#: constraint:account.move.line:0
|
||||
msgid "You can not create move line on closed account."
|
||||
msgstr ""
|
||||
msgstr "Ne možete da napravite poteznu liniju na zatvorenim računima."
|
||||
|
||||
#. module: account_payment
|
||||
#: view:account.move.line:0
|
||||
@@ -135,7 +140,7 @@ msgstr "_Dodaj u nalog za plaćanje"
|
||||
#: model:ir.actions.act_window,name:account_payment.action_account_payment_populate_statement
|
||||
#: model:ir.actions.act_window,name:account_payment.action_account_populate_statement_confirm
|
||||
msgid "Payment Populate statement"
|
||||
msgstr "Ispuna sadrzaja fakture"
|
||||
msgstr "Ispunjavanje sadržaja fakture"
|
||||
|
||||
#. module: account_payment
|
||||
#: report:payment.order:0
|
||||
@@ -146,12 +151,12 @@ msgstr "Iznos"
|
||||
#. module: account_payment
|
||||
#: sql_constraint:account.move.line:0
|
||||
msgid "Wrong credit or debit value in accounting entry !"
|
||||
msgstr ""
|
||||
msgstr "Pogrešna vrednost kredita ili debita u ulazu računa !"
|
||||
|
||||
#. module: account_payment
|
||||
#: view:payment.order:0
|
||||
msgid "Total in Company Currency"
|
||||
msgstr "Ukupno u valuti preduzeca"
|
||||
msgstr "Ukupno u valuti preduzeća"
|
||||
|
||||
#. module: account_payment
|
||||
#: selection:payment.order,state:0
|
||||
@@ -172,7 +177,7 @@ msgstr "Referenca"
|
||||
#. module: account_payment
|
||||
#: sql_constraint:payment.line:0
|
||||
msgid "The payment line name must be unique!"
|
||||
msgstr ""
|
||||
msgstr "Red plaćanja mora biti jedinstven!"
|
||||
|
||||
#. module: account_payment
|
||||
#: model:ir.actions.act_window,name:account_payment.action_payment_order_tree
|
||||
@@ -212,7 +217,7 @@ msgstr "Efektivni datum fakture"
|
||||
#. module: account_payment
|
||||
#: report:payment.order:0
|
||||
msgid "Execution Type"
|
||||
msgstr "Tip Izuzetka"
|
||||
msgstr "Tip Izvršavanja"
|
||||
|
||||
#. module: account_payment
|
||||
#: selection:payment.line,state:0
|
||||
@@ -229,7 +234,7 @@ msgstr "Stanje"
|
||||
#: view:payment.line:0
|
||||
#: view:payment.order:0
|
||||
msgid "Transaction Information"
|
||||
msgstr "Informacije Transakcije"
|
||||
msgstr "Informacije o transakciji"
|
||||
|
||||
#. module: account_payment
|
||||
#: model:ir.actions.act_window,name:account_payment.action_payment_mode_form
|
||||
@@ -257,8 +262,8 @@ msgid ""
|
||||
"by you.'Directly' stands for the direct execution.'Due date' stands for the "
|
||||
"scheduled date of execution."
|
||||
msgstr ""
|
||||
"Odaberite opciju za nalog za plaćanje: \"Fiksno\" znači datum naveden od "
|
||||
"vaše strane. \"Direktno\" znači direktno izvršenje. \"Datum odgode\" znači "
|
||||
"Odaberite opciju za nalog za plaćanje: \"Fiksirano\" znači datum naveden s "
|
||||
"Vaše strane. \"Direktno\" znači direktno izvršenje. \"Datum odgode\" znači "
|
||||
"zakazan datum izvršenja."
|
||||
|
||||
#. module: account_payment
|
||||
@@ -280,12 +285,12 @@ msgstr "Datum izvršenja"
|
||||
#. module: account_payment
|
||||
#: help:payment.mode,journal:0
|
||||
msgid "Bank or Cash Journal for the Payment Mode"
|
||||
msgstr ""
|
||||
msgstr "Dnevnik banke ili keša za način plaćanja"
|
||||
|
||||
#. module: account_payment
|
||||
#: selection:payment.order,date_prefered:0
|
||||
msgid "Fixed date"
|
||||
msgstr "Fiksni datum"
|
||||
msgstr "Fiksirani datum"
|
||||
|
||||
#. module: account_payment
|
||||
#: field:payment.line,info_partner:0
|
||||
@@ -301,18 +306,19 @@ msgstr "Ciljni račun"
|
||||
#. module: account_payment
|
||||
#: view:payment.order:0
|
||||
msgid "Search Payment Orders"
|
||||
msgstr "Pretrazi naloge za placanje"
|
||||
msgstr "Pretraži naloge za plaćanje"
|
||||
|
||||
#. module: account_payment
|
||||
#: constraint:account.move.line:0
|
||||
msgid ""
|
||||
"You can not create move line on receivable/payable account without partner"
|
||||
msgstr ""
|
||||
"Ne možete napraviti poteznu liniju na primaćem/platežnom računu bez partnera"
|
||||
|
||||
#. module: account_payment
|
||||
#: field:payment.line,create_date:0
|
||||
msgid "Created"
|
||||
msgstr "Kreirano"
|
||||
msgstr "Napravljeno"
|
||||
|
||||
#. module: account_payment
|
||||
#: view:payment.order:0
|
||||
@@ -327,17 +333,17 @@ msgstr "Ukupni iznos valute"
|
||||
#. module: account_payment
|
||||
#: view:payment.order:0
|
||||
msgid "Make Payments"
|
||||
msgstr "Napravite plaćanja"
|
||||
msgstr "Izvršite plaćanja"
|
||||
|
||||
#. module: account_payment
|
||||
#: field:payment.line,state:0
|
||||
msgid "Communication Type"
|
||||
msgstr "Tip Komunikacije"
|
||||
msgstr "Tip komunikacije"
|
||||
|
||||
#. module: account_payment
|
||||
#: model:ir.module.module,shortdesc:account_payment.module_meta_information
|
||||
msgid "Payment Management"
|
||||
msgstr "Menadzment Plaćanja"
|
||||
msgstr "Upravljanje plaćanjem"
|
||||
|
||||
#. module: account_payment
|
||||
#: field:payment.line,bank_statement_line_id:0
|
||||
@@ -347,7 +353,7 @@ msgstr "Red Izvoda iz Banke"
|
||||
#. module: account_payment
|
||||
#: selection:payment.order,date_prefered:0
|
||||
msgid "Due date"
|
||||
msgstr "Krajnji Rok"
|
||||
msgstr "Krajnji rok"
|
||||
|
||||
#. module: account_payment
|
||||
#: field:account.invoice,amount_to_pay:0
|
||||
@@ -391,7 +397,7 @@ msgstr "Način plaćanja"
|
||||
#. module: account_payment
|
||||
#: report:payment.order:0
|
||||
msgid "Value Date"
|
||||
msgstr "Datum"
|
||||
msgstr "Datum valute"
|
||||
|
||||
#. module: account_payment
|
||||
#: report:payment.order:0
|
||||
@@ -412,23 +418,23 @@ msgstr "Priprema"
|
||||
#. module: account_payment
|
||||
#: help:payment.line,communication2:0
|
||||
msgid "The successor message of Communication."
|
||||
msgstr "Nasljedna poruka komunikacije."
|
||||
msgstr "Naredna poruka komunikacije."
|
||||
|
||||
#. module: account_payment
|
||||
#: code:addons/account_payment/account_move_line.py:110
|
||||
#, python-format
|
||||
msgid "No partner defined on entry line"
|
||||
msgstr "Partner nije definisan"
|
||||
msgstr "Partner nije definisan na redu stavke"
|
||||
|
||||
#. module: account_payment
|
||||
#: help:payment.line,info_partner:0
|
||||
msgid "Address of the Ordering Customer."
|
||||
msgstr "Adresa kupca naručitelja."
|
||||
msgstr "Adresa naručitelja."
|
||||
|
||||
#. module: account_payment
|
||||
#: view:account.payment.populate.statement:0
|
||||
msgid "Populate Statement:"
|
||||
msgstr "Popuni sadrzaj:"
|
||||
msgstr "Popuni sadržaj:"
|
||||
|
||||
#. module: account_payment
|
||||
#: view:account.move.line:0
|
||||
@@ -438,7 +444,7 @@ msgstr "Ukupno potražuje"
|
||||
#. module: account_payment
|
||||
#: help:payment.order,date_scheduled:0
|
||||
msgid "Select a date if you have chosen Preferred Date to be fixed."
|
||||
msgstr "Odaberite datum ako ste odabrali fiksni željeni datum"
|
||||
msgstr "Odaberite datum ako ste odabrali fiksirani željeni datum"
|
||||
|
||||
#. module: account_payment
|
||||
#: field:payment.order,user_id:0
|
||||
@@ -454,12 +460,12 @@ msgstr "Redovi plaćanja"
|
||||
#. module: account_payment
|
||||
#: model:ir.model,name:account_payment.model_account_move_line
|
||||
msgid "Journal Items"
|
||||
msgstr "Sadrzaj Dnevnika"
|
||||
msgstr "Stavke dnevnika"
|
||||
|
||||
#. module: account_payment
|
||||
#: constraint:account.move.line:0
|
||||
msgid "Company must be same for its related account and period."
|
||||
msgstr ""
|
||||
msgstr "Preduzeće mora biti isto za sve vezane račune i periode."
|
||||
|
||||
#. module: account_payment
|
||||
#: help:payment.line,move_line_id:0
|
||||
@@ -492,12 +498,12 @@ msgstr "Ukupno:"
|
||||
#. module: account_payment
|
||||
#: field:payment.order,date_created:0
|
||||
msgid "Creation date"
|
||||
msgstr "Datum kreiranja"
|
||||
msgstr "Datum pravljenja"
|
||||
|
||||
#. module: account_payment
|
||||
#: view:account.payment.populate.statement:0
|
||||
msgid "ADD"
|
||||
msgstr "Dodaj"
|
||||
msgstr "DODAJ"
|
||||
|
||||
#. module: account_payment
|
||||
#: view:account.bank.statement:0
|
||||
@@ -517,22 +523,22 @@ msgstr "Iznos u valuti preduzeca"
|
||||
#. module: account_payment
|
||||
#: help:payment.line,partner_id:0
|
||||
msgid "The Ordering Customer"
|
||||
msgstr "Kupac naručitelj"
|
||||
msgstr "Naručitelj"
|
||||
|
||||
#. module: account_payment
|
||||
#: model:ir.model,name:account_payment.model_account_payment_make_payment
|
||||
msgid "Account make payment"
|
||||
msgstr "Izvrsi placanje naloga"
|
||||
msgstr "Izvrši plaćanje naloga"
|
||||
|
||||
#. module: account_payment
|
||||
#: report:payment.order:0
|
||||
msgid "Invoice Ref"
|
||||
msgstr "Referenca fakture"
|
||||
msgstr "Ref. fakture"
|
||||
|
||||
#. module: account_payment
|
||||
#: field:payment.line,name:0
|
||||
msgid "Your Reference"
|
||||
msgstr "Vaše veze"
|
||||
msgstr "Vaš poziv na broj"
|
||||
|
||||
#. module: account_payment
|
||||
#: field:payment.order,mode:0
|
||||
@@ -578,7 +584,7 @@ msgstr "Otkaži"
|
||||
#: view:payment.line:0
|
||||
#: view:payment.order:0
|
||||
msgid "Information"
|
||||
msgstr "Informacija"
|
||||
msgstr "Informacije"
|
||||
|
||||
#. module: account_payment
|
||||
#: model:ir.actions.act_window,help:account_payment.action_payment_order_tree
|
||||
@@ -588,6 +594,10 @@ msgid ""
|
||||
"that should be done, keep track of all payment orders and mention the "
|
||||
"invoice reference and the partner the payment should be done for."
|
||||
msgstr ""
|
||||
"Nalog za plaćanje je zahtev za plaćanje od strane Vašeg preduzeća za isplatu "
|
||||
"faktura nabavke ili kupaca. Ovde možete snimiti sve naloge za plaćanje na "
|
||||
"čekanju, pratite sve naloge za plaćanje i pomenete poziv na broj za datu "
|
||||
"fakturu i kom partneru treba izvršiti isplatu."
|
||||
|
||||
#. module: account_payment
|
||||
#: help:payment.line,amount:0
|
||||
@@ -612,12 +622,12 @@ msgstr "Komunikacija 2"
|
||||
#. module: account_payment
|
||||
#: field:payment.line,bank_id:0
|
||||
msgid "Destination Bank account"
|
||||
msgstr "Destinacioni bankovni račun"
|
||||
msgstr "Ciljni bankovni račun"
|
||||
|
||||
#. module: account_payment
|
||||
#: view:account.payment.make.payment:0
|
||||
msgid "Are you sure you want to make payment?"
|
||||
msgstr "Jeste li sigurni da zelite da izvrsite isplatu?"
|
||||
msgstr "Jeste li sigurni da želite da izvršite isplatu?"
|
||||
|
||||
#. module: account_payment
|
||||
#: view:payment.mode:0
|
||||
@@ -639,7 +649,7 @@ msgstr "Potvrdi plaćanja"
|
||||
#: field:payment.line,company_currency:0
|
||||
#: report:payment.order:0
|
||||
msgid "Company Currency"
|
||||
msgstr "Valuta preduzeca"
|
||||
msgstr "Valuta preduzeća"
|
||||
|
||||
#. module: account_payment
|
||||
#: model:ir.ui.menu,name:account_payment.menu_main_payment
|
||||
@@ -651,7 +661,7 @@ msgstr "Isplata"
|
||||
#. module: account_payment
|
||||
#: report:payment.order:0
|
||||
msgid "Payment Order / Payment"
|
||||
msgstr "Isplata Faktura / Placanje"
|
||||
msgstr "Isplata Faktura / Plaćanje"
|
||||
|
||||
#. module: account_payment
|
||||
#: field:payment.line,move_line_id:0
|
||||
@@ -664,13 +674,13 @@ msgid ""
|
||||
"Used as the message between ordering customer and current company. Depicts "
|
||||
"'What do you want to say to the recipient about this order ?'"
|
||||
msgstr ""
|
||||
"Koristi se kao poruka izmedju narucioca i date kompanije. Objasnjava ' Sta "
|
||||
"ste to hteli reci kupcu o ovoj narudzbi?'"
|
||||
"Koristi se kao poruka između naručioca i date kompanije. Prikazuje ' Šta "
|
||||
"želite reći kupcu o ovoj narudžbini?'"
|
||||
|
||||
#. module: account_payment
|
||||
#: field:payment.mode,name:0
|
||||
msgid "Name"
|
||||
msgstr "Ime"
|
||||
msgstr "Naziv"
|
||||
|
||||
#. module: account_payment
|
||||
#: report:payment.order:0
|
||||
@@ -681,7 +691,7 @@ msgstr "Bankovni račun"
|
||||
#: view:payment.line:0
|
||||
#: view:payment.order:0
|
||||
msgid "Entry Information"
|
||||
msgstr "Unos Informacije"
|
||||
msgstr "Informacije o unosu"
|
||||
|
||||
#. module: account_payment
|
||||
#: model:ir.model,name:account_payment.model_payment_order_create
|
||||
@@ -702,7 +712,7 @@ msgstr "Ukupno"
|
||||
#: view:account.payment.make.payment:0
|
||||
#: model:ir.actions.act_window,name:account_payment.action_account_payment_make_payment
|
||||
msgid "Make Payment"
|
||||
msgstr "Izvrsi placanje"
|
||||
msgstr "Izvrši placanje"
|
||||
|
||||
#. module: account_payment
|
||||
#: field:payment.line,partner_id:0
|
||||
@@ -713,7 +723,7 @@ msgstr "Partner"
|
||||
#. module: account_payment
|
||||
#: model:ir.actions.act_window,name:account_payment.action_create_payment_order
|
||||
msgid "Populate Payment"
|
||||
msgstr "Popuni Placanje"
|
||||
msgstr "Popuni plaćanje"
|
||||
|
||||
#. module: account_payment
|
||||
#: help:payment.mode,bank_id:0
|
||||
@@ -723,7 +733,7 @@ msgstr "Bankovni račun za način plaćanja"
|
||||
#. module: account_payment
|
||||
#: constraint:account.move.line:0
|
||||
msgid "You can not create move line on view account."
|
||||
msgstr ""
|
||||
msgstr "Ne možete napraviti poteznu liniju na računu po viđenju"
|
||||
|
||||
#~ msgid "Invalid model name in the action definition."
|
||||
#~ msgstr "Pogrešno ime modela u definiciji akcije."
|
||||
|
||||
@@ -91,10 +91,10 @@ class account_voucher(osv.osv):
|
||||
return False
|
||||
|
||||
def _get_payment_rate_currency(self, cr, uid, context=None):
|
||||
'''
|
||||
"""
|
||||
Return the default value for field payment_rate_currency_id: the currency of the journal
|
||||
if there is one, otherwise the currency of the user's company
|
||||
'''
|
||||
"""
|
||||
if context is None: context = {}
|
||||
journal_pool = self.pool.get('account.journal')
|
||||
journal_id = context.get('journal_id', False)
|
||||
@@ -141,20 +141,22 @@ class account_voucher(osv.osv):
|
||||
def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False):
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
if context is None: context = {}
|
||||
if not view_id and context.get('invoice_type', False):
|
||||
if context.get('invoice_type', False) in ('out_invoice', 'out_refund'):
|
||||
result = mod_obj.get_object_reference(cr, uid, 'account_voucher', 'view_vendor_receipt_form')
|
||||
else:
|
||||
result = mod_obj.get_object_reference(cr, uid, 'account_voucher', 'view_vendor_payment_form')
|
||||
result = result and result[1] or False
|
||||
view_id = result
|
||||
if not view_id and view_type == 'form' and context.get('line_type', False):
|
||||
if context.get('line_type', False) == 'customer':
|
||||
result = mod_obj.get_object_reference(cr, uid, 'account_voucher', 'view_vendor_receipt_form')
|
||||
else:
|
||||
result = mod_obj.get_object_reference(cr, uid, 'account_voucher', 'view_vendor_payment_form')
|
||||
result = result and result[1] or False
|
||||
view_id = result
|
||||
|
||||
if view_type == 'form':
|
||||
if not view_id and context.get('invoice_type'):
|
||||
if context.get('invoice_type') in ('out_invoice', 'out_refund'):
|
||||
result = mod_obj.get_object_reference(cr, uid, 'account_voucher', 'view_vendor_receipt_form')
|
||||
else:
|
||||
result = mod_obj.get_object_reference(cr, uid, 'account_voucher', 'view_vendor_payment_form')
|
||||
result = result and result[1] or False
|
||||
view_id = result
|
||||
if not view_id and context.get('line_type'):
|
||||
if context.get('line_type') == 'customer':
|
||||
result = mod_obj.get_object_reference(cr, uid, 'account_voucher', 'view_vendor_receipt_form')
|
||||
else:
|
||||
result = mod_obj.get_object_reference(cr, uid, 'account_voucher', 'view_vendor_payment_form')
|
||||
result = result and result[1] or False
|
||||
view_id = result
|
||||
|
||||
res = super(account_voucher, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
|
||||
doc = etree.XML(res['arch'])
|
||||
|
||||
|
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 3.3 KiB |
@@ -51,7 +51,7 @@
|
||||
name: "cash account in usd"
|
||||
code: "Xcash usd"
|
||||
type: 'liquidity'
|
||||
user_type: "account.account_type_cash_moves"
|
||||
user_type: "account.data_account_type_cash"
|
||||
|
||||
-
|
||||
I create a bank journal with USD as currency
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
name: "cash account in chf"
|
||||
code: "Xcash chf"
|
||||
type: 'liquidity'
|
||||
user_type: "account.account_type_cash_moves"
|
||||
user_type: "account.data_account_type_cash"
|
||||
|
||||
-
|
||||
I create a bank journal with CHF as currency
|
||||
|
||||
@@ -205,6 +205,7 @@
|
||||
<group col="2" colspan="1">
|
||||
<group col="4" colspan="1" attrs="{'invisible':[('currency_id','=',False),('is_multi_currency','=',False)]}">
|
||||
<separator string="Currency Options" colspan="4"/>
|
||||
<field name="is_multi_currency" invisible="1"/>
|
||||
<field name="payment_rate" required="1" on_change="onchange_rate(payment_rate, amount, currency_id, payment_rate_currency_id, company_id, context)" groups='base.group_extended' colspan="3"/>
|
||||
<field name="payment_rate_currency_id" groups='base.group_extended' colspan="1" nolabel="1" on_change="onchange_payment_rate_currency(currency_id, payment_rate, payment_rate_currency_id, date, amount, company_id, context)"/>
|
||||
<field name="paid_amount_in_company_currency" groups='base.group_extended' colspan="4" invisible="1"/>
|
||||
@@ -356,6 +357,7 @@
|
||||
<group col="2" colspan="1">
|
||||
<group col="4" colspan="1" attrs="{'invisible':[('currency_id','=',False),('is_multi_currency','=',False)]}">
|
||||
<separator string="Currency Options" colspan="4"/>
|
||||
<field name="is_multi_currency" invisible="1"/>
|
||||
<field name="payment_rate" required="1" on_change="onchange_rate(payment_rate, amount, currency_id, payment_rate_currency_id, company_id, context)" groups='base.group_extended' colspan="3"/>
|
||||
<field name="payment_rate_currency_id" groups='base.group_extended' colspan="1" nolabel="1" on_change="onchange_payment_rate_currency(currency_id, payment_rate, payment_rate_currency_id, date, amount, company_id, context)"/>
|
||||
<field name="paid_amount_in_company_currency" groups='base.group_extended' colspan="4" invisible="1"/>
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
</record>
|
||||
|
||||
<record id="group_analytic_accounting" model="res.groups" context="{'noadmin':True}">
|
||||
<field name="name">Useability / Analytic Accounting</field>
|
||||
<field name="name">Analytic Accounting</field>
|
||||
<field name="category_id" ref="base.module_category_usability"/>
|
||||
</record>
|
||||
</data></openerp>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<field name="parent_id" eval="0">
|
||||
<value search="[('type','=','view')]" model="account.account"/>
|
||||
</field>
|
||||
<field name="user_type" ref="account.account_type_root"/>
|
||||
<field name="user_type" ref="account.data_account_type_view"/>
|
||||
</record>
|
||||
|
||||
<record model="account.account" id="auction_expense_view">
|
||||
@@ -32,13 +32,13 @@
|
||||
<field name="parent_id" eval="0">
|
||||
<value search="[('type','=','view')]" model="account.account"/>
|
||||
</field>
|
||||
<field name="user_type" ref="account.account_type_expense"/>
|
||||
<field name="user_type" ref="account.data_account_type_expense"/>
|
||||
</record>
|
||||
|
||||
<record model="account.account" id="auction_income">
|
||||
<field name="name">Auction Adjudications</field>
|
||||
<field name="code">A7x*</field>
|
||||
<field name="user_type" ref="account.account_type_income"/>
|
||||
<field name="user_type" ref="account.data_account_type_income"/>
|
||||
<field name="type">other</field>
|
||||
<field name="currency_id" search="[('name','=','EUR')]"/>
|
||||
<field name="parent_id" eval="auction_income_view"/>
|
||||
@@ -47,7 +47,7 @@
|
||||
<record model="account.account" id="auction_expense">
|
||||
<field name="name">Auction Adjudication Expenses</field>
|
||||
<field name="code">A6x*</field>
|
||||
<field name="user_type" ref="account.account_type_expense"/>
|
||||
<field name="user_type" ref="account.data_account_type_expense"/>
|
||||
<field name="type">other</field>
|
||||
<field name="currency_id" search="[('name','=','EUR')]"/>
|
||||
<field name="parent_id" eval="auction_expense_view"/>
|
||||
|
||||
@@ -2,11 +2,19 @@
|
||||
<openerp>
|
||||
<data noupdate="0">
|
||||
|
||||
<record model="ir.module.category" id="module_category_auction">
|
||||
<field name="name">Auction</field>
|
||||
<field name="parent_id" ref="base.module_category_specific_industry_applications"/>
|
||||
<field name="sequence">26</field>
|
||||
</record>
|
||||
|
||||
<record id="group_auction_user" model="res.groups">
|
||||
<field name="name">Auction / User</field>
|
||||
<field name="name">User</field>
|
||||
<field name="category_id" ref="module_category_auction"/>
|
||||
</record>
|
||||
<record id="group_auction_manager" model="res.groups">
|
||||
<field name="name">Auction / Manager</field>
|
||||
<field name="name">Manager</field>
|
||||
<field name="category_id" ref="module_category_auction"/>
|
||||
<field name="implied_ids" eval="[(4, ref('group_auction_user'))]"/>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -45,7 +45,6 @@ Pay attention that this module converts the existing addresses into "addresses +
|
||||
'depends': ['base','process'],
|
||||
'init_xml': [],
|
||||
'update_xml': [
|
||||
'security/base_contact_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'base_contact_view.xml',
|
||||
'base_contact_installer_view.xml',
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data noupdate="0">
|
||||
|
||||
<record id="base.group_sale_salesman" model="res.groups">
|
||||
<field name="name">Sales / User</field>
|
||||
</record>
|
||||
|
||||
<record id="base.group_sale_manager" model="res.groups">
|
||||
<field name="name">Sales / Manager</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -3,16 +3,19 @@
|
||||
<data noupdate="0">
|
||||
|
||||
<record id="base.group_sale_salesman" model="res.groups">
|
||||
<field name="name">Sales / User - Own Leads Only</field>
|
||||
<field name="name">User - Own Leads Only</field>
|
||||
<field name="category_id" ref="base.module_category_sales_management"/>
|
||||
</record>
|
||||
|
||||
<record id="base.group_sale_salesman_all_leads" model="res.groups">
|
||||
<field name="name">Sales / User - All Leads</field>
|
||||
<field name="name">User - All Leads</field>
|
||||
<field name="category_id" ref="base.module_category_sales_management"/>
|
||||
<field name="implied_ids" eval="[(4, ref('base.group_sale_salesman'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="base.group_sale_manager" model="res.groups">
|
||||
<field name="name">Sales / Manager</field>
|
||||
<field name="name">Manager</field>
|
||||
<field name="category_id" ref="base.module_category_sales_management"/>
|
||||
<field name="implied_ids" eval="[(4, ref('base.group_sale_salesman_all_leads'))]"/>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -14,9 +14,9 @@ access_crm_case_categ,crm.case.categ,model_crm_case_categ,base.group_user,1,0,0,
|
||||
access_crm_meeting,crm.meeting,model_crm_meeting,base.group_sale_salesman,1,1,1,0
|
||||
access_crm_meeting_all,crm.meeting_allll,model_crm_meeting,base.group_user,1,0,0,0
|
||||
access_crm_lead,crm.lead,model_crm_lead,base.group_sale_salesman,1,1,1,0
|
||||
access_crm_lead.all,crm.lead.all,model_crm_lead,base.group_user,1,0,0,0
|
||||
access_crm_lead_all,crm.lead.all,model_crm_lead,base.group_user,1,0,0,0
|
||||
access_crm_phonecall,crm.phonecall,model_crm_phonecall,base.group_sale_salesman,1,1,1,0
|
||||
access_crm_phonecall.all,crm.phonecall.all,model_crm_phonecall,base.group_user,1,0,0,0
|
||||
access_crm_phonecall_all,crm.phonecall.all,model_crm_phonecall,base.group_user,1,0,0,0
|
||||
access_crm_case_section_user,crm.case.section.user,model_crm_case_section,base.group_sale_salesman,1,1,1,0
|
||||
access_crm_case_section_manager,crm.case.section.manager,model_crm_case_section,base.group_sale_manager,1,1,1,1
|
||||
access_crm_case_stage,crm.case.stage,model_crm_case_stage,base.group_user,1,0,0,0
|
||||
|
||||
|
|
After Width: | Height: | Size: 323 KiB |
@@ -39,7 +39,7 @@ It also has been merged with the earlier CRM & SRM segmentation tool because the
|
||||
'website': 'http://www.openerp.com',
|
||||
'depends': ['base', 'crm'],
|
||||
'init_xml': [],
|
||||
'update_xml': ['security/ir.model.access.csv', 'crm_profiling_view.xml'],
|
||||
'update_xml': ['security/ir.model.access.csv', 'wizard/open_questionnaire_view.xml', 'crm_profiling_view.xml'],
|
||||
'demo_xml': ['crm_profiling_demo.xml'],
|
||||
'test': [
|
||||
#'test/process/profiling.yml', #TODO:It's not debuging because problem to write data for open.questionnaire from partner section.
|
||||
|
||||
@@ -159,30 +159,6 @@ class questionnaire(osv.osv):
|
||||
_name="crm_profiling.questionnaire"
|
||||
_description= "Questionnaire"
|
||||
|
||||
def build_form(self, cr, uid, data, context=None):
|
||||
"""
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param data: Get Data
|
||||
@param context: A standard dictionary for contextual values """
|
||||
|
||||
query = """
|
||||
select name, id
|
||||
from crm_profiling_question
|
||||
where id in ( select question from profile_questionnaire_quest_rel where questionnaire = %s)"""
|
||||
res = cr.execute(query, (data['form']['questionnaire_name'],))
|
||||
result = cr.fetchall()
|
||||
quest_fields={}
|
||||
quest_form='''<?xml version="1.0"?>
|
||||
<form string="%s">''' % _('Questionnaire')
|
||||
for name, oid in result:
|
||||
quest_form = quest_form + '<field name="quest_form%d"/><newline/>' % (oid,)
|
||||
quest_fields['quest_form%d' % (oid,)] = {'string': name, 'type': 'many2one', \
|
||||
'relation': 'crm_profiling.answer', 'domain': [('question_id','=',oid)] }
|
||||
quest_form = quest_form + '''</form>'''
|
||||
return quest_form, quest_fields
|
||||
|
||||
_columns = {
|
||||
'name': fields.char("Questionnaire",size=128, required=True),
|
||||
'description':fields.text("Description", required=True),
|
||||
@@ -210,25 +186,19 @@ class partner(osv.osv):
|
||||
"partner","answer","Answers"),
|
||||
}
|
||||
|
||||
def _questionnaire_compute(self, cr, uid, data, context=None):
|
||||
def _questionnaire_compute(self, cr, uid, answers, context=None):
|
||||
"""
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param data: Get Data
|
||||
@param context: A standard dictionary for contextual values """
|
||||
|
||||
temp = []
|
||||
for x in data['form']:
|
||||
if x.startswith("quest_form") and data['form'][x] != 0 :
|
||||
temp.append(data['form'][x])
|
||||
|
||||
partner_id = context.get('active_id')
|
||||
query = "select answer from partner_question_rel where partner=%s"
|
||||
cr.execute(query, (data['id'],))
|
||||
cr.execute(query, (partner_id,))
|
||||
for x in cr.fetchall():
|
||||
temp.append(x[0])
|
||||
|
||||
self.write(cr, uid, [data['id']], {'answers_ids':[[6, 0, temp]]}, context=context)
|
||||
answers.append(x[0])
|
||||
self.write(cr, uid, [partner_id], {'answers_ids': [[6, 0, answers]]}, context=context)
|
||||
return {}
|
||||
|
||||
|
||||
|
||||
@@ -2,13 +2,6 @@
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<wizard
|
||||
string="Using a questionnaire"
|
||||
model="crm_profiling.questionnaire"
|
||||
name="open_questionnaire"
|
||||
menu="False"
|
||||
id="wizard_open_questionnaire"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="open_questionnaires">
|
||||
<field name="name">Questionnaires</field>
|
||||
<field name="res_model">crm_profiling.questionnaire</field>
|
||||
@@ -140,7 +133,7 @@
|
||||
<notebook position="inside">
|
||||
<page string="Profiling">
|
||||
<button string="Use a questionnaire"
|
||||
name="%(wizard_open_questionnaire)d" type="action" colspan="1"
|
||||
name="%(action_open_questionnaire)d" type="action" colspan="1"
|
||||
icon="gtk-justify-fill" />
|
||||
<newline/>
|
||||
<field name="answers_ids" colspan="4" nolabel="1"/>
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -1,10 +1,69 @@
|
||||
- |
|
||||
I check segmentation which allows users to perform segmentation within partners.
|
||||
-
|
||||
I check segmentation which allows users to perform segmentation within partners
|
||||
and set the category according to question, so first compute questions(answers)
|
||||
scenario with parther and check that category set according to questions.
|
||||
I create a crm profiling question record.
|
||||
-
|
||||
!record {model: crm_profiling.question, id: crm_profiling_question_openerppartner0}:
|
||||
answers_ids:
|
||||
- name: 'no'
|
||||
name: OpenERP partner?
|
||||
-
|
||||
I create a crm profiling answer record.
|
||||
-
|
||||
!record {model: crm_profiling.answer, id: crm_profiling_answer_openerppartner0}:
|
||||
name: 'yes'
|
||||
question_id: crm_profiling_question_openerppartner0
|
||||
-
|
||||
I create Partner category Customers.
|
||||
-
|
||||
!record {model: res.partner.category, id: res_partner_category_customers0}:
|
||||
name: Customers
|
||||
- |
|
||||
I'm creating new partner "John" with his email "info@mycustomer.com".
|
||||
-
|
||||
!record {model: res.partner, id: res_partner_john0}:
|
||||
address:
|
||||
- city: Bruxelles
|
||||
country_id: base.be
|
||||
street: Rue des Palais 51, bte 33
|
||||
type: default
|
||||
zip: '1000'
|
||||
email: 'info@mycustomer.com'
|
||||
name: John
|
||||
category_id:
|
||||
- res_partner_category_customers0
|
||||
|
||||
-
|
||||
Define the answers and category to partner.
|
||||
-
|
||||
!python {model: res.partner}: |
|
||||
data ={'form': {'quest_form3': ref("partner_quality3"), 'quest_form2': ref("nb_employees2"),'quest_form1': ref("sector1"),'questionnaire_name': ref('questionnaire1')}, 'ids': [ref('base.res_partner_ericdubois0')], 'report_type': 'pdf', 'model': 'res.partner', 'id': ref('base.res_partner_ericdubois0')}
|
||||
data = self._questionnaire_compute(cr, uid, data, context)
|
||||
partner = self.browse(cr, uid, ref('base.res_partner_ericdubois0'))
|
||||
assert partner.category_id[0].id == ref("base.res_partner_category_17"), "Category not assign properly"
|
||||
data ={'form': {'questionnaire_name': ref('res_partner_john0')}, 'ids': [ref('res_partner_john0')], 'report_type': 'pdf', 'model': 'res.partner', 'id': ref('res_partner_john0')}
|
||||
context['active_id'] = ref('res_partner_john0')
|
||||
self._questionnaire_compute(cr, uid, [ref('crm_profiling_answer_openerppartner0')], context)
|
||||
- |
|
||||
I start by creating new Questionnaire.
|
||||
-
|
||||
!record {model: crm_profiling.questionnaire, id: crm_profiling_questionnaire_basequestionnaire0}:
|
||||
description: First questionnaire.
|
||||
name: Base questionnaire
|
||||
questions_ids:
|
||||
- crm_profiling.activity_sector
|
||||
- crm_profiling.nb_employees
|
||||
- crm_profiling.partner_level
|
||||
-
|
||||
I create a segmentation record.
|
||||
-
|
||||
!record {model: crm.segmentation, id: crm_segmentation_test1}:
|
||||
answer_yes:
|
||||
- crm_profiling_answer_openerppartner0
|
||||
categ_id: res_partner_category_customers0
|
||||
name: test
|
||||
parent_id: crm_profiling.crm_segmentation0
|
||||
profiling_active: true
|
||||
som_interval: 0.0
|
||||
- |
|
||||
I continue the process of segmentation.
|
||||
-
|
||||
!python {model: crm.segmentation}: |
|
||||
self.process_continue(cr, uid, [ref('crm_segmentation_test1')], start=False)
|
||||
|
||||
|
||||
@@ -18,50 +18,72 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
import pooler
|
||||
import wizard
|
||||
from tools import UpdateableStr, UpdateableDict
|
||||
|
||||
_QUEST_FORM = UpdateableStr()
|
||||
_QUEST_FIELDS=UpdateableDict()
|
||||
from osv import osv, fields
|
||||
from tools.translate import _
|
||||
|
||||
class open_questionnaire(wizard.interface):
|
||||
|
||||
def _questionnaire_compute(self, cr, uid, data, context):
|
||||
pooler.get_pool(cr.dbname).get(data['model'])._questionnaire_compute(cr, uid, data, context)
|
||||
return {}
|
||||
|
||||
|
||||
def build_form(self, cr, uid, data, context):
|
||||
quest_form, quest_fields = pooler.get_pool(cr.dbname).get('crm_profiling.questionnaire').build_form(cr, uid, data, context)
|
||||
_QUEST_FORM. __init__(quest_form)
|
||||
_QUEST_FIELDS.__init__(quest_fields)
|
||||
return{}
|
||||
|
||||
_questionnaire_choice_arch = '''<?xml version="1.0"?>
|
||||
<form string="Questionnaire">
|
||||
<field name="questionnaire_name"/>
|
||||
</form>'''
|
||||
|
||||
_questionnaire_choice_fields = {
|
||||
'questionnaire_name': {'string': 'Questionnaire name', 'type': 'many2one', 'relation': 'crm_profiling.questionnaire', 'required': True },
|
||||
class open_questionnaire_line(osv.osv_memory):
|
||||
_name = 'open.questionnaire.line'
|
||||
_rec_name = 'question_id'
|
||||
_columns = {
|
||||
'question_id': fields.many2one('crm_profiling.question','Question', required=True),
|
||||
'answer_id': fields.many2one('crm_profiling.answer', 'Answer'),
|
||||
'wizard_id': fields.many2one('open.questionnaire', 'Questionnaire'),
|
||||
}
|
||||
|
||||
states = {
|
||||
'init': {
|
||||
'actions': [],
|
||||
'result': {'type': 'form', 'arch': _questionnaire_choice_arch, 'fields': _questionnaire_choice_fields, 'state':[('end', 'Cancel','gtk-cancel'), ('open', 'Open Questionnaire','terp-camera_test')]}
|
||||
},
|
||||
'open': {
|
||||
'actions': [build_form],
|
||||
'result': {'type': 'form', 'arch':_QUEST_FORM, 'fields': _QUEST_FIELDS, 'state':[('end', 'Cancel','gtk-cancel'), ('compute', 'Save Data','terp-stock_format-scientific')]}
|
||||
},
|
||||
'compute': {
|
||||
'actions': [],
|
||||
'result': {'type': 'action', 'action': _questionnaire_compute, 'state':'end'}
|
||||
open_questionnaire_line()
|
||||
|
||||
class open_questionnaire(osv.osv_memory):
|
||||
_name = 'open.questionnaire'
|
||||
_columns = {
|
||||
'questionnaire_id': fields.many2one('crm_profiling.questionnaire', 'Questionnaire name'),
|
||||
'question_ans_ids': fields.one2many('open.questionnaire.line', 'wizard_id', 'Question / Answers'),
|
||||
}
|
||||
|
||||
def default_get(self, cr, uid, fields, context=None):
|
||||
if context is None: context = {}
|
||||
res = super(open_questionnaire, self).default_get(cr, uid, fields, context=context)
|
||||
questionnaire_id = context.get('questionnaire_id', False)
|
||||
if questionnaire_id and 'question_ans_ids' in fields:
|
||||
query = """
|
||||
select question as question_id from profile_questionnaire_quest_rel where questionnaire = %s"""
|
||||
cr.execute(query, (questionnaire_id,))
|
||||
result = cr.dictfetchall()
|
||||
res.update(question_ans_ids=result)
|
||||
return res
|
||||
|
||||
def questionnaire_compute(self, cr, uid, ids, context=None):
|
||||
""" Adds selected answers in partner form """
|
||||
model = context.get('active_model')
|
||||
answers = []
|
||||
if model == 'res.partner':
|
||||
data = self.browse(cr, uid, ids[0], context=context)
|
||||
for d in data.question_ans_ids:
|
||||
if d.answer_id:
|
||||
answers.append(d.answer_id.id)
|
||||
self.pool.get(model)._questionnaire_compute(cr, uid, answers, context=context)
|
||||
return {'type': 'ir.actions.act_window_close'}
|
||||
|
||||
|
||||
def build_form(self, cr, uid, ids, context=None):
|
||||
""" Dynamically generates form according to selected questionnaire """
|
||||
models_data = self.pool.get('ir.model.data')
|
||||
result = models_data._get_id(cr, uid, 'crm_profiling', 'open_questionnaire_form')
|
||||
res_id = models_data.browse(cr, uid, result, context=context).res_id
|
||||
datas = self.browse(cr, uid, ids[0], context=context)
|
||||
context.update({'questionnaire_id': datas.questionnaire_id.id})
|
||||
|
||||
return {
|
||||
'name': _('Questionnaire'),
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'open.questionnaire',
|
||||
'type': 'ir.actions.act_window',
|
||||
'views': [(res_id,'form')],
|
||||
'target': 'new',
|
||||
'context': context
|
||||
}
|
||||
}
|
||||
|
||||
open_questionnaire('open_questionnaire')
|
||||
open_questionnaire()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
<?xml version="1.0" ?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_open_questionnaire_form" model="ir.ui.view">
|
||||
<field name="name">Open Questionnaires</field>
|
||||
<field name="model">open.questionnaire</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Questionnaires">
|
||||
<field name="questionnaire_id" required="1"/>
|
||||
<newline/>
|
||||
<separator string="" colspan="4"/>
|
||||
<group col="4" colspan="4">
|
||||
<group col="2" colspan="2"/>
|
||||
<button special="cancel" icon="gtk-cancel" string="Cancel"/>
|
||||
<button name="build_form" string="Open Questionnaire" icon="terp-camera_test" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_open_questionnaire">
|
||||
<field name="name">Open Questionnaire</field>
|
||||
<field name="res_model">open.questionnaire</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="view_open_questionnaire_form"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<record id="open_questionnaire_form" model="ir.ui.view">
|
||||
<field name="name">open.questionnaire.form</field>
|
||||
<field name="model">open.questionnaire</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<separator colspan="4" string="Questionnaire"/>
|
||||
<field name="question_ans_ids" colspan="4" nolabel="1" mode="tree,form" width="550" height="200"/>
|
||||
<separator string="" colspan="4" />
|
||||
<label string="" colspan="2"/>
|
||||
<group col="2" colspan="2">
|
||||
<button icon='gtk-cancel' special="cancel" string="_Cancel" />
|
||||
<button name="questionnaire_compute" string="Save Data" icon="terp-stock_format-scientific" colspan="1" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_open_questionnaire_line_tree" model="ir.ui.view">
|
||||
<field name="name">open.questionnaire.line.list</field>
|
||||
<field name="model">open.questionnaire.line</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree editable="bottom" string="Questionnaire">
|
||||
<field name="question_id"/>
|
||||
<field name="answer_id" domain="[('question_id', '=', question_id)]"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_open_questionnaire_line_form" model="ir.ui.view">
|
||||
<field name="name">open.questionnaire.line.form</field>
|
||||
<field name="model">open.questionnaire.line</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Questionnaire">
|
||||
<field name="question_id"/>
|
||||
<field name="answer_id" domain="[('question_id', '=', question_id)]"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Questionnaire form view -->
|
||||
<!--<act_window
|
||||
context="{}"
|
||||
id="act_open_questionnaire"
|
||||
name="Using a Questionnaire"
|
||||
res_model="open.questionnaire"
|
||||
src_model="crm_profiling.questionnaire"
|
||||
view_id="view_open_questionnaire_form"
|
||||
target="new"
|
||||
view_mode="form"/>-->
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -3,7 +3,8 @@
|
||||
<data noupdate="0">
|
||||
|
||||
<record id="base.group_document_user" model="res.groups">
|
||||
<field name="name">Knowledge / User</field>
|
||||
<field name="name">User</field>
|
||||
<field name="category_id" ref="base.module_category_knowledge_management"/>
|
||||
</record>
|
||||
|
||||
<!-- <record id="group_document_manager" model="res.groups">-->
|
||||
|
||||
@@ -42,7 +42,6 @@ Note that:
|
||||
'depends': ['crm', 'base_contact', 'account', 'marketing', 'mail'],
|
||||
'init_xml': [],
|
||||
'update_xml': [
|
||||
'security/event_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'wizard/event_confirm_registration_view.xml',
|
||||
'wizard/event_confirm_view.xml',
|
||||
@@ -54,7 +53,11 @@ Note that:
|
||||
'res_partner_view.xml',
|
||||
],
|
||||
'demo_xml': ['event_demo.xml'],
|
||||
'test': ['test/test_event.yml'],
|
||||
'test': ['test/process/event_confirm2done.yml',
|
||||
'test/process/event_draft2cancel.yml',
|
||||
'test/process/partner_register2invoice.yml',
|
||||
'test/ui/duplicate_event.yml',
|
||||
'test/ui/demo_data.yml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '0083059161581',
|
||||
|
||||
@@ -61,6 +61,8 @@
|
||||
<field eval="time.strftime('%Y-%m-01 23:05:15')" name="date_end"/>
|
||||
<field name="product_id" ref="event_product_0"/>
|
||||
<field name="unit_price">68.00</field>
|
||||
<field name="mail_auto_registr">True</field>
|
||||
<field name="mail_auto_confirm">True</field>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="register_max">500</field>
|
||||
<field name="type" ref="event_type_1"/>
|
||||
@@ -74,9 +76,9 @@
|
||||
<field name="unit_price">24.00</field>
|
||||
<field name="type" ref="event_type_1"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="register_min">50</field>
|
||||
<field name="register_max">350</field>
|
||||
</record>
|
||||
<function model="event.event" name="button_confirm" eval="[ref('event_1')]"/>
|
||||
<record id="event_2" model="event.event">
|
||||
<field name="name">Conference on ERP Buisness</field>
|
||||
<field eval="time.strftime('%Y-%m-05 14:00:00')" name="date_begin"/>
|
||||
@@ -92,7 +94,7 @@
|
||||
<field name="mail_confirm">Thanks for registration. The conference will begin at 2 PM and will be given by Mr. Pinckaers.</field>
|
||||
</record>
|
||||
<function model="event.event" name="button_confirm" eval="[ref('event_2')]"/>
|
||||
<function model="event.event" name="button_done" eval="[ref('event_2')]"/>
|
||||
<function model="event.event" name="button_confirm" eval="[ref('event_2')]"/>
|
||||
|
||||
<!-- Demo data for Event Registration-->
|
||||
<record id="reg_1_1" model="event.registration">
|
||||
@@ -126,5 +128,16 @@
|
||||
|
||||
<function model="event.registration" name="check_confirm" eval="[ref('reg_0_1')]"/>
|
||||
|
||||
<record id="reg_0_2" model="event.registration">
|
||||
<field name="event_id" ref="event_2"/>
|
||||
<field name="partner_id" ref="base.res_partner_c2c"/>
|
||||
<field name="partner_invoice_id" ref="base.res_partner_c2c"/>
|
||||
<field name="nb_register">5</field>
|
||||
<field name="event_product">Ticket for Conference</field>
|
||||
<field name="unit_price">20</field>
|
||||
</record>
|
||||
|
||||
<function model="event.registration" name="check_confirm" eval="[ref('reg_0_2')]"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="marketing.group_marketing_user" model="res.groups">
|
||||
<field name="name">Marketing / User</field>
|
||||
</record>
|
||||
|
||||
<record id="marketing.group_marketing_manager" model="res.groups">
|
||||
<field name="name">Marketing / Manager</field>
|
||||
<field name="implied_ids" eval="[(4, ref('marketing.group_marketing_user'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="base.group_sale_manager" model="res.groups">
|
||||
<field name="name">Sales / Manager</field>
|
||||
</record>
|
||||
|
||||
<record id="base.group_sale_salesman" model="res.groups">
|
||||
<field name="name">Sales / User</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
-
|
||||
I want to organize one conference event on "OpenERP Business", Customer subscribe/join
|
||||
into "Conference on OpenERP Business" with 6 tickets, first I confim this event.
|
||||
-
|
||||
!python {model: event.event}: |
|
||||
self.button_confirm(cr, uid, [ref("event_0")])
|
||||
-
|
||||
I Check that Event is "confirmed", and Its automatically sending mail to registered
|
||||
partner which joined to this event.
|
||||
-
|
||||
!assert {model: event.event, id: event_0}:
|
||||
- state == 'confirm', "Event should be confirmed."
|
||||
-
|
||||
After completed event, I close this event.
|
||||
-
|
||||
!python {model: event.event}: |
|
||||
self.button_done(cr, uid, [ref("event_0")])
|
||||
-
|
||||
Check that conference is in "close" state.
|
||||
-
|
||||
!assert {model: event.event, id: event_0}:
|
||||
- state == 'done', "Event should be Closed."
|
||||
@@ -0,0 +1,22 @@
|
||||
-
|
||||
I want to organize event and its need Minimum 50 Registrations to confirm/start
|
||||
this Event, but Only 10 registration confirm for this event, I confirm this event.
|
||||
-
|
||||
!python {model: event.event}: |
|
||||
self.button_confirm(cr, uid, [ref("event_1")])
|
||||
-
|
||||
Now I cheked for event and It should not be confirm because registrations for
|
||||
this event is below limit.
|
||||
-
|
||||
!assert {model: event.event, id: event_1}:
|
||||
- state == 'confirm', "Event should be confirm."
|
||||
-
|
||||
So I cancel this Event
|
||||
-
|
||||
!python {model: event.event}: |
|
||||
self.button_cancel(cr, uid, [ref("event_1")])
|
||||
-
|
||||
I check event should be cancel.
|
||||
-
|
||||
!assert {model: event.event, id: event_1}:
|
||||
- state == 'cancel', "Event should be cancel"
|
||||
@@ -0,0 +1,62 @@
|
||||
-
|
||||
I want to organize one conference event, First I registered partner for event
|
||||
with 5 tickets.
|
||||
-
|
||||
!python {model: partner.event.registration}: |
|
||||
context.update({'active_model': 'res.partner', 'active_ids': [ref("base.res_partner_ericdubois0")], 'active_id': ref("base.res_partner_ericdubois0")})
|
||||
register = self.create(cr, uid, {'event_id': ref('event_1'),'nb_register': 5}, context=context)
|
||||
self.open_registration(cr, uid, [register], context=context)
|
||||
-
|
||||
Now I check for registration created base on partner.
|
||||
-
|
||||
!python {model: event.registration}: |
|
||||
ids = self.search(cr, uid, [('partner_id','=',ref("base.res_partner_ericdubois0")), ('event_id', '=', ref('event_1'))])
|
||||
assert ids, "Registration should be create here."
|
||||
-
|
||||
I confirm registration process.
|
||||
-
|
||||
!python {model: event.registration}: |
|
||||
self.check_confirm(cr, uid, [ref("reg_1_1")])
|
||||
-
|
||||
I Check that Registration is confirm.
|
||||
-
|
||||
!assert {model: event.registration, id: reg_1_1}:
|
||||
- state == 'open', "Registration should be open here."
|
||||
-
|
||||
After confirmation of partner, I create invoice base on costing of event.
|
||||
-
|
||||
!python {model: event.registration}: |
|
||||
self.action_invoice_create(cr, uid, [ref("reg_1_1")])
|
||||
-
|
||||
Now I Check for Invoice is created and Registration should be closed after invoice generated.
|
||||
-
|
||||
!python {model: event.registration}: |
|
||||
record = self.browse(cr, uid, [ref("reg_1_1")])[0]
|
||||
assert record.invoice_id, "Invoice should be generated"
|
||||
assert record.invoice_id.state == "draft", "Invoice state should be draft"
|
||||
assert record.invoice_id.partner_id == record.partner_id, "Customer is not correspond with registration"
|
||||
assert record.invoice_id.type == 'out_invoice', "Invoice type is not correct"
|
||||
assert record.invoice_id.origin == record.event_product, "Invoice origin is not correct"
|
||||
assert record.invoice_id.amount_total == record.price_subtotal, "Invoice amount is not correct"
|
||||
assert record.state == "done", "Registration should be closed after invoice generated"
|
||||
-
|
||||
Now I check for same partner registration for two diffrent event and I create group invoices for same partner.
|
||||
-
|
||||
!python {model: event.make.invoice}: |
|
||||
context.update({'active_model': 'event.make.invoice', 'active_ids': [ref("reg_0_1"), ref("reg_0_2")], 'active_id': ref("reg_0_1")})
|
||||
invoice = self.create(cr, uid, {'grouped': True}, context=context)
|
||||
self.make_invoice(cr, uid, [invoice], context=context)
|
||||
-
|
||||
Now I Check for group Invoice is created with total amount of both registration
|
||||
and Registration should be closed after invoice generated.
|
||||
-
|
||||
!python {model: event.registration}: |
|
||||
reg_data_1 = self.browse(cr, uid, [ref("reg_0_1")])[0]
|
||||
reg_data_2 = self.browse(cr, uid, [ref("reg_0_2")])[0]
|
||||
assert reg_data_1.invoice_id, "Invoice should be generated"
|
||||
assert reg_data_1.invoice_id.state == "draft", "Invoice state should be draft"
|
||||
assert reg_data_1.invoice_id.partner_id == reg_data_1.partner_id, "Customer is not correspond with registration"
|
||||
assert reg_data_1.invoice_id.type == 'out_invoice', "Invoice type is not correct"
|
||||
assert reg_data_1.invoice_id.origin == reg_data_1.event_product, "Invoice origin is not correct"
|
||||
assert reg_data_1.invoice_id.amount_total == (reg_data_1.price_subtotal + reg_data_2.price_subtotal), "Invoice total amount is not correct"
|
||||
assert reg_data_1.state == "done", "Registration should be closed after invoice generated"
|
||||
@@ -1,172 +0,0 @@
|
||||
- |
|
||||
In order to test the "Event Organisation" in Association system.
|
||||
- |
|
||||
I want to organize one conference event on "OpenERP Business".
|
||||
- |
|
||||
I'm creating new product "Conference Ticket" to specify registration Cost of conference.
|
||||
-
|
||||
!record {model: product.product, id: product_product_ticketforconcert0}:
|
||||
categ_id: product.cat1
|
||||
list_price: 68.0
|
||||
name: Conference Ticket
|
||||
- |
|
||||
I'm creating Event type "Conference".
|
||||
-
|
||||
!record {model: event.type, id: event_type_conference0}:
|
||||
name: Conferences
|
||||
- |
|
||||
I'm creating one Event "Conference on OpenERP Business" which will last from 1st of this month to 10th of this month.
|
||||
-
|
||||
!record {model: event.event, id: event_event_conference0}:
|
||||
date_begin: !eval time.strftime('%Y-%m-01')
|
||||
date_end: !eval time.strftime('%Y-%m-10')
|
||||
name: Conference on OpenERP Business.
|
||||
product_id: 'product_product_ticketforconcert0'
|
||||
type: 'event_type_conference0'
|
||||
reply_to: 'info@customer.com'
|
||||
- |
|
||||
Check that the new conference event is "Draft" or not.
|
||||
-
|
||||
!assert {model: event.event, id: event_event_conference0}:
|
||||
- state == 'draft', "Event should be in draft by default when first time created"
|
||||
- |
|
||||
Need Minimum 10 Registrations to confirm/start this Conference Event and does not allowed more than 100 Registrations.
|
||||
- |
|
||||
So I set Minimum and Maximum Registrations limit.
|
||||
-
|
||||
!python {model: event.event}: |
|
||||
self.write(cr, uid, [ref('event_event_conference0')], {'register_max': 100, 'register_min': 10})
|
||||
- |
|
||||
I'm doing to confirm that conference event.
|
||||
-
|
||||
!python {model: event.event}: |
|
||||
self.button_confirm(cr, uid, [ref("event_event_conference0")])
|
||||
- |
|
||||
But this conference event need minimum 10 Confirmed Registrations. so Check that Event is not "confirmed".
|
||||
-
|
||||
!assert {model: event.event, id: event_event_conference0}:
|
||||
- state != 'confirm', "Event should not confirmed if minimum registrations does not reached"
|
||||
- |
|
||||
"Mark Johnson" want to subscribe/join into "Conference on OpenERP Business" with 10 tickets.
|
||||
- |
|
||||
I'm creating new partner "Mark Johnson" with his email "info@mycustomer.com".
|
||||
-
|
||||
!record {model: res.partner, id: res_partner_markjohnson0}:
|
||||
address:
|
||||
- city: Bruxelles
|
||||
country_id: base.be
|
||||
job_ids:
|
||||
- contact_id: base_contact.res_partner_contact_jacot0
|
||||
function: CTO
|
||||
name: base.res_partner_maxtor
|
||||
sequence_partner: 0.0
|
||||
state: current
|
||||
street: Rue des Palais 51, bte 33
|
||||
type: default
|
||||
zip: '1000'
|
||||
email: 'info@mycustomer.com'
|
||||
name: Mark Johnson
|
||||
|
||||
- |
|
||||
I'm creating Registration for "Mark Johnson" on "Conference on OpenERP Business" with 10 tickets.
|
||||
-
|
||||
!record {model: event.registration, id: event_registration_registrationjacot0}:
|
||||
contact_id: base_contact.res_partner_contact_jacot0
|
||||
event_id: event.event_event_conference0
|
||||
partner_id: event.res_partner_markjohnson0
|
||||
partner_invoice_id: event.res_partner_markjohnson0
|
||||
event_product: Conference Ticket
|
||||
unit_price: 68.0
|
||||
nb_register: 10
|
||||
- |
|
||||
I'm going to Open that Registration.
|
||||
-
|
||||
!python {model: event.registration}: |
|
||||
self.check_confirm(cr, uid, [ref("event_registration_registrationjacot0")])
|
||||
- |
|
||||
Check that Registration is in "Open" state or not.
|
||||
-
|
||||
!assert {model: event.registration, id: event_registration_registrationjacot0}:
|
||||
- state == 'open', "Registration should be open here."
|
||||
|
||||
- |
|
||||
I'm again trying to confirm that conference event.
|
||||
-
|
||||
!python {model: event.event}: |
|
||||
self.button_confirm(cr, uid, [ref("event_event_conference0")])
|
||||
|
||||
- |
|
||||
Now Minimum requirement of Registration is fulfil. so Check that Event is "confirmed" or not.
|
||||
-
|
||||
!assert {model: event.event, id: event_event_conference0}:
|
||||
- state == 'confirm', "Event should be confirmed here."
|
||||
|
||||
- |
|
||||
I'm creating invoice of Registration of "Mark Johnson" on "Conference on OpenERP Business".
|
||||
-
|
||||
!python {model: event.registration}: |
|
||||
self.action_invoice_create(cr, uid, [ref("event_registration_registrationjacot0")])
|
||||
|
||||
- |
|
||||
Check Invoice of Registration of "Mark Johnson" is created or not.
|
||||
-
|
||||
!assert {model: event.registration, id: event_registration_registrationjacot0}:
|
||||
- invoice_id != False, "Invoice should be generated"
|
||||
|
||||
- |
|
||||
Check Registration of "Mark Johnson" is closed or not after invoice generated.
|
||||
-
|
||||
!assert {model: event.registration, id: event_registration_registrationjacot0}:
|
||||
- state != 'done', "Registration should be closed after invoice generated"
|
||||
|
||||
- |
|
||||
Now "Mark Johnson" want to another registration on "Conference on OpenERP Business" with 120 tickets.
|
||||
- |
|
||||
I'm creating new registration for "Mark Johnson" with 100 tickets.
|
||||
-
|
||||
!record {model: event.registration, id: event_registration_registrationzen0}:
|
||||
event_id: event.event_event_conference0
|
||||
partner_id: event.res_partner_markjohnson0
|
||||
partner_invoice_id: event.res_partner_markjohnson0
|
||||
event_product: Conference Ticket
|
||||
unit_price: 68.0
|
||||
nb_register: 100
|
||||
|
||||
- |
|
||||
I'm going to open "Mark Johnson" registration.
|
||||
-
|
||||
!python {model: event.registration}: |
|
||||
self.check_confirm(cr, uid, [ref("event_registration_registrationzen0")])
|
||||
|
||||
- |
|
||||
But conference event does not allow more than 100 Registrations. so Check that registration is not in "open" state.
|
||||
-
|
||||
!assert {model: event.registration, id: event_registration_registrationzen0}:
|
||||
- state == 'draft', "Registration should be in draft by default."
|
||||
- |
|
||||
Now I'm modifying number of tickets of "Mark Johnson"'s registration with 90 tickets.
|
||||
-
|
||||
!python {model: event.registration}: |
|
||||
self.write(cr, uid, [ref("event_registration_registrationzen0")], {'nb_register': 90})
|
||||
- |
|
||||
I'm again try to open "Mark Johnson" registration.
|
||||
-
|
||||
!python {model: event.registration}: |
|
||||
self.check_confirm(cr, uid, [ref("event_registration_registrationzen0")])
|
||||
|
||||
- |
|
||||
Check that registration "open" or not.
|
||||
-
|
||||
!assert {model: event.registration, id: event_registration_registrationzen0}:
|
||||
- state == 'open', "Registration should be open here."
|
||||
- |
|
||||
I'm closing "Conference on OpenERP Business" Conference event
|
||||
-
|
||||
!python {model: event.event}: |
|
||||
self.button_done(cr, uid, [ref("event_event_conference0")])
|
||||
- |
|
||||
Check that conference is in "close" state or not.
|
||||
-
|
||||
!assert {model: event.event, id: event_event_conference0}:
|
||||
- state == 'done', "Registration should be Closed here."
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
-
|
||||
I create event registation record to call event onchange and partner onchange.
|
||||
-
|
||||
!record {model: event.registration, id: reg_0_1}:
|
||||
event_id: event_0
|
||||
partner_id: base.res_partner_asus
|
||||
name: 'Ticket for Concert'
|
||||
-
|
||||
I create event record to call product onchange and team onchange.
|
||||
-
|
||||
!record {model: event.event, id: event_2}:
|
||||
product_id: event_product_2
|
||||
section_id: crm.section_sales_department
|
||||
name: 'Conference on ERP Buisness'
|
||||
-
|
||||
I call onchange event from event registration wizard.
|
||||
-
|
||||
!python {model: partner.event.registration}: |
|
||||
context.update({'active_id': ref("base.res_partner_ericdubois0")})
|
||||
self.onchange_event_id(cr, uid, 1, ref("event_1"), context=context)
|
||||
-
|
||||
I confirm event from wizard.
|
||||
-
|
||||
!python {model: event.confirm}: |
|
||||
context.update({'event_ids': [ref("event_2")]})
|
||||
id = self.create(cr, uid , {})
|
||||
self.confirm(cr, uid, [id], context=context)
|
||||
-
|
||||
I call close registration process.
|
||||
-
|
||||
!python {model: event.registration}: |
|
||||
self.button_reg_close(cr, uid, [ref("reg_0_2")])
|
||||
@@ -0,0 +1,16 @@
|
||||
-
|
||||
Copy of event.
|
||||
-
|
||||
!python {model: event.event}: |
|
||||
try:
|
||||
self.copy(cr, uid, ref("event_2"))
|
||||
except:
|
||||
pass
|
||||
-
|
||||
Copy of event registarion.
|
||||
-
|
||||
!python {model: event.registration}: |
|
||||
try:
|
||||
self.copy(cr, uid, ref("reg_1_1"))
|
||||
except:
|
||||
pass
|
||||
@@ -34,8 +34,8 @@ class partner_event_registration(osv.osv_memory):
|
||||
'event_id': fields.many2one('event.event', 'Event'),
|
||||
'event_type': fields.many2one('event.type', 'Type', readonly=True),
|
||||
'unit_price': fields.float('Registration Cost', digits_compute=dp.get_precision('Sale Price')),
|
||||
'start_date': fields.datetime('Start date', required=True, help="Beginning Date of Event", readonly=True),
|
||||
'end_date': fields.datetime('Closing date', required=True, help="Closing Date of Event", readonly=True),
|
||||
'start_date': fields.datetime('Start date', help="Beginning Date of Event", readonly=True),
|
||||
'end_date': fields.datetime('Closing date', help="Closing Date of Event", readonly=True),
|
||||
'nb_register': fields.integer('Number of Registration'),
|
||||
}
|
||||
_defaults = {
|
||||
|
||||
@@ -3,11 +3,13 @@
|
||||
<data noupdate="1">
|
||||
|
||||
<record id="base.group_hr_user" model="res.groups">
|
||||
<field name="name">Human Resources / HR Officer</field>
|
||||
<field name="name">HR Officer</field>
|
||||
<field name="category_id" ref="base.module_category_human_resources"/>
|
||||
<field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
|
||||
</record>
|
||||
<record id="base.group_hr_manager" model="res.groups">
|
||||
<field name="name">Human Resources / HR Manager</field>
|
||||
<field name="name">HR Manager</field>
|
||||
<field name="category_id" ref="base.module_category_human_resources"/>
|
||||
<field name="implied_ids" eval="[(4, ref('base.group_hr_user'))]"/>
|
||||
</record>
|
||||
<record id="hr_dept_comp_rule" model="ir.rule">
|
||||
|
||||
|
After Width: | Height: | Size: 8.1 KiB |
@@ -62,8 +62,9 @@ re-invoice your customer's expenses if your work by project.
|
||||
'demo_xml': [
|
||||
'hr_expense_demo.xml',
|
||||
],
|
||||
'test': ['test/test_hr_expense.yml',
|
||||
'test/hr_expense_report.yml',
|
||||
'test': [
|
||||
'test/expense_demo.yml',
|
||||
'test/expense_process.yml',
|
||||
],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
|
||||
@@ -87,6 +87,7 @@ class hr_expense_expense(osv.osv):
|
||||
\nIf the admin accepts it, the state is \'Accepted\'.\n If an invoice is made for the expense request, the state is \'Invoiced\'.\n If the expense is paid to user, the state is \'Reimbursed\'.'),
|
||||
}
|
||||
_defaults = {
|
||||
'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'hr.employee', context=c),
|
||||
'date': lambda *a: time.strftime('%Y-%m-%d'),
|
||||
'state': 'draft',
|
||||
'employee_id': _employee_get,
|
||||
|
||||
@@ -8,18 +8,6 @@
|
||||
<field name="parent_id" ref="product.cat0"/>
|
||||
<field name="name">Expenses</field>
|
||||
</record>
|
||||
|
||||
<record id="product_product_expense_car" model="product.product">
|
||||
<field name="list_price">0.32</field>
|
||||
<field name="standard_price">0.32</field>
|
||||
<field name="uom_id" ref="product.product_uom_km"/>
|
||||
<field name="uom_po_id" ref="product.product_uom_km"/>
|
||||
<field name="type">consu</field>
|
||||
<field name="name">Travel Expenses</field>
|
||||
<field name="default_code">TRA</field>
|
||||
<field name="categ_id" ref="hr_expense.cat_expense"/>
|
||||
<field name="hr_expense_ok" eval="True" />
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
</openerp>
|
||||
|
||||
@@ -2,95 +2,88 @@
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
|
||||
<record id="product_product_expense_air" model="product.product">
|
||||
<field name="list_price">1.0</field>
|
||||
<field name="standard_price">1.0</field>
|
||||
<field name="uom_id" ref="product.product_uom_unit"/>
|
||||
<field name="uom_po_id" ref="product.product_uom_unit"/>
|
||||
<record id="hr.employee4" model="hr.employee">
|
||||
<field name="address_home_id" ref="base.res_partner_address_1"/>
|
||||
</record>
|
||||
|
||||
<record id="car_travel" model="product.product">
|
||||
<field name="list_price">0.32</field>
|
||||
<field name="type">service</field>
|
||||
<field name="name">Car Travel Expenses</field>
|
||||
<field name="default_code">CarTRA</field>
|
||||
<field name="categ_id" ref="hr_expense.cat_expense"/>
|
||||
<field name="hr_expense_ok" eval="True" />
|
||||
</record>
|
||||
|
||||
<record id="air_ticket" model="product.product">
|
||||
<field name="list_price">700.0</field>
|
||||
<field name="type">service</field>
|
||||
<field name="name">Air Ticket</field>
|
||||
<field name="default_code">AT</field>
|
||||
<field name="categ_id" ref="product.cat2"/>
|
||||
<field name="categ_id" ref="hr_expense.cat_expense"/>
|
||||
<field name="hr_expense_ok" eval="True" />
|
||||
</record>
|
||||
|
||||
<record id="product_product_expense_hotel" model="product.product">
|
||||
<field name="list_price">1.0</field>
|
||||
<field name="standard_price">1.0</field>
|
||||
<field name="uom_id" ref="product.product_uom_unit"/>
|
||||
<field name="uom_po_id" ref="product.product_uom_unit"/>
|
||||
<record id="hotel_rent" model="product.product">
|
||||
<field name="list_price">400.0</field>
|
||||
<field name="type">service</field>
|
||||
<field name="name">Hotel Accommodation</field>
|
||||
<field name="default_code">HA0</field>
|
||||
<field name="categ_id" ref="product.cat2"/>
|
||||
<field name="categ_id" ref="hr_expense.cat_expense"/>
|
||||
<field name="hr_expense_ok" eval="True" />
|
||||
</record>
|
||||
|
||||
<record id="hr_expense_expense_septemberexpenses0" model="hr.expense.expense">
|
||||
<field name="currency_id" ref="base.EUR"/>
|
||||
<field name="employee_id" ref="hr.employee1"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="name">May Expenses</field>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="date" eval="time.strftime('%Y-%m-03')"/>
|
||||
<field name="state">draft</field>
|
||||
<record id="expenses0" model="hr.expense.expense">
|
||||
<field name="name">Expenses</field>
|
||||
<field name="date" eval="time.strftime('%Y-08-25')"/>
|
||||
</record>
|
||||
<record id="expenses_line0" model="hr.expense.line">
|
||||
<field name="name">Travel Expenses</field>
|
||||
<field name="date_value" eval="time.strftime('%Y-08-10')"/>
|
||||
<field name="analytic_account" ref="account.analytic_consultancy"/>
|
||||
<field name="expense_id" ref="expenses0"/>
|
||||
<field eval="200.0" name="unit_amount"/>
|
||||
<field name="uom_id" ref="product.product_uom_unit"/>
|
||||
<field eval="1.0" name="unit_quantity"/>
|
||||
</record>
|
||||
|
||||
<record id="hr_expense_line_travelbycarcustomerseagatedouble0" model="hr.expense.line">
|
||||
<record id="sep_expenses" model="hr.expense.expense">
|
||||
<field name="employee_id" ref="hr.employee4"/>
|
||||
<field name="name">September Expenses</field>
|
||||
<field name="date" eval="time.strftime('%Y-09-28')"/>
|
||||
</record>
|
||||
|
||||
<record id="travel_by_air_sep" model="hr.expense.line">
|
||||
<field name="name">Travel by Air</field>
|
||||
<field name="date_value" eval="time.strftime('%Y-%m-03')"/>
|
||||
<field name="date_value" eval="time.strftime('%Y-09-03')"/>
|
||||
<field name="analytic_account" ref="account.analytic_consultancy"/>
|
||||
<field name="product_id" ref="product_product_expense_air"/>
|
||||
<field model="hr.expense.expense" name="expense_id" search="[('name', '=', u'May Expenses')]"/>
|
||||
<field name="product_id" ref="air_ticket"/>
|
||||
<field name="expense_id" ref="sep_expenses"/>
|
||||
<field eval="700.0" name="unit_amount"/>
|
||||
<field name="uom_id" ref="product.product_uom_unit"/>
|
||||
<field eval="1.0" name="unit_quantity"/>
|
||||
</record>
|
||||
|
||||
<record id="hr_expense_line_basicpcserverforseagate0" model="hr.expense.line">
|
||||
<field name="name">Basic PC - Server for Seagate</field>
|
||||
<field name="date_value" eval="time.strftime('%Y-%m-03')"/>
|
||||
<field name="analytic_account" ref="account.analytic_seagate_p2"/>
|
||||
<field name="product_id" ref="product.product_product_pc4"/>
|
||||
<field model="hr.expense.expense" name="expense_id" search="[('name', '=', u'May Expenses')]"/>
|
||||
<field eval="1200.0" name="unit_amount"/>
|
||||
<field name="uom_id" ref="product.product_uom_unit"/>
|
||||
<field eval="1.0" name="unit_quantity"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
|
||||
<data noupdate="1">
|
||||
<record id="hr_expense_expense_septemberexpenses1" model="hr.expense.expense">
|
||||
<field name="currency_id" ref="base.EUR"/>
|
||||
<field name="employee_id" ref="hr.employee1"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="name">Travel Expenses</field>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="date" eval="time.strftime('%Y-%m-20')"/>
|
||||
<field name="state">draft</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_expense_line_hotelexpensesthymbra0" model="hr.expense.line">
|
||||
<record id="hotel_bill_sep" model="hr.expense.line">
|
||||
<field name="name">Hotel Expenses - Thymbra</field>
|
||||
<field name="date_value" eval="time.strftime('%Y-%m-03')"/>
|
||||
<field name="date_value" eval="time.strftime('%Y-09-20')"/>
|
||||
<field name="analytic_account" ref="account.analytic_thymbra"/>
|
||||
<field name="product_id" ref="product_product_expense_hotel"/>
|
||||
<field model="hr.expense.expense" name="expense_id" search="[('name', '=', u'Travel Expenses')]"/>
|
||||
<field name="product_id" ref="hotel_rent"/>
|
||||
<field name="expense_id" ref="sep_expenses"/>
|
||||
<field eval="400.0" name="unit_amount"/>
|
||||
<field name="uom_id" ref="product.product_uom_unit"/>
|
||||
<field eval="5.0" name="unit_quantity"/>
|
||||
</record>
|
||||
|
||||
<record id="hr_expense_line_car_travel" model="hr.expense.line">
|
||||
<record id="car_travel_sep" model="hr.expense.line">
|
||||
<field name="name">Bruxelles - Paris</field>
|
||||
<field name="date_value" eval="time.strftime('%Y-%m-03')"/>
|
||||
<field name="date_value" eval="time.strftime('%Y-09-15')"/>
|
||||
<field name="analytic_account" ref="account.analytic_thymbra"/>
|
||||
<field name="product_id" ref="product_product_expense_car"/>
|
||||
<field model="hr.expense.expense" name="expense_id" search="[('name', '=', u'Travel Expenses')]"/>
|
||||
<field name="product_id" ref="car_travel"/>
|
||||
<field name="expense_id" ref="sep_expenses"/>
|
||||
<field eval="0.30" name="unit_amount"/>
|
||||
<field name="uom_id" ref="product.product_uom_km"/>
|
||||
<field eval="622.0" name="unit_quantity"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
|
After Width: | Height: | Size: 16 KiB |
@@ -0,0 +1,11 @@
|
||||
-
|
||||
!record {model: hr.expense.expense, id: sep_expenses}:
|
||||
employee_id: hr.employee4
|
||||
name : 'John Smith'
|
||||
-
|
||||
!record {model: product.product, id: car_travel}:
|
||||
hr_expense_ok: 'True'
|
||||
-
|
||||
!record {model: hr.expense.line, id: expense_line}:
|
||||
product_id: car_travel
|
||||
name: 'Car Travel Expenses'
|
||||
@@ -0,0 +1,60 @@
|
||||
-
|
||||
In order to test the process of "Employee Expenses" by processing the expenses, I confirm Expense Bill of an employee for September month.
|
||||
-
|
||||
!workflow {model: hr.expense.expense, action: confirm, ref: sep_expenses}
|
||||
-
|
||||
I check that state is 'Confirm'.
|
||||
-
|
||||
!assert {model: hr.expense.expense, id: sep_expenses, severity: error, string: Expense should be in Confirm state}:
|
||||
- state == 'confirm'
|
||||
-
|
||||
I approve the September expenses.
|
||||
-
|
||||
!workflow {model: hr.expense.expense, action: validate, ref: sep_expenses}
|
||||
-
|
||||
I check that state is 'Approved'
|
||||
-
|
||||
!assert {model: hr.expense.expense, id: sep_expenses, severity: error, string: Expense should be in Approved state}:
|
||||
- state == 'accepted'
|
||||
-
|
||||
I make Invoice for the expense.
|
||||
-
|
||||
!python {model: hr.expense.expense}: |
|
||||
self.invoice(cr, uid, [ref('sep_expenses')])
|
||||
-
|
||||
I check invoice details.
|
||||
-
|
||||
!python {model: hr.expense.expense}: |
|
||||
sep_expenses = self.browse(cr, uid, ref("sep_expenses"), context=context)
|
||||
assert sep_expenses.state == 'invoiced', "Expense should be in 'Invoiced' state."
|
||||
assert sep_expenses.invoice_id, "Expense should have link of Invoice."
|
||||
assert sep_expenses.invoice_id.currency_id == sep_expenses.currency_id,"Invoice currency is not correspond with supplier invoice currency"
|
||||
assert sep_expenses.invoice_id.origin == sep_expenses.name,"Invoice origin is not correspond with supplier invoice"
|
||||
assert sep_expenses.invoice_id.type == 'in_invoice', "Invoice type is not supplier invoice"
|
||||
assert sep_expenses.invoice_id.amount_total == sep_expenses.amount,"Invoice total amount is not correspond with supplier invoice total"
|
||||
assert len(sep_expenses.invoice_id.invoice_line) == len(sep_expenses.line_ids),"Lines of Invoice and supplier invoice Line are not correspond"
|
||||
#TODO: check invoice line details with Expenses lines
|
||||
-
|
||||
I pay the expenses.
|
||||
-
|
||||
!python {model: hr.expense.expense}: |
|
||||
self.expense_paid(cr, uid, [ref('sep_expenses')])
|
||||
-
|
||||
I check that state of expenses is 'Paid'.
|
||||
-
|
||||
!assert {model: hr.expense.expense, id: sep_expenses, severity: error, string: Expense should be in Paid state}:
|
||||
- state == 'paid'
|
||||
-
|
||||
I duplicate the expenses and cancel duplicated.
|
||||
-
|
||||
!python {model: hr.expense.expense}: |
|
||||
duplicate_id = self.copy(cr, uid, ref('sep_expenses'), context=context)
|
||||
self.expense_canceled(cr, uid, [duplicate_id])
|
||||
-
|
||||
I print a report of the expenses.
|
||||
-
|
||||
!python {model: hr.expense.expense}: |
|
||||
import netsvc, tools, os
|
||||
(data, format) = netsvc.LocalService('report.hr.expense').create(cr, uid, [ref('hr_expense.sep_expenses')], {}, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'hr_expense-report.'+format), 'wb+').write(data)
|
||||
@@ -1,8 +0,0 @@
|
||||
-
|
||||
In order to test the PDF reports defined on a HR Expense, we will print a HR Expense
|
||||
-
|
||||
!python {model: hr.expense.expense}: |
|
||||
import netsvc, tools, os
|
||||
(data, format) = netsvc.LocalService('report.hr.expense').create(cr, uid, [ref('hr_expense.hr_expense_expense_septemberexpenses0'),ref('hr_expense.hr_expense_expense_septemberexpenses1')], {}, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'hr_expense-report.'+format), 'wb+').write(data)
|
||||
@@ -1,121 +0,0 @@
|
||||
-
|
||||
In order to test hr_expenses for OpenERP, I create expenses for employee and manage employee's expenses.
|
||||
-
|
||||
I create an unit of measure category "Working Time".
|
||||
-
|
||||
!record {model: product.uom.categ, id: product_uom_categ_workingtime0}:
|
||||
name: Working Time.
|
||||
|
||||
-
|
||||
I create a new employee.
|
||||
-
|
||||
!record {model: hr.employee, id: hr.employee}:
|
||||
address_home_id: base.res_partner_address_1
|
||||
address_id: base.main_address
|
||||
-
|
||||
I assign home address to employee.
|
||||
-
|
||||
!record {model: hr.employee, id: hr.employee1}:
|
||||
address_home_id: base.res_partner_address_1
|
||||
address_id: base.main_address
|
||||
-
|
||||
I create product unit of measure "Hour".
|
||||
-
|
||||
!record {model: product.uom, id: product_uom_hour0}:
|
||||
category_id: 'product_uom_categ_workingtime0'
|
||||
factor: 8.0
|
||||
name: Hour
|
||||
rounding: 0.01
|
||||
-
|
||||
I Create a product "travel".
|
||||
-
|
||||
!record {model: product.product, id: product_product_travel0}:
|
||||
categ_id: product.product_category_services
|
||||
cost_method: standard
|
||||
list_price: 800.0
|
||||
mes_type: fixed
|
||||
name: Travel
|
||||
procure_method: make_to_stock
|
||||
standard_price: 700.0
|
||||
supply_method: buy
|
||||
type: product
|
||||
uom_id: 'product_uom_hour0'
|
||||
uom_po_id: 'product_uom_hour0'
|
||||
volume: 0.0
|
||||
warranty: 0.0
|
||||
weight: 0.0
|
||||
weight_net: 0.0
|
||||
-
|
||||
I mark this product for expenses.
|
||||
-
|
||||
!python {model: product.product}: |
|
||||
self.on_change_hr_expense_ok(cr, uid, [ref('product_product_travel0')], True)
|
||||
-
|
||||
I create an expense.
|
||||
-
|
||||
!record {model: hr.expense.expense, id: hr_expense_expense_september0}:
|
||||
company_id: base.main_company
|
||||
date: !eval "'%s-05-05' %(datetime.now().year)"
|
||||
name: September Expenses
|
||||
line_ids:
|
||||
- date_value: !eval "'%s-05-27' %(datetime.now().year)"
|
||||
name: Travel
|
||||
product_id: 'product_product_travel0'
|
||||
sequence: 0.0
|
||||
uom_id: product.product_uom_unit
|
||||
unit_amount: 700.0
|
||||
user_id: base.user_root
|
||||
-
|
||||
I check that expense is in "Draft" state.
|
||||
-
|
||||
!assert {model: hr.expense.expense, id: hr_expense_expense_september0}:
|
||||
- state == 'draft'
|
||||
-
|
||||
I change the employee on expense form.
|
||||
-
|
||||
!python {model: hr.expense.expense}: |
|
||||
res = self.onchange_employee_id(cr, uid, [ref('hr_expense_expense_september0')], ref('hr.employee1'), None)
|
||||
values = dict([('employee_id', ref('hr.employee1'))] + res['value'].items())
|
||||
self.write(cr, uid, [ref('hr_expense_expense_september0')], values, None)
|
||||
-
|
||||
Now I change the related product on expense line.
|
||||
-
|
||||
!python {model: hr.expense.expense}: |
|
||||
exp_line_obj = self.pool.get('hr.expense.line')
|
||||
exp_obj = self.browse(cr, uid, ref('hr_expense_expense_september0'), None)
|
||||
line_ids = [line.id for line in exp_obj.line_ids]
|
||||
res = exp_line_obj.onchange_product_id(cr, uid, line_ids, ref('product_product_expense_air'), False, ref('hr.employee1'), None)
|
||||
values = dict([('product_id', ref('product_product_expense_air'))] + res['value'].items())
|
||||
exp_line_obj.write(cr, uid, line_ids, values, None)
|
||||
-
|
||||
I confirm this expenses by click on "Confirm" button.
|
||||
-
|
||||
!workflow {model: hr.expense.expense, action: confirm, ref: hr_expense_expense_september0}
|
||||
|
||||
-
|
||||
I check that state is "Waiting Confirmation".
|
||||
-
|
||||
!assert {model: hr.expense.expense, id: hr_expense_expense_september0}:
|
||||
- state == 'confirm'
|
||||
-
|
||||
I accept this expense by click on "Accept" button.
|
||||
-
|
||||
!workflow {model: hr.expense.expense, action: validate, ref: hr_expense_expense_september0}
|
||||
|
||||
-
|
||||
I invoiced this expense by click on "Invoice" button.
|
||||
-
|
||||
!python {model: hr.expense.expense}: |
|
||||
self.invoice(cr, uid, [ref('hr_expense_expense_september0')], None)
|
||||
-
|
||||
I check that state is "Invoiced".
|
||||
-
|
||||
!assert {model: hr.expense.expense, id: hr_expense_expense_september0}:
|
||||
- state == 'invoiced'
|
||||
-
|
||||
I check that Invoice is created for the expense.
|
||||
-
|
||||
!python {model: hr.expense.expense}: |
|
||||
exp = self.browse(cr, uid, [ref('hr_expense_expense_september0')])[0]
|
||||
assert exp.invoice_id, "Invoice should be created"
|
||||
|
||||
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 14 KiB |
@@ -81,7 +81,7 @@
|
||||
<field name="name">Bank Current Account</field>
|
||||
<field ref="account.cas" name="parent_id"/>
|
||||
<field name="type">liquidity</field>
|
||||
<field name="user_type" ref="account.account_type_asset"/>
|
||||
<field name="user_type" ref="account.data_account_type_asset"/>
|
||||
</record>
|
||||
|
||||
<record id="a_salary_expense" model="account.account">
|
||||
@@ -89,7 +89,7 @@
|
||||
<field name="name">Salary Expenses</field>
|
||||
<field ref="account.ovr" name="parent_id"/>
|
||||
<field name="type">other</field>
|
||||
<field name="user_type" ref="account.account_type_expense"/>
|
||||
<field name="user_type" ref="account.data_account_type_expense"/>
|
||||
</record>
|
||||
|
||||
<record id="a_creditors" model="account.account">
|
||||
@@ -98,7 +98,7 @@
|
||||
<field ref="account.cli" name="parent_id"/>
|
||||
<field name="type">payable</field>
|
||||
<field eval="True" name="reconcile"/>
|
||||
<field name="user_type" ref="account.account_type_payable"/>
|
||||
<field name="user_type" ref="account.data_account_type_payable"/>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
@@ -184,10 +184,6 @@ class hr_applicant(crm.crm_case, osv.osv):
|
||||
'user_email': fields.related('user_id', 'user_email', type='char', string='User Email', readonly=True),
|
||||
}
|
||||
|
||||
def _get_stage(self, cr, uid, context=None):
|
||||
ids = self.pool.get('hr.recruitment.stage').search(cr, uid, [], context=context)
|
||||
return ids and ids[0] or False
|
||||
|
||||
_defaults = {
|
||||
'active': lambda *a: 1,
|
||||
'user_id': lambda self, cr, uid, context: uid,
|
||||
|
||||
|
After Width: | Height: | Size: 18 KiB |
@@ -19,27 +19,49 @@
|
||||
assert applicant.name == "Application for the post of Jr.application Programmer.", "Subject does not match"
|
||||
assert applicant.state == "draft"
|
||||
assert len(resume_ids), "Resume does not attached."
|
||||
-
|
||||
I refuse applicant for the Recruitment.
|
||||
-
|
||||
!python {model: hr.applicant}: |
|
||||
self.case_close(cr, uid, [ref("hr_case_programmer")])
|
||||
-
|
||||
I open applicant for the Recruitment.
|
||||
-
|
||||
!python {model: hr.applicant}: |
|
||||
self.case_reset(cr, uid, [ref("hr_case_programmer")])
|
||||
self.case_open(cr, uid, [ref("hr_case_programmer")])
|
||||
-
|
||||
I assign the Job position to the applicant
|
||||
-
|
||||
!python {model: hr.applicant}: |
|
||||
self.write(cr, uid, [ref('hr_case_programmer')], {'job_id':ref('hr.job_jr_appli')})
|
||||
-
|
||||
I open applicant for the Recruitment
|
||||
-
|
||||
|
||||
!python {model: hr.applicant}: |
|
||||
self.case_open(cr, uid, [ref("hr_case_programmer")])
|
||||
-
|
||||
I start communication with applicant, first schedule phonecall.
|
||||
-
|
||||
!python {model: hr.recruitment.job2phonecall}: |
|
||||
self.make_phonecall(cr, uid, [ref('hr_case_programmer')])
|
||||
context.update({'active_model': 'hr.applicant', 'active_id': ref("hr_case_programmer"), 'active_ids': [ref("hr_case_programmer")], 'survey_id': ref("survey_job_0")})
|
||||
id = self.create(cr, uid, {}, context=context)
|
||||
self.make_phonecall(cr, uid, [id], context=context)
|
||||
-
|
||||
I schedule meeting with applicant for interview.
|
||||
-
|
||||
!python {model: hr.applicant}: |
|
||||
self.action_makeMeeting(cr, uid, [ref('hr_case_programmer')])
|
||||
-
|
||||
I check Initial Qualification of applicant.
|
||||
-
|
||||
!python {model: hr.applicant}: |
|
||||
self.stage_next(cr, uid, [ref('hr_case_programmer')])
|
||||
-
|
||||
I schedule First Interview of applicant.
|
||||
-
|
||||
!python {model: hr.applicant}: |
|
||||
self.stage_next(cr, uid, [ref('hr_case_programmer')])
|
||||
-
|
||||
On a successful First Interview of applicant, I schedule Second Interview.
|
||||
-
|
||||
!python {model: hr.applicant}: |
|
||||
self.stage_next(cr, uid, [ref('hr_case_programmer')])
|
||||
-
|
||||
Applicant fillup the answer of the interview quetion.
|
||||
-
|
||||
@@ -56,7 +78,13 @@
|
||||
!python {model: hr.applicant}: |
|
||||
self.action_print_survey(cr, uid, [ref('hr_case_programmer')])
|
||||
-
|
||||
On a successful interview with the applicant, I hired employee.
|
||||
On a successful Second Interview of applicant Contract is Proposed to applicant.
|
||||
-
|
||||
!python {model: hr.applicant}: |
|
||||
self.stage_next(cr, uid, [ref('hr_case_programmer')])
|
||||
self.stage_previous(cr, uid, [ref('hr_case_programmer')])
|
||||
-
|
||||
I Hired Applicant.
|
||||
-
|
||||
!python {model: hr.applicant}: |
|
||||
self.case_close_with_emp(cr, uid, [ref('hr_case_programmer')])
|
||||
@@ -65,3 +93,28 @@
|
||||
-
|
||||
!assert {model: hr.applicant, id: hr_case_programmer}:
|
||||
- state == 'done'
|
||||
-
|
||||
I do not give employment to the hired the applicant.
|
||||
-
|
||||
!python {model: hired.employee}: |
|
||||
context.update({'active_model': 'hr.applicant', 'active_ids': [ref("hr_recruitment.hr_case_programmer")], 'active_id': ref("hr_recruitment.hr_case_programmer")})
|
||||
emp_id = self.create(cr, uid, {}, context=context)
|
||||
self.case_close(cr, uid, [emp_id], context=context)
|
||||
-
|
||||
Now I give employment to hired applicant .
|
||||
-
|
||||
!python {model: hr.applicant}: |
|
||||
hired_emp_obj = self.pool.get('hired.employee')
|
||||
self.case_reset(cr, uid, [ref("hr_case_programmer")])
|
||||
self.case_open(cr, uid, [ref("hr_case_programmer")])
|
||||
context.update({'active_model': 'hr.applicant', 'active_ids': [ref("hr_recruitment.hr_case_programmer")], 'active_id': ref("hr_recruitment.hr_case_programmer")})
|
||||
emp_hr_id = hired_emp_obj.create(cr, uid, {}, context=context)
|
||||
hired_emp_obj.case_close_with_emp(cr, uid, [emp_hr_id], context=context)
|
||||
-
|
||||
Now hired employee want to be a partner of company.
|
||||
-
|
||||
!record {model: hr.recruitment.partner.create, id: hr_recruitment_partner_id1 }:
|
||||
-
|
||||
!python {model: hr.recruitment.partner.create}: |
|
||||
context.update({'active_model': 'hr.applicant', 'active_ids': [ref("hr_recruitment.hr_case_programmer")], 'active_id': ref("hr_recruitment.hr_case_programmer")})
|
||||
self.make_order(cr, uid, [ref("hr_recruitment_partner_id1")], context=context)
|
||||
|
||||
|
After Width: | Height: | Size: 21 KiB |
@@ -3,10 +3,12 @@
|
||||
<data>
|
||||
|
||||
<record model="res.groups" id="base.group_tool_user">
|
||||
<field name="name">Tools / User</field>
|
||||
<field name="name">User</field>
|
||||
<field name="category_id" ref="base.module_category_tools"/>
|
||||
</record>
|
||||
<record model="res.groups" id="base.group_tool_manager">
|
||||
<field name="name">Tools / Manager</field>
|
||||
<field name="name">Manager</field>
|
||||
<field name="category_id" ref="base.module_category_tools"/>
|
||||
<field name="implied_ids" eval="[(4, ref('base.group_tool_user'))]"/>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data noupdate="0">
|
||||
<record id="base.group_sale_manager" model="res.groups">
|
||||
<field name="name">Sales / Manager</field>
|
||||
</record>
|
||||
|
||||
<record id="base.group_document_user" model="res.groups">
|
||||
<field name="name">Knowledge / User</field>
|
||||
</record>
|
||||
<record id="base.group_document_user" model="res.groups">
|
||||
<field name="name">User</field>
|
||||
<field name="category_id" ref="base.module_category_knowledge_management"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
|
After Width: | Height: | Size: 18 KiB |
@@ -24,7 +24,7 @@
|
||||
"version" : "1.0",
|
||||
"author" : "conexus.at",
|
||||
"website" : "http://www.conexus.at",
|
||||
"category" : "Localization",
|
||||
"category" : "Localization/Account Charts",
|
||||
"depends" : ["account_chart", 'base_vat'],
|
||||
"description": "This module provides the standard Accounting Chart for Austria which is based on the Template from BMF.gv.at. Please keep in mind that you should review and adapt it with your Accountant, before using it in a live Environment.",
|
||||
"demo_xml" : [],
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
##############################################################################
|
||||
{ 'name': 'Belgium - Accounting',
|
||||
'version': '1.1',
|
||||
'category': 'Localization',
|
||||
'category': 'Localization/Account Charts',
|
||||
'description': """
|
||||
This is the base module to manage the accounting chart for Belgium in OpenERP.
|
||||
==============================================================================
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
{
|
||||
'name': 'Brazilian - Accounting',
|
||||
'category': 'Localization',
|
||||
'category': 'Localization/Account Charts',
|
||||
'description': """
|
||||
Base module for the Brazilian localization
|
||||
==========================================
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
"version" : "1.0",
|
||||
"author" : "Savoir-faire Linux",
|
||||
"website" : "http://www.savoirfairelinux.com",
|
||||
"category" : "Localization",
|
||||
"category" : "Localization/Account Charts",
|
||||
"description": """
|
||||
This is the module to manage the English and French - Canadian accounting chart in OpenERP.
|
||||
===========================================================================================
|
||||
|
||||
@@ -63,7 +63,7 @@ TODO :
|
||||
""",
|
||||
"version" : "6.1",
|
||||
"author" : "Camptocamp",
|
||||
'category': 'Localization',
|
||||
'category': 'Localization/Account Charts',
|
||||
"website": "http://www.camptocamp.com",
|
||||
|
||||
"depends" : [
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
{
|
||||
"name" : "中国会计科目表 - Accounting",
|
||||
"version" : "1.0",
|
||||
"category": "Localization",
|
||||
"category": "Localization/Account Charts",
|
||||
"author" : "openerp-china.org",
|
||||
"maintainer":"openerp-china.org",
|
||||
"website":"http://openerp-china.org",
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
'url': 'http://launchpad.net/openerp-costa-rica',
|
||||
'author': 'ClearCorp S.A.',
|
||||
'website': 'http://clearcorp.co.cr',
|
||||
'category': 'Localization',
|
||||
'category': 'Localization/Account Charts',
|
||||
'description': """
|
||||
Chart of accounts for Costa Rica.
|
||||
=================================
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
"version" : "1.0",
|
||||
"author" : "openbig.org",
|
||||
"website" : "http://www.openbig.org",
|
||||
"category" : "Localization",
|
||||
"category" : "Localization/Account Charts",
|
||||
"description": """
|
||||
Dieses Modul beinhaltet einen deutschen Kontenrahmen basierend auf dem SKR03.
|
||||
==============================================================================
|
||||
|
||||
@@ -8,28 +8,28 @@
|
||||
<field name="close_method">none</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="account.account_type_income" >
|
||||
<record model="account.account.type" id="account.data_account_type_income" >
|
||||
<field name="name">Erfolgskonten - Erlöse</field>
|
||||
<field name="code">income</field>
|
||||
<field name="report_type">income</field>
|
||||
<field name="close_method">none</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="account.account_type_expense">
|
||||
<record model="account.account.type" id="account.data_account_type_expense">
|
||||
<field name="name">Erfolgskonten - Aufwendungen</field>
|
||||
<field name="code">expense</field>
|
||||
<field name="report_type">expense</field>
|
||||
<field name="close_method">none</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="account.account_type_asset">
|
||||
<record model="account.account.type" id="account.data_account_type_asset">
|
||||
<field name="name">Bilanzkonten - Aktiva - Vermögenskonten</field>
|
||||
<field name="code">balance asset</field>
|
||||
<field name="report_type">asset</field>
|
||||
<field name="close_method">balance</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="account.account_type_liability">
|
||||
<record model="account.account.type" id="account.data_account_type_liability">
|
||||
<field name="name">Bilanzkonten - Passiva - Kapitalkonten</field>
|
||||
<field name="code">balance liability</field>
|
||||
<field name="report_type">liability</field>
|
||||
|
||||