[MERGE] Merged trunk.

bzr revid: jra@tinyerp.com-20120917131238-wrfdaw9zzivp294k
This commit is contained in:
Jiten (OpenERP)
2012-09-17 18:42:38 +05:30
5 changed files with 28 additions and 17 deletions
@@ -92,14 +92,14 @@ class account_move_journal(osv.osv_memory):
journal = False
if journal_id:
journal = journal_pool.read(cr, uid, [journal_id], ['name'])[0]['name']
journal = journal_pool.read(cr, uid, journal_id, ['name'], context=context).name
journal_string = _("Journal: %s") % tools.ustr(journal)
else:
journal_string = _("Journal: All")
period = False
if period_id:
period = period_pool.browse(cr, uid, [period_id], ['name'])[0]['name']
period = period_pool.browse(cr, uid, period_id, context=context).name
period_string = _("Period: %s") % tools.ustr(period)
open_string = _("Open")
+9 -2
View File
@@ -64,11 +64,13 @@ class ir_model_fields_anonymization(osv.osv):
state = 'anonymized' # all fields are anonymized
else:
state = 'unstable' # fields are mixed: this should be fixed
return state
def _check_write(self, cr, uid, context=None):
# check that the field is created from the menu and not from an database update
# otherwise the database update can crash:
if context.get('manual'):
global_state = self._get_global_state(cr, uid, context=context)
if global_state == 'anonymized':
@@ -100,12 +102,16 @@ class ir_model_fields_anonymization(osv.osv):
# check field state: all should be clear before we can add a new field to anonymize:
self._check_write(cr, uid, context=context)
global_state = self._get_global_state(cr, uid, context=context)
if 'field_name' in vals and vals['field_name'] and 'model_name' in vals and vals['model_name']:
vals['model_id'], vals['field_id'] = self._get_model_and_field_ids(cr, uid, vals, context=context)
# check not existing fields:
if not vals.get('field_id'):
vals['state'] = 'not_existing'
else:
vals['state'] = global_state
res = super(ir_model_fields_anonymization, self).create(cr, uid, vals, context=context)
@@ -340,8 +346,9 @@ class ir_model_fields_anonymize_wizard(osv.osv_memory):
# remove the placeholer:
eview.remove(placeholder)
else:
# unstable ?
raise
msg = "The database anonymization is currently in an unstable state. Some fields are anonymized," + \
" while some fields are not anonymized. You should try to solve this problem before trying to do anything else."
raise osv.except_osv('Error !', msg)
res['arch'] = etree.tostring(eview)
+1 -1
View File
@@ -55,7 +55,7 @@ class hr_attendance(osv.osv):
'name': fields.datetime('Date', required=True, select=1),
'action': fields.selection([('sign_in', 'Sign In'), ('sign_out', 'Sign Out'), ('action','Action')], 'Action', required=True),
'action_desc': fields.many2one("hr.action.reason", "Action Reason", domain="[('action_type', '=', action)]", help='Specifies the reason for Signing In/Signing Out in case of extra hours.'),
'employee_id': fields.many2one('hr.employee', "Employee's Name", required=True, select=True),
'employee_id': fields.many2one('hr.employee', "Employee", required=True, select=True),
'day': fields.function(_day_compute, type='char', string='Day', store=True, select=1, size=32),
}
_defaults = {
@@ -13,7 +13,7 @@
product_id: product.product_product_consultant
journal_id: hr_timesheet.analytic_journal
-
I create my current timesheet for employee "Quentin Paolinon".
I create a timesheet for employee "Quentin Paolinon".
-
!record {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet_sheet_deddk0}:
date_current: !eval time.strftime('%Y-%m-%d')
@@ -23,13 +23,17 @@
user_id: base.user_demo
employee_id: 'hr.employee_qdp'
-
Now, at the time of login, I create Attendances and perform "Sign In" action.
Quentin "Sign In" at around 9am.
-
!python {model: hr_timesheet_sheet.sheet}: |
self.attendance_action_change(cr, uid, [ref('hr_timesheet_sheet_sheet_deddk0')], {})
task_work = self.search(cr, uid, [("name","=","Quentin Paolinon")],context)[0]
task_ids = self.browse(cr, uid, task_work, context)
assert task_ids.state == "draft", "I State In Timesheet"
!record {model: hr.attendance, id: hr_attendance_1}:
action: sign_in
employee_id: 'hr.employee_qdp'
name: !eval datetime.now().strftime('%Y-%m-%d 09:%M:%S')
-
I test that Quentin in signed in
-
!assert {model: hr.employee, id: hr.employee_qdp}:
- state == 'present'
-
I want to check attendance and work of yesterday. I click on <- button.
-
@@ -57,10 +61,10 @@
-
At the time of logout, I create attendance and perform "Sign Out".
-
!record {model: hr.attendance, id: hr_attendance_1}:
!record {model: hr.attendance, id: hr_attendance_2}:
action: sign_out
employee_id: 'hr.employee_qdp'
name: !eval (datetime.now() + timedelta(minutes=1)).strftime('%Y-%m-%d %H:%M:%S')
name: !eval datetime.now().strftime('%Y-%m-%d 17:30:00')
-
I create Timesheet Entry for time spend on today work.
-
@@ -103,10 +107,10 @@
general_account_id: account.a_expense
journal_id: hr_timesheet.analytic_journal
-
I set an allowed difference of 25 hours
I set an allowed difference of 1 hour
-
!record {model: res.company, id: base.main_company}:
timesheet_max_difference: 25.00
timesheet_max_difference: 1.00
-
I tried again to confirm the timesheet after modification.
-
+1 -1
View File
@@ -27,7 +27,7 @@ This is the base module to manage the accounting chart for Ecuador in OpenERP.
Accounting chart and localization for Ecuador.
""",
'author': 'OpenERP SA',
'author': 'Gnuthink Co.Ltd.',
'depends': [
'account',
'base_vat',