[MERGE]: Merge with trunk addons

bzr revid: rpa@tinyerp.com-20100310050350-k6ftq0r76tkn3bgn
This commit is contained in:
rpa (Open ERP)
2010-03-10 10:33:50 +05:30
9 changed files with 89 additions and 34 deletions
+2
View File
@@ -38,6 +38,7 @@
'website': 'http://www.openerp.com',
'init_xml': [],
'update_xml': [
#'test/test_parent_structure.yml',
'security/account_security.xml',
'security/ir.model.access.csv',
'account_menuitem.xml',
@@ -62,6 +63,7 @@
'account_installer.xml',
],
'demo_xml': [
#'demo/price_accuracy00.yml',
'account_demo.xml',
'project/project_demo.xml',
'project/analytic_account_demo.xml',
+1 -1
View File
@@ -25,7 +25,7 @@ write({'state':'proforma'})</field>
</record>
<record id="act_proforma2" model="workflow.activity">
<field name="wkf_id" ref="account.wkf"/>
<field name="wkf_id" ref="wkf"/>
<field name="name">proforma2</field>
<field name="action">write({'state':'proforma2'})</field>
<field name="kind">function</field>
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="True">
<data noupdate="1">
<!--
@@ -49,7 +49,7 @@
-
# This is not working, find a way to do that in YAML, *qty is not
# interpreted because it's not a node.
And this account entry must have a credit equals to 163.70€ which is
And this account entry must have a credit equals to 163.97€ which is
equal to *qty x *price x (1 + *tax)
-
!assert {model: account.invoice, id: invoice1}:
@@ -76,17 +76,21 @@
-
!python {model: account.invoice}: |
self.action_move_create(cr, uid, [ref("invoice2")])
-
!python {model: account.invoice}: |
invoice = self.browse(cr, uid, ref("invoice2"))
log(sum(x.credit for x in invoice.move_id.line_id))
assert (sum(x.credit for x in invoice.move_id.line_id) - 163.968) < 0.000001, "Pas bon !!!"
-
!assert {model: account.invoice, id: invoice2}:
test:
- abs(sum(x.credit for x in move_id.line_id) - 163.968) < 0.000001
-
Then this account entry must have a credit equals to the debit
-
!assert {model: account.invoice, id: invoice2}:
test:
- abs(sum(x.credit - x.debit for x in move_id.line_id)) < 0.000001
-
And this account entry must have a credit equals to 163.968€ which is
equal to *qty x *price x (1 + *tax)
-
!python {model: account.invoice}: |
xid = "invoice2"
invoice = self.browse(cr, uid, ref(xid))
sum_of_credits = sum(x.credit for x in invoice.move_id.line_id)
log("The sum of credits for %s is %f", xid, sum_of_credits)
expected_value = 163.968
assert (sum_of_credits - expected_value) < 0.000001, "Wrong sum of credits: %f <> %f" % (sum_of_credits, expected_value)
@@ -0,0 +1,20 @@
-
We retrieve all accounts and test they are in a tree data structure.
-
!python {model: account.account}: |
ids = self.search(cr, uid, [])
accounts_list = self.read(cr, uid, ids, ['parent_id','parent_left','parent_right'])
accounts = dict((x['id'], x) for x in accounts_list)
log("Testing parent structure for %d accounts", len(accounts_list))
for a in accounts_list:
if a['parent_id']:
assert a['parent_left'] > accounts[a['parent_id'][0]]['parent_left']
assert a['parent_right'] < accounts[a['parent_id'][0]]['parent_right']
assert a['parent_left'] < a['parent_right']
for a2 in accounts_list:
assert not ((a2['parent_right'] > a['parent_left']) and
(a2['parent_left'] < a['parent_left']) and
(a2['parent_right'] < a['parent_right']))
if a2['parent_id']==a['id']:
assert (a2['parent_left'] > a['parent_left']) and (a2['parent_right'] < a['parent_right'])
+6 -1
View File
@@ -106,9 +106,14 @@
<field name="job_id" widget="selection"/>
<field name="department_id" widget="selection"/>
<field name="parent_id">
<filter icon="terp-partner" domain="[('parent_id','child_of',uid)]" help="Employees under me"/>
<filter icon="terp-partner" domain="[('parent_id','child_of',uid),('id', '!=', uid)]" help="Employees under me"/>
</field>
</group>
<newline />
<group expand="1" string="Group By..." colspan="11" col="11">
<filter string="Manager" icon="terp-sale" domain="[]" context="{'group_by':'parent_id'}"/>
</group>
</search>
</field>
</record>
@@ -42,11 +42,27 @@
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_hr_attendance_filter">
<field name="name">view_hr_attendance_filter</field>
<field name="model">hr.attendance</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Hr Attendance Search">
<field name="employee_id" select="1" />
<field name="name" select="1" />
<field name="action" select="1" />
<field name="action_desc" select="1" />
</search>
</field>
</record>
<record id="open_view_attendance" model="ir.actions.act_window">
<field name="name">Attendances</field>
<field name="res_model">hr.attendance</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_hr_attendance_filter" />
</record>
<!--<menuitem id="menu_hr_attendance" name="Attendances" parent="hr.menu_hr_root"
+5 -1
View File
@@ -155,7 +155,11 @@ class wiz_si_so(wizard.interface):
states = {
'init' : {
'actions' : [_get_empid],
'result' : {'type' : 'form', 'arch' : si_so_form, 'fields' : si_so_fields, 'state' : [('end', 'Cancel'),('si_test', 'Sign in'),('so_test', 'Sign out')] }
'result' : {'type' : 'form', 'arch' : si_so_form, 'fields' : si_so_fields,
'state' : [('end', 'Cancel', 'gtk-cancel'),
('si_test', 'Sign in', 'gtk-go-back'),
('so_test', 'Sign out', 'gtk-go-forward')]
}
},
'si_test' : {
'actions' : [],
@@ -1,25 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="hr_timesheet_sheet_tree" model="ir.ui.view">
<field name="name">hr.timesheet.sheet.tree</field>
<field name="model">hr_timesheet_sheet.sheet</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Timesheets">
<field name="user_id"/>
<field name="department_id"/>
<field name="date_from"/>
<field name="date_to"/>
<field name="name"/>
<field name="total_attendance" groups="hr_attendance.group_hr_attendance"/>
<field name="total_timesheet"/>
<field name="total_difference" groups="hr_attendance.group_hr_attendance"/>
<field name="state"/>
</tree>
</field>
</record>
<!-- Editable current timesheet used in dashboard-->
<record id="hr_timesheet_sheet_tree" model="ir.ui.view">
<field name="name">hr.timesheet.sheet.tree</field>
@@ -273,7 +254,7 @@
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_form"/>
<field name="arch" type="xml">
<field name="date" position="after">
<field name="sheet_id" select="2"/>
<field name="sheet_id" />
</field>
</field>
</record>
@@ -281,6 +262,18 @@
hr.attendance inheritancy
-->
<record model="ir.ui.view" id="view_hr_attendance_filter">
<field name="name">view_hr_attendance_filter</field>
<field name="model">hr.attendance</field>
<field name="type">search</field>
<field name="inherit_id" ref="hr_attendance.view_hr_attendance_filter" />
<field name="arch" type="xml">
<field name="action_desc" position="after">
<field name="sheet_id" select="1" />
</field>
</field>
</record>
<record id="view_attendance_form" model="ir.ui.view">
<field name="name">hr.attendance.form</field>
<field name="model">hr.attendance</field>
@@ -303,6 +296,17 @@
</field>
</field>
</record>
<record id="view_attendance_tree_who" model="ir.ui.view">
<field name="name">hr.attendance.tree</field>
<field name="model">hr.attendance</field>
<field name="type">tree</field>
<field name="inherit_id" ref="hr_attendance.view_attendance_who"/>
<field name="arch" type="xml">
<field name="action_desc" position="after">
<field name="sheet_id"/>
</field>
</field>
</record>
<act_window domain="[('sheet_id', '=', active_id)]" id="act_hr_timesheet_sheet_sheet_by_day" name="Timesheet by Account" res_model="hr_timesheet_sheet.sheet.account" src_model="hr_timesheet_sheet.sheet"/>
<!-- <act_window domain="[('sheet_id', '=', active_id)]" id="act_hr_timesheet_sheet_sheet_by_account" name="Timesheet by Day" res_model="hr_timesheet_sheet.sheet.day" src_model="hr_timesheet_sheet.sheet"/> -->