diff --git a/addons/account/account.py b/addons/account/account.py
index 208bf1d6f68..3dc5c36c889 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -1162,32 +1162,36 @@ class account_move(osv.osv):
]
def post(self, cr, uid, ids, context=None):
+ if context is None:
+ context = {}
invoice = context.get('invoice', False)
valid_moves = self.validate(cr, uid, ids, context)
- if valid_moves:
- for move in self.browse(cr, uid, valid_moves):
- if move.name =='/':
- new_name = False
- journal = move.journal_id
+
+ if not valid_moves:
+ raise osv.except_osv(_('Integrity Error !'), _('You cannot validate a non-balanced entry !\nMake sure you have configured Payment Term properly !\nIt should contain atleast one Payment Term Line with type "Balance" !'))
+
+ for move in self.browse(cr, uid, valid_moves):
+ if move.name =='/':
+ new_name = False
+ journal = move.journal_id
- if invoice and invoice.internal_number:
- new_name = invoice.internal_number
+ if invoice and invoice.internal_number:
+ new_name = invoice.internal_number
+ else:
+ if journal.sequence_id:
+ c = {'fiscalyear_id': move.period_id.fiscalyear_id.id}
+ new_name = self.pool.get('ir.sequence').get_id(cr, uid, journal.sequence_id.id, context=c)
else:
- if journal.sequence_id:
- c = {'fiscalyear_id': move.period_id.fiscalyear_id.id}
- new_name = self.pool.get('ir.sequence').get_id(cr, uid, journal.sequence_id.id, context=c)
- else:
- raise osv.except_osv(_('Error'), _('No sequence defined in the journal !'))
+ raise osv.except_osv(_('Error'), _('No sequence defined on the journal !'))
- if new_name:
- self.write(cr, uid, [move.id], {'name':new_name})
+ if new_name:
+ self.write(cr, uid, [move.id], {'name':new_name})
- cr.execute('UPDATE account_move '\
- 'SET state=%s '\
- 'WHERE id IN %s',
- ('posted', tuple(valid_moves),))
- else:
- raise osv.except_osv(_('Integrity Error !'), _('You can not validate a non-balanced entry !\nMake sure you have configured Payment Term properly !\nIt should contain atleast one Payment Term Line with type "Balance" !'))
+ cr.execute('UPDATE account_move '\
+ 'SET state=%s '\
+ 'WHERE id IN %s',
+ ('posted', tuple(valid_moves),))
+
return True
def button_validate(self, cursor, user, ids, context=None):
diff --git a/addons/account/invoice.py b/addons/account/invoice.py
index 1aa4e30d95d..777955d5a8e 100644
--- a/addons/account/invoice.py
+++ b/addons/account/invoice.py
@@ -650,18 +650,19 @@ class account_invoice(osv.osv):
return ok
def button_reset_taxes(self, cr, uid, ids, context=None):
- if not context:
+ if context is None:
context = {}
+ ctx = context.copy()
ait_obj = self.pool.get('account.invoice.tax')
for id in ids:
cr.execute("DELETE FROM account_invoice_tax WHERE invoice_id=%s", (id,))
- partner = self.browse(cr, uid, id, context=context).partner_id
+ partner = self.browse(cr, uid, id, context=ctx).partner_id
if partner.lang:
- context.update({'lang': partner.lang})
- for taxe in ait_obj.compute(cr, uid, id, context=context).values():
+ ctx.update({'lang': partner.lang})
+ for taxe in ait_obj.compute(cr, uid, id, context=ctx).values():
ait_obj.create(cr, uid, taxe)
# Update the stored value (fields.function), so we write to trigger recompute
- self.pool.get('account.invoice').write(cr, uid, ids, {'invoice_line':[]}, context=context)
+ self.pool.get('account.invoice').write(cr, uid, ids, {'invoice_line':[]}, context=ctx)
return True
def button_compute(self, cr, uid, ids, context=None, set_total=False):
diff --git a/addons/account/wizard/account_automatic_reconcile.py b/addons/account/wizard/account_automatic_reconcile.py
index efce4bc4da4..f94082445da 100644
--- a/addons/account/wizard/account_automatic_reconcile.py
+++ b/addons/account/wizard/account_automatic_reconcile.py
@@ -200,7 +200,8 @@ class account_automatic_reconcile(osv.osv_memory):
"AND partner_id=%s " \
"AND reconcile_id IS NULL " \
"AND state <> 'draft' " \
- "AND debit > 0",
+ "AND debit > 0 " \
+ "ORDER BY date_maturity",
(account_id, partner_id))
debits = cr.fetchall()
@@ -212,7 +213,8 @@ class account_automatic_reconcile(osv.osv_memory):
"AND partner_id=%s " \
"AND reconcile_id IS NULL " \
"AND state <> 'draft' " \
- "AND credit > 0",
+ "AND credit > 0 " \
+ "ORDER BY date_maturity",
(account_id, partner_id))
credits = cr.fetchall()
diff --git a/addons/association/profile_association.xml b/addons/association/profile_association.xml
index 8460cfa6cc9..d5a5baab946 100644
--- a/addons/association/profile_association.xml
+++ b/addons/association/profile_association.xml
@@ -48,8 +48,9 @@
-
- 3
+
+ 3
+ always
diff --git a/addons/base_report_designer/base_report_designer_installer.xml b/addons/base_report_designer/base_report_designer_installer.xml
index 4ea4970d19a..2c0cf191e4e 100644
--- a/addons/base_report_designer/base_report_designer_installer.xml
+++ b/addons/base_report_designer/base_report_designer_installer.xml
@@ -19,7 +19,7 @@
This plug-in allows you to create/modify OpenERP Reports into OpenOffice Writer.
-
+
@@ -29,10 +29,10 @@
type="object" string="Skip" colspan="1" invisible="context.get('menu',False)"/>
-
- 15
-
-
+
+ 15
+
+
@@ -55,12 +55,11 @@
-
- 3
+
+ 3
+ always
-
-
OpenERP Report Designer
ir.actions.act_window
diff --git a/addons/base_setup/base_setup_installer.xml b/addons/base_setup/base_setup_installer.xml
index 4245f3da206..041feb6d05c 100644
--- a/addons/base_setup/base_setup_installer.xml
+++ b/addons/base_setup/base_setup_installer.xml
@@ -54,6 +54,7 @@
2
+ always
diff --git a/addons/base_setup/base_setup_todo.xml b/addons/base_setup/base_setup_todo.xml
index 8151442855b..56c205b16c9 100644
--- a/addons/base_setup/base_setup_todo.xml
+++ b/addons/base_setup/base_setup_todo.xml
@@ -67,7 +67,7 @@
3
- onskip
+ always
diff --git a/addons/crm/crm_installer_view.xml b/addons/crm/crm_installer_view.xml
index ece3bae31ec..35ff5a0a7cc 100644
--- a/addons/crm/crm_installer_view.xml
+++ b/addons/crm/crm_installer_view.xml
@@ -25,24 +25,24 @@
Configure
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -59,9 +59,10 @@
-
- 3
-
+
+ 3
+ always
+
diff --git a/addons/document_ics/document_ics_config_wizard.xml b/addons/document_ics/document_ics_config_wizard.xml
index d19951deb38..e58f48cad4c 100644
--- a/addons/document_ics/document_ics_config_wizard.xml
+++ b/addons/document_ics/document_ics_config_wizard.xml
@@ -54,6 +54,7 @@
register configuration wizard
diff --git a/addons/hr/hr_installer.xml b/addons/hr/hr_installer.xml
index 0f396e65a8b..5ccbaefa3f5 100644
--- a/addons/hr/hr_installer.xml
+++ b/addons/hr/hr_installer.xml
@@ -52,6 +52,7 @@
3
+ always
diff --git a/addons/hr_attendance/report/timesheet.py b/addons/hr_attendance/report/timesheet.py
index 1465be81bc8..096de11664e 100644
--- a/addons/hr_attendance/report/timesheet.py
+++ b/addons/hr_attendance/report/timesheet.py
@@ -41,8 +41,8 @@ class report_custom(report_rml):
start_date = datetime.strptime(datas['form']['init_date'], '%Y-%m-%d')
end_date = datetime.strptime(datas['form']['end_date'], '%Y-%m-%d')
- first_monday = start_date - relativedelta(days=start_date.day_of_week)
- last_monday = end_date + relativedelta(days=7 - end_date.day_of_week)
+ first_monday = start_date - relativedelta(days=start_date.date().weekday())
+ last_monday = end_date + relativedelta(days=7 - end_date.date().weekday())
if last_monday < first_monday:
first_monday, last_monday = last_monday, first_monday
@@ -82,7 +82,7 @@ class report_custom(report_rml):
for att in attendances:
dt = datetime.strptime(att['name'], '%Y-%m-%d %H:%M:%S')
if att['action'] == 'sign_out':
- week_wh[ldt.day_of_week] = week_wh.get(ldt.day_of_week, 0) + (dt - ldt).hours
+ week_wh[ldt.date().weekday()] = week_wh.get(ldt.date().weekday(), 0) + (dt - ldt).hours
ldt = dt
# Week xml representation
diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
index 55e25e4001c..ce074715888 100644
--- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
+++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
@@ -178,6 +178,21 @@ class hr_timesheet_sheet(osv.osv):
def copy(self, cr, uid, ids, *args, **argv):
raise osv.except_osv(_('Error !'), _('You cannot duplicate a timesheet !'))
+ def create(self, cr, uid, vals, *args, **argv):
+ if 'employee_id' in vals:
+ if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).user_id:
+ raise osv.except_osv(_('Error !'), _('You cannot create a timesheet for an employee that does not have any user defined !'))
+ return super(hr_timesheet_sheet, self).create(cr, uid, vals, *args, **argv)
+
+ def write(self, cr, uid, ids, vals, *args, **argv):
+ if 'employee_id' in vals:
+ new_user_id = self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).user_id.id or False
+ if not new_user_id:
+ raise osv.except_osv(_('Error !'), _('You cannot create a timesheet for an employee that does not have any user defined !'))
+ if not self._sheet_date(cr, uid, ids, forced_user_id=new_user_id):
+ raise osv.except_osv(_('Error !'), _('You can not have 2 timesheets that overlaps !\nPlease use the menu \'My Current Timesheet\' to avoid this problem.'))
+ return super(hr_timesheet_sheet, self).write(cr, uid, ids, vals, *args, **argv)
+
def button_confirm(self, cr, uid, ids, context=None):
if context is None:
context = {}
@@ -262,8 +277,8 @@ class hr_timesheet_sheet(osv.osv):
_columns = {
'name': fields.char('Description', size=64, select=1,
states={'confirm':[('readonly', True)], 'done':[('readonly', True)]}),
- 'user_id': fields.many2one('res.users', 'User', required=True, select=1,
- states={'confirm':[('readonly', True)], 'done':[('readonly', True)]}),
+ 'employee_id': fields.many2one('hr.employee', 'Employee', required=True),
+ 'user_id': fields.related('employee_id', 'user_id', type="many2one", relation="res.users", store=True, string="User", required=False, readonly=True),#fields.many2one('res.users', 'User', required=True, select=1, states={'confirm':[('readonly', True)], 'done':[('readonly', True)]}),
'date_from': fields.date('Date from', required=True, select=1, readonly=True, states={'new':[('readonly', False)]}),
'date_to': fields.date('Date to', required=True, select=1, readonly=True, states={'new':[('readonly', False)]}),
'date_current': fields.date('Current date', required=True),
@@ -320,24 +335,24 @@ class hr_timesheet_sheet(osv.osv):
return time.strftime('%Y-%m-%d')
_defaults = {
- 'user_id': lambda self,cr,uid,c: uid,
'date_from' : _default_date_from,
'date_current' : lambda *a: time.strftime('%Y-%m-%d'),
'date_to' : _default_date_to,
'state': 'new',
- 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'hr_timesheet_sheet.sheet', context=c)
+ 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'hr_timesheet_sheet.sheet', context=c)
}
- def _sheet_date(self, cr, uid, ids):
+ def _sheet_date(self, cr, uid, ids, forced_user_id=False):
for sheet in self.browse(cr, uid, ids):
- cr.execute('SELECT id \
+ new_user_id = forced_user_id or sheet.user_id and sheet.user_id.id
+ if new_user_id:
+ cr.execute('SELECT id \
FROM hr_timesheet_sheet_sheet \
WHERE (date_from < %s and %s < date_to) \
AND user_id=%s \
- AND id <> %s', (sheet.date_to, sheet.date_from,
- sheet.user_id.id, sheet.id))
- if cr.fetchall():
- return False
+ AND id <> %s',(sheet.date_to, sheet.date_from, new_user_id, sheet.id))
+ if cr.fetchall():
+ return False
return True
def _date_current_check(self, cr, uid, ids):
diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet_demo.xml b/addons/hr_timesheet_sheet/hr_timesheet_sheet_demo.xml
index b22a88c5036..dedac8377a7 100644
--- a/addons/hr_timesheet_sheet/hr_timesheet_sheet_demo.xml
+++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet_demo.xml
@@ -4,6 +4,7 @@
Sheet 0
+
diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
index decf3b16b6b..231aba040e7 100644
--- a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
+++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
@@ -1,25 +1,6 @@
-
- hr.timesheet.sheet.tree
- hr_timesheet_sheet.sheet
- tree
-
-
-
-
-
-
-
-
-
-
-
-
-
-
hr.timesheet.sheet.graph
hr_timesheet_sheet.sheet
@@ -71,7 +52,7 @@
-
+
@@ -167,7 +148,7 @@
-
+
-
+
@@ -190,7 +171,7 @@
hr_timesheet_sheet.sheet
form
- {'search_default_my_timesheet':1, 'search_default_user_id':uid }
+ {'search_default_my_timesheet':1, }
Employees can encode their time spent on the different projects. A project is an analytic account and the time spent on a project generate costs on the analytic account.
@@ -312,18 +293,19 @@
src_model="hr_timesheet_sheet.sheet"/>
- hr.timesheet.sheet.tree.simplified
+ hr.timesheet.sheet.tree
hr_timesheet_sheet.sheet
tree
-
+
+
-
-
-
-
+
+
+
+
diff --git a/addons/hr_timesheet_sheet/report/timesheet_report_view.xml b/addons/hr_timesheet_sheet/report/timesheet_report_view.xml
index 08abc6db63b..a015ff933d2 100644
--- a/addons/hr_timesheet_sheet/report/timesheet_report_view.xml
+++ b/addons/hr_timesheet_sheet/report/timesheet_report_view.xml
@@ -34,11 +34,11 @@
+
+
+
-
-
-
diff --git a/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml b/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml
index bb5752d6c9e..808045eb677 100644
--- a/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml
+++ b/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml
@@ -70,6 +70,7 @@
name: Week-22(2010)
state: new
user_id: base.user_root
+ employee_id: 'hr_employee_employee0'
-
Now , at the time of login, I create Attendances and perform "Sign In" action.
-
diff --git a/addons/knowledge/knowledge_installer.xml b/addons/knowledge/knowledge_installer.xml
index 681bf2253d5..1fa6cab9865 100644
--- a/addons/knowledge/knowledge_installer.xml
+++ b/addons/knowledge/knowledge_installer.xml
@@ -53,6 +53,7 @@
3
+ always
diff --git a/addons/marketing/marketing_view.xml b/addons/marketing/marketing_view.xml
index 6cd35f3a533..9edd7689484 100644
--- a/addons/marketing/marketing_view.xml
+++ b/addons/marketing/marketing_view.xml
@@ -50,6 +50,7 @@
3
+ always
diff --git a/addons/mrp/mrp_installer.xml b/addons/mrp/mrp_installer.xml
index d317cf6face..ff0c01f8e18 100644
--- a/addons/mrp/mrp_installer.xml
+++ b/addons/mrp/mrp_installer.xml
@@ -48,6 +48,7 @@
3
+ always
diff --git a/addons/profile_tools/misc_tools_installer.xml b/addons/profile_tools/misc_tools_installer.xml
index bc445e7818f..b59f95ab908 100644
--- a/addons/profile_tools/misc_tools_installer.xml
+++ b/addons/profile_tools/misc_tools_installer.xml
@@ -46,6 +46,7 @@
+ always
3
diff --git a/addons/project/board_project_manager_view.xml b/addons/project/board_project_manager_view.xml
index 12559b0629b..d92592a9f38 100644
--- a/addons/project/board_project_manager_view.xml
+++ b/addons/project/board_project_manager_view.xml
@@ -10,43 +10,12 @@
Board for project managers
-->
+ domain="[('manager', '=', uid)]"
+ id="act_my_project" name="My projects"
+ res_model="project.project" view_mode="tree,form"
+ view_type="form"/>
-
- board.project.manager.form
- board.board
- form
-
-
-
-
-
-
- Project Manager Dashboard
- board.board
- form
- form
- menu
-
-
-
-
-
diff --git a/addons/project/project_installer.xml b/addons/project/project_installer.xml
index 2b46cc0ab5f..32b235e4691 100644
--- a/addons/project/project_installer.xml
+++ b/addons/project/project_installer.xml
@@ -49,8 +49,9 @@
-
- 3
+
+ always
+ 3
diff --git a/addons/project_long_term/project_long_term.py b/addons/project_long_term/project_long_term.py
index 2caf36766b0..0c31c485753 100644
--- a/addons/project_long_term/project_long_term.py
+++ b/addons/project_long_term/project_long_term.py
@@ -92,7 +92,7 @@ class project_phase(osv.osv):
model_data_id = model_data_obj._get_id(cr, uid, 'product', 'uom_hour')
return model_data_obj.read(cr, uid, [model_data_id], ['res_id'])[0]['res_id']
- def _compute(self, cr, uid, ids, context=None):
+ def _compute(self, cr, uid, ids,field_name, arg, context=None):
res = {}
if not ids:
return res
@@ -100,9 +100,7 @@ class project_phase(osv.osv):
tot = 0.0
for task in phase.task_ids:
tot += task.planned_hours
- res[phase.id] = {
- 'total_hours' : tot
- }
+ res[phase.id] = tot
return res
_columns = {
diff --git a/addons/project_long_term/project_long_term_view.xml b/addons/project_long_term/project_long_term_view.xml
index 3412ba7ca08..fa645af4127 100644
--- a/addons/project_long_term/project_long_term_view.xml
+++ b/addons/project_long_term/project_long_term_view.xml
@@ -110,22 +110,23 @@
form
-
+
-
+
Make Invoices
ir.actions.act_window
sale.order.line.make.invoice
@@ -34,4 +34,4 @@
sale.order.line
-
\ No newline at end of file
+
diff --git a/addons/stock/report/report_stock_move.py b/addons/stock/report/report_stock_move.py
index 6907f4ed3d5..92fb4559345 100644
--- a/addons/stock/report/report_stock_move.py
+++ b/addons/stock/report/report_stock_move.py
@@ -43,8 +43,8 @@ class report_stock_move(osv.osv):
'location_id': fields.many2one('stock.location', 'Source Location', readonly=True, select=True, help="Sets a location if you produce at a fixed location. This can be a partner location if you subcontract the manufacturing operations."),
'location_dest_id': fields.many2one('stock.location', 'Dest. Location', readonly=True, select=True, help="Location where the system will stock the finished products."),
'state': fields.selection([('draft', 'Draft'), ('waiting', 'Waiting'), ('confirmed', 'Confirmed'), ('assigned', 'Available'), ('done', 'Done'), ('cancel', 'Cancelled')], 'State', readonly=True, select=True),
- 'product_qty_in':fields.integer('In Qty',readonly=True),
- 'product_qty_out':fields.integer('Out Qty',readonly=True),
+ 'product_qty_in':fields.float('In Qty',readonly=True),
+ 'product_qty_out':fields.float('Out Qty',readonly=True),
'value' : fields.float('Total Value', required=True, digits_compute=dp.get_precision('Sale Price')),
'day_diff2':fields.float('Delay (Days)',readonly=True, digits=(16,2), group_operator="avg"),
'day_diff1':fields.float('Planned (Days)',readonly=True, digits=(16,2), group_operator="avg"),
diff --git a/addons/thunderbird/thunderbird_installer.xml b/addons/thunderbird/thunderbird_installer.xml
index 0c8b431a82f..0059cdfd8ab 100644
--- a/addons/thunderbird/thunderbird_installer.xml
+++ b/addons/thunderbird/thunderbird_installer.xml
@@ -60,8 +60,9 @@
-
- 3
+
+ always
+ 3