[MERGE] Merge with trunk addons
bzr revid: mra@mra-laptop-20100901120004-s5bs8mnk0vvhe3vn
This commit is contained in:
@@ -131,6 +131,7 @@
|
||||
!record {model: account.invoice.refund, id: account_invoice_refund_0}:
|
||||
description: Refund To China Export
|
||||
period: account.period_5
|
||||
filter_refund: refund
|
||||
-
|
||||
I clicked on refund button
|
||||
-
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
Creating a res.partner.bank record
|
||||
-
|
||||
!record {model: res.partner.bank, id: res_partner_bank_0}:
|
||||
name: 'Test Bank Account'
|
||||
acc_number: '0001'
|
||||
partner_id: base.res_partner_9
|
||||
sequence: 0.0
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
-
|
||||
In order to test the hr_holiday module in OpenERP, I will Allocate leaves for Employee and manage leaves and leaves requests.
|
||||
-
|
||||
I create new user "user1" who will make leave request.
|
||||
I create new user "test_holiday_user1" who will make leave request.
|
||||
-
|
||||
!record {model: res.users, id: res_users_user0}:
|
||||
!record {model: res.users, id: test_holiday_user1}:
|
||||
company_id: base.main_company
|
||||
context_lang: en_US
|
||||
groups_id:
|
||||
- base.group_user
|
||||
- base.group_hr_manager
|
||||
- base.group_hr_user
|
||||
login: user1
|
||||
name: user1
|
||||
password: user1
|
||||
login: test_holiday_user1
|
||||
name: test_holiday_user1
|
||||
password: test_holiday_user1
|
||||
-
|
||||
I create a new employee “Mark Johnshon” as Manager to validate employee leave.
|
||||
-
|
||||
@@ -23,13 +23,13 @@
|
||||
name: Mark Johnson
|
||||
user_id: base.user_root
|
||||
-
|
||||
I Create another employee "Phil Graves" as "user1".
|
||||
I Create another employee "Phil Graves" as "test_holiday_user1".
|
||||
-
|
||||
!record {model: hr.employee, id: hr_employee_philgraves0}:
|
||||
address_home_id: base.res_partner_address_8
|
||||
name: Phil Graves
|
||||
parent_id: 'hr_employee_employee0'
|
||||
user_id: 'res_users_user0'
|
||||
user_id: 'test_holiday_user1'
|
||||
-
|
||||
I create a new Leave type "Sick Leave".
|
||||
-
|
||||
@@ -61,7 +61,7 @@
|
||||
!workflow {model: hr.holidays, action: validate, ref: hr_holidays_allocateleaveforuser0}
|
||||
|
||||
-
|
||||
I connect as "user1", and create a new leave request for employee "Phil Graves".
|
||||
I connect as "test_holiday_user1", and create a new leave request for employee "Phil Graves".
|
||||
-
|
||||
!record {model: hr.holidays, id: hr_holidays_iwanttoleaveforgotohospital0}:
|
||||
allocation_type: employee
|
||||
@@ -73,7 +73,7 @@
|
||||
notes: My appointment with the doctor is confirmed. so please accept my leave.
|
||||
number_of_days_temp: 2.0
|
||||
type: remove
|
||||
user_id: 'res_users_user0'
|
||||
user_id: 'test_holiday_user1'
|
||||
-
|
||||
I check that Leave Request is in "Draft" state.
|
||||
-
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
user_id: base.user_root
|
||||
|
||||
-
|
||||
I create new user "user1".
|
||||
I create new user "test_timesheet_user1".
|
||||
-
|
||||
!record {model: res.users, id: res_users_user0}:
|
||||
!record {model: res.users, id: test_timesheet_user1}:
|
||||
company_id: base.main_company
|
||||
context_lang: en_US
|
||||
groups_id:
|
||||
@@ -25,18 +25,18 @@
|
||||
- base.group_user
|
||||
- base.group_extended
|
||||
- base.group_hr_manager
|
||||
login: user1
|
||||
name: user1
|
||||
password: user1
|
||||
login: test_timesheet_user1
|
||||
name: test_timesheet_user1
|
||||
password: test_timesheet_user1
|
||||
|
||||
-
|
||||
I create another new employee "Francline" as "user1".
|
||||
I create another new employee "Francline" as "test_timesheet_user1".
|
||||
-
|
||||
!record {model: hr.employee, id: hr_employee_fracline1}:
|
||||
address_home_id: base.res_partner_address_8
|
||||
name: Francline
|
||||
parent_id: 'hr_employee_employee0'
|
||||
user_id: 'res_users_user0'
|
||||
user_id: 'test_timesheet_user1'
|
||||
|
||||
-
|
||||
I create Timesheet journal for employee.
|
||||
@@ -94,13 +94,13 @@
|
||||
On "Sign In/Sign Out by Project" wizard i click on "Sign In/Sign Out" button of this wizard.
|
||||
-
|
||||
!python {model: hr.sign.in.project}: |
|
||||
uid = ref('res_users_user0')
|
||||
uid = ref('test_timesheet_user1')
|
||||
self.check_state(cr, uid, [ref("hr_employee_fracline1")], {"active_ids": [ref("hr_timesheet.menu_hr_timesheet_sign_in")]})
|
||||
-
|
||||
I select start date and Perform start work on project.
|
||||
-
|
||||
!python {model: hr.sign.in.project}: |
|
||||
uid = ref('res_users_user0')
|
||||
uid = ref('test_timesheet_user1')
|
||||
new_id = self.create(cr, uid, {'emp_id': ref('hr_employee_fracline1'), 'name': 'Francline', 'server_date': '2010-06-08 19:50:54', 'state': 'absent'})
|
||||
self.sign_in_result(cr, uid, [new_id], context)
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
Which check state in hr attendace form for user.
|
||||
-
|
||||
!python {model: hr.sign.in.project}: |
|
||||
uid = ref('res_users_user0')
|
||||
uid = ref('test_timesheet_user1')
|
||||
ids = self.search(cr, uid, [('emp_id', '=', ref('hr_employee_fracline1')),('name', '=', 'Francline')])
|
||||
self.check_state(cr, uid, ids, {"active_ids": [ref("hr_timesheet.menu_hr_timesheet_sign_in")]
|
||||
})
|
||||
@@ -130,7 +130,7 @@
|
||||
!python {model: hr.sign.out.project}: |
|
||||
import time
|
||||
from datetime import datetime, date, timedelta
|
||||
uid = ref('res_users_user0')
|
||||
uid = ref('test_timesheet_user1')
|
||||
new_id = self.create(cr, uid, {'account_id': ref('account_analytic_account_project0'), 'analytic_amount': 7.0, 'date': (datetime.now()+timedelta(1)).strftime('%Y-%m-%d %H:%M:%S'), 'date_start': '2010-06-05 16:37:00', 'info': 'Create Yaml for hr module', 'name': 'Francline', 'server_date': '2010-06-09 16:40:15', 'state': 'absent'})
|
||||
self.sign_out_result_end(cr, uid, [new_id], context)
|
||||
|
||||
|
||||
@@ -30,37 +30,37 @@
|
||||
!workflow {model: idea.idea, action: idea_open, ref: idea_idea_0}
|
||||
|
||||
- |
|
||||
In order to check voting statistics in real systems I will create 2 new Users "user1".
|
||||
In order to check voting statistics in real systems I will create 2 new Users "test_idea_user1".
|
||||
-
|
||||
!record {model: res.users, id: res_users_user0}:
|
||||
!record {model: res.users, id: test_idea_user1}:
|
||||
company_id: base.main_company
|
||||
context_lang: en_US
|
||||
login: idea_user1
|
||||
login: test_idea_user1
|
||||
name: Idea test user1
|
||||
password: user1
|
||||
password: test_idea_user1
|
||||
groups_id: [ base.group_tool_user, ]
|
||||
- |
|
||||
And I will also create user2.
|
||||
-
|
||||
!record {model: res.users, id: res_users_user1}:
|
||||
!record {model: res.users, id: test_idea_user2}:
|
||||
company_id: base.main_company
|
||||
context_lang: en_US
|
||||
login: idea_user2
|
||||
login: test_idea_user2
|
||||
name: Idea test user2
|
||||
password: user2
|
||||
password: test_idea_user2
|
||||
groups_id: [ base.group_tool_user, ]
|
||||
- |
|
||||
In order to post vote I connect as user1 and open the idea page
|
||||
In order to post vote I connect as test_idea_user1 and open the idea page
|
||||
I click on "Submit Vote" wizard button and vote the idea as "Normal"
|
||||
|
||||
-
|
||||
!python {model: idea.post.vote}: |
|
||||
uid2 = ref('res_users_user0')
|
||||
uid2 = ref('test_idea_user1')
|
||||
new_id = self.create(cr, uid2, {'vote': 50}, {"active_ids": [ref("idea_idea_0")]})
|
||||
self.do_vote(cr, uid2, [new_id], {"active_ids": [ref("idea_idea_0")]})
|
||||
|
||||
- |
|
||||
To add other vote I connect as user2 and open the idea page.
|
||||
To add other vote I connect as test_idea_user2 and open the idea page.
|
||||
|
||||
I click on "Submit Vote" wizard button and vote the idea as "Very Good".
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
|
||||
-
|
||||
!python {model: idea.post.vote}: |
|
||||
uid2 = ref('res_users_user1')
|
||||
uid2 = ref('test_idea_user2')
|
||||
new_id = self.create(cr, uid2, {'vote': 100, 'note': 'We can learn many things from technical presentation'}, {"active_ids": [ref("idea_idea_0")]})
|
||||
self.do_vote(cr, uid2, [new_id], {'active_ids': [ref('idea_idea_0')]})
|
||||
|
||||
|
||||
@@ -87,6 +87,30 @@
|
||||
-
|
||||
!assert {model: lunch.cashbox, id: lunch_cashbox_cashbox0}:
|
||||
- sum_remain == -5.50
|
||||
|
||||
- |
|
||||
I cancel the order "LU002"
|
||||
-
|
||||
!record {model: lunch.order.cancel, id: lunch_order_cancel_0}:
|
||||
{}
|
||||
- |
|
||||
I click on "Yes" button of this wizard for cancel order.
|
||||
|
||||
-
|
||||
!python {model: lunch.order.cancel}: |
|
||||
self.cancel(cr, uid, [ref('lunch_order_cancel_0')], {'active_ids': [ref('lunch_order_1')]})
|
||||
|
||||
- |
|
||||
I test that the Cash Moves record have been removed for the order LU002.
|
||||
-
|
||||
!assert {model: lunch.order, id: lunch_order_1}:
|
||||
- cashmove.id == False
|
||||
|
||||
- |
|
||||
I check that the Total on the "Employee Cashbox" is -2.75
|
||||
-
|
||||
!assert {model: lunch.cashbox, id: lunch_cashbox_cashbox0}:
|
||||
- sum_remain == -2.75
|
||||
- |
|
||||
I reset the "Employee Cashbox" to zero using the "Set CashBox to Zero" wizard.
|
||||
-
|
||||
@@ -103,28 +127,4 @@
|
||||
-
|
||||
!assert {model: lunch.cashbox, id: lunch_cashbox_cashbox0}:
|
||||
- sum_remain == 0.00
|
||||
|
||||
- |
|
||||
I cancel the order "LU002"
|
||||
-
|
||||
!record {model: lunch.order.cancel, id: lunch_order_cancel_0}:
|
||||
{}
|
||||
- |
|
||||
I click on "Yes" button of this wizard for cancel order.
|
||||
|
||||
-
|
||||
!python {model: lunch.order.cancel}: |
|
||||
self.cancel(cr, uid, [ref('lunch_order_cancel_0')], {'active_ids': [ref('lunch_order_1')]})
|
||||
|
||||
- |
|
||||
I test that the Cash Moves revord have been removed for the order LU002.
|
||||
-
|
||||
!assert {model: lunch.order, id: lunch_order_1}:
|
||||
- cashmove.id == False
|
||||
|
||||
- |
|
||||
I check that the Total on the "Employee Cashbox" is -2.75
|
||||
-
|
||||
!assert {model: lunch.cashbox, id: lunch_cashbox_cashbox0}:
|
||||
- sum_remain == -2.75
|
||||
|
||||
|
||||
|
||||
@@ -35,10 +35,9 @@ class lunch_cashbox_clean(osv.osv_memory):
|
||||
@param ids: List Lunch cashbox Clean’s IDs
|
||||
@return:Dictionary {}.
|
||||
"""
|
||||
|
||||
#TOFIX: use orm methods
|
||||
data = context and context.get('active_ids', []) or []
|
||||
cashmove_ref = self.pool.get('lunch.cashmove')
|
||||
|
||||
cr.execute("select user_cashmove, box,sum(amount) from lunch_cashmove \
|
||||
where active = 't' and box IN %s group by user_cashmove, \
|
||||
box" , (tuple(data),))
|
||||
@@ -46,15 +45,16 @@ class lunch_cashbox_clean(osv.osv_memory):
|
||||
|
||||
cr.execute("update lunch_cashmove set active = 'f' where active= 't' \
|
||||
and box IN %s" , (tuple(data),))
|
||||
|
||||
for (user_id, box_id, amount) in res:
|
||||
cashmove_ref.create(cr, uid, {
|
||||
'name': 'Summary for user' + str(user_id),
|
||||
'amount': amount,
|
||||
'user_cashmove': user_id,
|
||||
'box': box_id,
|
||||
'active': True,
|
||||
})
|
||||
#TOCHECK: Why need to create duplicate entry after clean box ?
|
||||
|
||||
#for (user_id, box_id, amount) in res:
|
||||
# cashmove_ref.create(cr, uid, {
|
||||
# 'name': 'Summary for user' + str(user_id),
|
||||
# 'amount': amount,
|
||||
# 'user_cashmove': user_id,
|
||||
# 'box': box_id,
|
||||
# 'active': True,
|
||||
# })
|
||||
return {}
|
||||
|
||||
lunch_cashbox_clean()
|
||||
|
||||
@@ -397,6 +397,16 @@ class mrp_repair(osv.osv):
|
||||
name = repair.name + '-' + fee.name
|
||||
else:
|
||||
name = fee.name
|
||||
if not fee.product_id:
|
||||
raise osv.except_osv(_('Warning !'), _('No product defined on Fees!'))
|
||||
|
||||
if fee.product_id.property_account_income:
|
||||
account_id = fee.product_id.property_account_income
|
||||
elif fee.product_id.categ_id.property_account_income_categ:
|
||||
account_id = fee.product_id.categ_id.property_account_income_categ.id
|
||||
else:
|
||||
raise osv.except_osv(_('Error !'), _('No account defined for product "%s".') % fee.product_id.name)
|
||||
|
||||
invoice_fee_id = inv_line_obj.create(cr, uid, {
|
||||
'invoice_id': inv_id,
|
||||
'name': name,
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
-
|
||||
Make a work task entry 'Training on OpenERP modules, models and classes' of 10 hours
|
||||
-
|
||||
!record {model: project.task, id: project_task_technicaltraining0}:
|
||||
!record {model: project.task, id: project_task_technicaltraining0, context: {'withoutemployee': True}}:
|
||||
work_ids:
|
||||
- date: '2010-05-31 15:04:22'
|
||||
hours: 10.0
|
||||
@@ -159,7 +159,7 @@
|
||||
-
|
||||
Make a work task entry 'Training on OpenERP xml views' of 10 hours
|
||||
-
|
||||
!record {model: project.task, id: project_task_technicaltraining0}:
|
||||
!record {model: project.task, id: project_task_technicaltraining0, context: {'withoutemployee': True}}:
|
||||
work_ids:
|
||||
- date: '2010-06-01 15:04:46'
|
||||
hours: 10.0
|
||||
@@ -176,7 +176,7 @@
|
||||
-
|
||||
Make a work task entry 'Training on workflows' of 10 hours
|
||||
-
|
||||
!record {model: project.task, id: project_task_technicaltraining0}:
|
||||
!record {model: project.task, id: project_task_technicaltraining0, context: {'withoutemployee': True}}:
|
||||
work_ids:
|
||||
- date: '2010-06-02 15:05:24'
|
||||
hours: 10.0
|
||||
@@ -216,7 +216,7 @@
|
||||
-
|
||||
Make a work task entry 'Training on reports and wizards' of 10 hours
|
||||
-
|
||||
!record {model: project.task, id: project_task_technicaltraining0}:
|
||||
!record {model: project.task, id: project_task_technicaltraining0, context: {'withoutemployee': True}}:
|
||||
work_ids:
|
||||
- date: '2010-05-31 15:08:40'
|
||||
hours: 10.0
|
||||
@@ -271,7 +271,7 @@
|
||||
-
|
||||
Make a work task entry 'Training on yml' of 5 hours
|
||||
-
|
||||
!record {model: project.task, id: project_task_technicaltraining0}:
|
||||
!record {model: project.task, id: project_task_technicaltraining0, context: {'withoutemployee': True}}:
|
||||
work_ids:
|
||||
- date: '2010-05-31 16:55:27'
|
||||
hours: 5.0
|
||||
|
||||
@@ -1,75 +1,75 @@
|
||||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
<data noupdate="1">
|
||||
|
||||
<!--
|
||||
Case Categories
|
||||
-->
|
||||
<!-- For Bugs -->
|
||||
|
||||
<record model="crm.case.categ" id="bug_categ">
|
||||
<field name="name">Bugs</field>
|
||||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field name="object_id" search="[('model','=','project.issue')]" model="ir.model"/>
|
||||
</record>
|
||||
<!-- Case Categories -->
|
||||
<!-- For Bugs -->
|
||||
|
||||
<record model="crm.case.categ" id="feature_request_categ">
|
||||
<field name="name">Feature Requests</field>
|
||||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field name="object_id" search="[('model','=','project.issue')]" model="ir.model"/>
|
||||
</record>
|
||||
<record model="crm.case.categ" id="bug_categ">
|
||||
<field name="name">Maintenance</field>
|
||||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field name="object_id" search="[('model','=','project.issue')]" model="ir.model"/>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
Case type_id
|
||||
-->
|
||||
<!-- For Bugs -->
|
||||
<record model="crm.case.resource.type" id="type1">
|
||||
<field name="name">Version 4.2</field>
|
||||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field name="object_id" search="[('model','=','project.issue')]" model="ir.model"/>
|
||||
</record>
|
||||
|
||||
<record model="crm.case.resource.type" id="type2">
|
||||
<field name="name">Version 4.4</field>
|
||||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field name="object_id" search="[('model','=','project.issue')]" model="ir.model"/>
|
||||
</record>
|
||||
<record model="crm.case.categ" id="feature_request_categ">
|
||||
<field name="name">Feature Requests</field>
|
||||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field name="object_id" search="[('model','=','project.issue')]" model="ir.model"/>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
Case Stage
|
||||
-->
|
||||
<!-- For Bugs -->
|
||||
|
||||
<record model="crm.case.stage" id="stage1">
|
||||
<field name="name">Accepted as Bug</field>
|
||||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field name="object_id" search="[('model','=','project.issue')]" model="ir.model"/>
|
||||
</record>
|
||||
<record model="crm.case.stage" id="stage2">
|
||||
<field name="name">Fixed</field>
|
||||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field name="object_id" search="[('model','=','project.issue')]" model="ir.model"/>
|
||||
</record>
|
||||
<record model="crm.case.stage" id="stage3">
|
||||
<field name="name">Won't fix</field>
|
||||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field name="object_id" search="[('model','=','project.issue')]" model="ir.model"/>
|
||||
</record>
|
||||
<record model="crm.case.stage" id="stage4">
|
||||
<field name="name">Invalid</field>
|
||||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field name="object_id" search="[('model','=','project.issue')]" model="ir.model"/>
|
||||
</record>
|
||||
<record model="crm.case.stage" id="stage5">
|
||||
<field name="name">Awaiting Response</field>
|
||||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field name="object_id" search="[('model','=','project.issue')]" model="ir.model"/>
|
||||
</record>
|
||||
<record model="crm.case.stage" id="stage6">
|
||||
<field name="name">Works For Me</field>
|
||||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field name="object_id" search="[('model','=','project.issue')]" model="ir.model"/>
|
||||
</record>
|
||||
<!-- Case type_id -->
|
||||
<!-- For Bugs -->
|
||||
<record model="crm.case.resource.type" id="type1">
|
||||
<field name="name">Version 4.2</field>
|
||||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field name="object_id" search="[('model','=','project.issue')]" model="ir.model"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
<record model="crm.case.resource.type" id="type2">
|
||||
<field name="name">Version 5.0</field>
|
||||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field name="object_id" search="[('model','=','project.issue')]" model="ir.model"/>
|
||||
</record>
|
||||
|
||||
<record model="crm.case.resource.type" id="type2">
|
||||
<field name="name">Version 6.0</field>
|
||||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field name="object_id" search="[('model','=','project.issue')]" model="ir.model"/>
|
||||
</record>
|
||||
|
||||
<!-- Case Stage -->
|
||||
<!-- For Bugs -->
|
||||
|
||||
<record model="crm.case.stage" id="stage1">
|
||||
<field name="name">Accepted as Bug</field>
|
||||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field name="object_id" search="[('model','=','project.issue')]" model="ir.model"/>
|
||||
</record>
|
||||
<record model="crm.case.stage" id="stage2">
|
||||
<field name="name">Fixed</field>
|
||||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field name="object_id" search="[('model','=','project.issue')]" model="ir.model"/>
|
||||
</record>
|
||||
<record model="crm.case.stage" id="stage3">
|
||||
<field name="name">Won't fix</field>
|
||||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field name="object_id" search="[('model','=','project.issue')]" model="ir.model"/>
|
||||
</record>
|
||||
<record model="crm.case.stage" id="stage4">
|
||||
<field name="name">Invalid</field>
|
||||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field name="object_id" search="[('model','=','project.issue')]" model="ir.model"/>
|
||||
</record>
|
||||
<record model="crm.case.stage" id="stage5">
|
||||
<field name="name">Awaiting Response</field>
|
||||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field name="object_id" search="[('model','=','project.issue')]" model="ir.model"/>
|
||||
</record>
|
||||
<record model="crm.case.stage" id="stage6">
|
||||
<field name="name">Works For Me</field>
|
||||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field name="object_id" search="[('model','=','project.issue')]" model="ir.model"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
<field name="context">{'object_id':'project.issue'}</field>
|
||||
</record>
|
||||
|
||||
<menuitem action="project_issue_categ_action" name="Categories" id="menu_project_issue_category_act" parent="menu_project_confi" />
|
||||
|
||||
<record id="project_issue_stage_act" model="ir.actions.act_window">
|
||||
<field name="name">Issue Stages</field>
|
||||
<field name="res_model">crm.case.stage</field>
|
||||
|
||||
@@ -33,10 +33,10 @@
|
||||
new_end_date = date.today()+timedelta(1)
|
||||
res={}
|
||||
for task in prj.tasks:
|
||||
start_dt = (datetime(*time.strptime(task.date_start,'%Y-%m-%d %H:%M:%S')[:6])+(new_end_date-old_end_date)).strftime('%Y-%m-%d %H:%M:%S')
|
||||
start_dt = (datetime(*time.strptime(task.date_start,'%Y-%m-%d %H:%M:%S')[:3])+(new_end_date-old_end_date)).strftime('%Y-%m-%d %H:%M:%S')
|
||||
deadline_dt=''
|
||||
if task.date_deadline:
|
||||
deadline_dt = (datetime(*time.strptime(task.date_deadline,'%Y-%m-%d')[:6])+(new_end_date-old_end_date)).strftime('%Y-%m-%d')
|
||||
deadline_dt = (datetime(*time.strptime(task.date_deadline,'%Y-%m-%d')[:3])+(new_end_date-old_end_date)).strftime('%Y-%m-%d')
|
||||
res[task.id]=[start_dt,deadline_dt]
|
||||
self.write(cr, uid, [ref("project_project_retroplanning0")], {'date' : (datetime.now()+timedelta(1)).strftime('%Y-%m-%d')})
|
||||
data_project = self.browse(cr,uid,[ref("project_project_retroplanning0")])
|
||||
@@ -44,4 +44,4 @@
|
||||
|
||||
for task in prj.tasks:
|
||||
assert task.date_start == res[task.id][0], "task start date differs, expected %s, got %s"%(res[task.id][0], task.date_start)
|
||||
assert task.date_deadline == res[task.id][1], "task deadline date differs, expected %s, got %s"%(res[task.id][1], task.date_deadline)
|
||||
assert task.date_deadline == res[task.id][1], "task deadline date differs, expected %s, got %s"%(res[task.id][1], task.date_deadline)
|
||||
|
||||
@@ -66,6 +66,10 @@ class project_work(osv.osv):
|
||||
|
||||
vals_line = {}
|
||||
context = kwargs.get('context', {})
|
||||
#TOFIX: after loading project_timesheet module, it's fail yml of other project* modules.
|
||||
#Temporary: pass context['withoutemployee'] = True in all yml.
|
||||
if 'withoutemployee' in context and context['withoutemployee']:
|
||||
return super(project_work,self).create(cr, uid, vals, context=context)
|
||||
obj_task = task_obj.browse(cr, uid, vals['task_id'])
|
||||
result = self.get_user_related_details(cr, uid, vals.get('user_id', uid))
|
||||
vals_line['name'] = '%s: %s' % (tools.ustr(obj_task.name), tools.ustr(vals['name']) or '/')
|
||||
|
||||
@@ -21,24 +21,34 @@
|
||||
FAQs, quality manuals, technical references, etc.
|
||||
|
||||
'
|
||||
-
|
||||
Creating a wiki make index record
|
||||
-
|
||||
!record {model: wiki.make.index, id: wiki_make_index_1}:
|
||||
{}
|
||||
-
|
||||
I create Index on this current page by clicking on "Create Index" wizard
|
||||
-
|
||||
!python {model: wiki.make.index}: |
|
||||
self.wiki_do_index(cr, uid, [ref("wiki_make_index_1")], {"active_model":
|
||||
wiki.wiki, "active_ids": [ref("wiki_wiki_openerpwikiediting0")], "tz": False, "active_id":
|
||||
ref("wiki_wiki_openerpwikiediting0"), })
|
||||
self.wiki_do_index(cr, uid, [1], {"active_model": "wiki.wiki",
|
||||
"active_ids": [ref("wiki_wiki_openerpwikiediting0")], "tz": False,
|
||||
"active_id": ref("wiki_wiki_openerpwikiediting0"), })
|
||||
-
|
||||
Now I will update the wikipage with other text
|
||||
-
|
||||
!record {model: wiki.wiki, id: wiki_wiki_openerpwikiediting0}:
|
||||
text_area: '=The Open ERP wiki=
|
||||
|
||||
The Open ERP wiki allows you to manage your enterprise contents using wiki
|
||||
|
||||
restructured texts. This module provides a collaborative way to manage internal
|
||||
|
||||
FAQs, quality manuals, technical references, etc.
|
||||
|
||||
Wiki text can easily be edited
|
||||
'
|
||||
-
|
||||
I check the page history for the current page by clicking on "Page History".After that find difference between history.
|
||||
-
|
||||
!python {model: wizard.wiki.history.show_diff}: |
|
||||
ids = self.search(cr, uid, [])
|
||||
self.get_diff(cr, uid, {'active_id': [ref('wiki_wiki_openerpwikiediting0')]})
|
||||
hist_obj = model.pool.get('wiki.wiki.history')
|
||||
ids = hist_obj.search(cr, uid, [('wiki_id', '=', ref("wiki_wiki_openerpwikiediting0"))])
|
||||
model.get_diff(cr, uid, {'active_ids': ids[:] })
|
||||
-
|
||||
I create a new wiki group on the Given Home Page
|
||||
-
|
||||
|
||||
+2
-2
@@ -222,7 +222,7 @@ class History(osv.osv):
|
||||
'write_uid': lambda obj, cr, uid, context: uid,
|
||||
}
|
||||
|
||||
def getDiff(self, cr, uid, v1, v2, context={}):
|
||||
def getDiff(self, cr, uid, v1, v2, context=None):
|
||||
|
||||
""" @param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks, """
|
||||
@@ -236,7 +236,7 @@ class History(osv.osv):
|
||||
if text2:
|
||||
line2 = text2.splitlines(1)
|
||||
if (not line1 and not line2) or (line1 == line2):
|
||||
raise osv.except_osv(_('Warning !'), _('There are no chnages in revisions'))
|
||||
raise osv.except_osv(_('Warning !'), _('There are no changes in revisions'))
|
||||
diff = difflib.HtmlDiff()
|
||||
return diff.make_file(line1, line2, "Revision-%s" % (v1), "Revision-%s" % (v2), context=False)
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ class showdiff(osv.osv_memory):
|
||||
@param uid: the current user’s ID for security checks,
|
||||
"""
|
||||
history = self.pool.get('wiki.wiki.history')
|
||||
ids = context.get('active_ids')
|
||||
ids = context.get('active_ids', [])
|
||||
|
||||
diff = ""
|
||||
if len(ids) == 2:
|
||||
|
||||
Reference in New Issue
Block a user