[IMP]:Changes in Account and hr_holidays reports
bzr revid: jni@tinyerp.com-20101004084909-anda3v1tymjkh5v1
This commit is contained in:
parent
ad114aa4be
commit
810351b16a
|
@ -14,6 +14,13 @@
|
|||
<field name="name">Test invoice 1</field>
|
||||
<field name="address_contact_id" ref="base.res_partner_address_tang"/>
|
||||
</record>
|
||||
<record id="test_tax_line" model="account.invoice.tax">
|
||||
<field name="name">Test Tax</field>
|
||||
<field name="base">5.00</field>
|
||||
<field name="amount">100.00</field>
|
||||
<field name="account_id" ref="account.ova"/>
|
||||
<field name="invoice_id" ref="test_invoice_1"/>
|
||||
</record>
|
||||
<record id="test_invoice_1_line_1" model="account.invoice.line">
|
||||
<field name="name">Basic computer with Dvorak keyboard and left-handed mouse</field>
|
||||
<field name="invoice_id" ref="test_invoice_1"/>
|
||||
|
@ -27,7 +34,7 @@
|
|||
<field name="price_unit">800</field>
|
||||
<field name="quantity">2</field>
|
||||
<field name="account_id" ref="account.a_sale"/>
|
||||
</record>
|
||||
</record>
|
||||
|
||||
<assert id="test_invoice_1" model="account.invoice" string="The currency unit of Test invoice 1 is EUR">
|
||||
<test expr="currency_id.code">EUR</test>
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
-
|
||||
!record {model: account.tax.code, id: account_tax_code_0}:
|
||||
name : Tax Code Test
|
||||
sign : 1.00
|
||||
sign : 10.00
|
||||
-
|
||||
Print Tax Code entries report
|
||||
-
|
||||
|
@ -40,13 +40,14 @@
|
|||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'account-tax-code-entries.'+format), 'wb+').write(data)
|
||||
|
||||
|
||||
-
|
||||
Print Vat Declaration Report
|
||||
-
|
||||
!python {model: account.tax.code}: |
|
||||
import netsvc, tools, os
|
||||
data_dict = {'model': 'ir.ui.menu', 'form': {'based_on': 'invoices','company_id':ref('base.main_company'),'periods':[]}}
|
||||
(data, format) = netsvc.LocalService('report.account.vat.declaration').create(cr, uid, [ref("account_tax_code_0")], data_dict, {})
|
||||
(data, format) = netsvc.LocalService('report.account.vat.declaration').create(cr, uid, [ref("account_move_0")], data_dict, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'account-vat-declaration.'+format), 'wb+').write(data)
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
-
|
||||
!python {model: account.analytic.account}: |
|
||||
import netsvc, tools, os, time
|
||||
data_dict = {'model': 'account.analytic.account', 'form': {'date1':time.strftime("%Y-01-01"),'date2':time.strftime('%Y-%m-%d'),'id':ref('account.analytic_root'),'context':{}}}
|
||||
data_dict = {'model': 'account.analytic.account', 'form': {'date_from':time.strftime("%Y-01-01"),'date_to':time.strftime('%Y-%m-%d'),'id':ref('account.analytic_root'),'context':{}}}
|
||||
(data, format) = netsvc.LocalService('report.account.analytic.account.budget').create(cr, uid, [ref('account.analytic_root')], data_dict, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'account_budget-analytic_budget_report.'+format), 'wb+').write(data)
|
||||
|
@ -12,7 +12,7 @@
|
|||
-
|
||||
!python {model: account.budget.post}: |
|
||||
import netsvc, tools, os, time
|
||||
data_dict = {'model': 'account.budget.post', 'form': {'date1':time.strftime("%Y-01-01"),'date2':time.strftime('%Y-%m-%d'),'id':ref('account_budget.account_budget_post_sales0'),'context':{}}}
|
||||
data_dict = {'model': 'account.budget.post', 'form': {'date_from':time.strftime("%Y-01-01"),'date_to':time.strftime('%Y-%m-%d'),'id':ref('account_budget.account_budget_post_sales0'),'context':{}}}
|
||||
(data, format) = netsvc.LocalService('report.account.analytic.account.budget').create(cr, uid, [ref('account_budget.account_budget_post_sales0')], data_dict, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'account_budget-budget_report.'+format), 'wb+').write(data)
|
||||
|
@ -24,4 +24,4 @@
|
|||
data_dict = {'model': 'account.budget.post', 'form': {'date_from':time.strftime("%Y-01-01"),'date_to':time.strftime('%Y-%m-%d'),'report':'analytic-full','id':ref('account_budget.crossovered_budget_budgetoptimistic0'),'context':{}}}
|
||||
(data, format) = netsvc.LocalService('report.crossovered.budget.report').create(cr, uid, [ref('account_budget.crossovered_budget_budgetoptimistic0')], data_dict, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'account_budget-crossovered_budget_report.'+format), 'wb+').write(data)
|
||||
file(os.path.join(tools.config['test_report_directory'], 'account_budget-crossovered_budget_report.'+format), 'wb+').write(data)
|
||||
|
|
|
@ -21,14 +21,15 @@
|
|||
__name__ = "Convert the Holidays Per User limits into positive leave request"
|
||||
|
||||
def migrate(cr, version):
|
||||
cr.execute("""SELECT id, employee_id, holiday_status, max_leaves, notes, create_uid
|
||||
FROM hr_holidays_per_user;""")
|
||||
for record in cr.fetchall():
|
||||
cr.execute("""INSERT INTO hr_holidays
|
||||
(employee_id, type, allocation_type, name, holiday_status_id,
|
||||
state, number_of_days, notes, manager_id) VALUES
|
||||
(%s, 'add', 'company', 'imported holiday_per_user', %s,
|
||||
'validated', %s, %s, %s) """, (record[1],record[2],record[3],record[4],record[5]))
|
||||
# cr.execute("""SELECT id, employee_id, holiday_status, max_leaves, notes, create_uid
|
||||
# FROM hr_holidays_per_user;""")
|
||||
# for record in cr.fetchall():
|
||||
# cr.execute("""INSERT INTO hr_holidays
|
||||
# (employee_id, type, allocation_type, name, holiday_status_id,
|
||||
# state, number_of_days, notes, manager_id) VALUES
|
||||
# (%s, 'add', 'company', 'imported holiday_per_user', %s,
|
||||
# 'validated', %s, %s, %s) """, (record[1],record[2],record[3],record[4],record[5]))
|
||||
return {}
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue