diff --git a/addons/account/invoice.py b/addons/account/invoice.py
index ab9b90d7361..dbac0fdd745 100644
--- a/addons/account/invoice.py
+++ b/addons/account/invoice.py
@@ -830,7 +830,7 @@ class account_invoice(osv.osv):
total_fixed += line.value_amount
if line.value == 'procent':
total_percent += line.value_amount
- total_fixed = (total_fixed * 100) / inv.amount_total
+ total_fixed = (total_fixed * 100) / (inv.amount_total or 1.0)
if (total_fixed + total_percent) > 100:
raise osv.except_osv(_('Error !'), _("Cannot create the invoice !\nThe payment term defined gives a computed amount greater than the total invoiced amount."))
diff --git a/addons/account/wizard/account_fiscalyear_close.py b/addons/account/wizard/account_fiscalyear_close.py
index 2f793b77d67..4ab6201b507 100644
--- a/addons/account/wizard/account_fiscalyear_close.py
+++ b/addons/account/wizard/account_fiscalyear_close.py
@@ -79,9 +79,9 @@ class account_fiscalyear_close(osv.osv_memory):
if not new_journal.default_credit_account_id or not new_journal.default_debit_account_id:
raise osv.except_osv(_('UserError'),
_('The journal must have default credit and debit account'))
- if not new_journal.centralisation:
+ if (not new_journal.centralisation) or new_journal.entry_posted:
raise osv.except_osv(_('UserError'),
- _('The journal must have centralised counterpart'))
+ _('The journal must have centralised counterpart without the Skipping draft state option checked!'))
move_ids = obj_acc_move_line.search(cr, uid, [
('journal_id', '=', new_journal.id), ('period_id.fiscalyear_id', '=', new_fyear.id)])
diff --git a/addons/account/wizard/account_validate_move_view.xml b/addons/account/wizard/account_validate_move_view.xml
index 352d23d6b53..d4184dd9c8b 100644
--- a/addons/account/wizard/account_validate_move_view.xml
+++ b/addons/account/wizard/account_validate_move_view.xml
@@ -10,7 +10,7 @@
diff --git a/addons/hr_evaluation/hr_evaluation.py b/addons/hr_evaluation/hr_evaluation.py
index 3c5a150691e..4d8ef9d440f 100644
--- a/addons/hr_evaluation/hr_evaluation.py
+++ b/addons/hr_evaluation/hr_evaluation.py
@@ -124,7 +124,7 @@ class hr_employee(osv.osv):
flag = False
evaluation_plan = evaluation_plan_obj.browse(cr, uid, [evaluation_plan_id], context=context)[0]
if not evaluation_date:
- evaluation_date=(parser.parse(datetime.date.today().strftime('%Y-%m-%d'))+ relativedelta(months=+evaluation_plan.month_first)).strftime('%Y-%m-%d')
+ evaluation_date=(parser.parse(datetime.now().strftime('%Y-%m-%d'))+ relativedelta(months=+evaluation_plan.month_first)).strftime('%Y-%m-%d')
flag = True
else:
if (parser.parse(evaluation_date) + relativedelta(months = int(evaluation_plan.month_next))).strftime('%Y-%m-%d') <= time.strftime("%Y-%m-%d"):
diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
index b152e0112eb..6411bae7bc0 100644
--- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
+++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
@@ -319,7 +319,7 @@ class hr_timesheet_sheet(osv.osv):
if r=='month':
return time.strftime('%Y-%m-01')
elif r=='week':
- return (datetime.today() + relativedelta(weekday=0)).strftime('%Y-%m-%d')
+ return (datetime.today() + relativedelta(weekday=0, weeks=-1)).strftime('%Y-%m-%d')
elif r=='year':
return time.strftime('%Y-01-01')
return time.strftime('%Y-%m-%d')
diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet_demo.xml b/addons/hr_timesheet_sheet/hr_timesheet_sheet_demo.xml
index dedac8377a7..a4b4b434da6 100644
--- a/addons/hr_timesheet_sheet/hr_timesheet_sheet_demo.xml
+++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet_demo.xml
@@ -10,11 +10,12 @@
-
+
diff --git a/addons/purchase_requisition/wizard/purchase_requisition_partner.py b/addons/purchase_requisition/wizard/purchase_requisition_partner.py
index 2ae3ae795e9..ad2478cb7a5 100644
--- a/addons/purchase_requisition/wizard/purchase_requisition_partner.py
+++ b/addons/purchase_requisition/wizard/purchase_requisition_partner.py
@@ -86,21 +86,26 @@ class purchase_requisition_partner(osv.osv_memory):
uom_id = line.product_id.uom_po_id and line.product_id.uom_po_id.id or False
newdate = datetime.strptime(tender.date_start, '%Y-%m-%d %H:%M:%S')
newdate = newdate - relativedelta(days=company.po_lead)
- delay = partner_rec and partner_rec.delay or False
- newdate = newdate -(delay or datetime.strptime(tender.date_start, '%Y-%m-%d %H:%M:%S') )
+ delay = partner_rec and partner_rec.delay or 0.0
+ newdate = newdate -(delay and relativedelta(days=delay) or datetime.strptime(tender.date_start, '%Y-%m-%d %H:%M:%S') )
partner = partner_rec and partner_rec.name or supplier_data
pricelist_id = partner.property_product_pricelist_purchase and partner.property_product_pricelist_purchase.id or False
price = pricelist_obj.price_get(cr, uid, [pricelist_id], line.product_id.id, line.product_qty, False, {'uom': uom_id})[pricelist_id]
product = prod_obj.browse(cr, uid, line.product_id.id, context=context)
location_id = self.pool.get('stock.warehouse').read(cr, uid, [tender.warehouse_id.id], ['lot_input_id'])[0]['lot_input_id'][0]
+ if not newdate:
+ date_planned = datetime.strptime(tender.date_start, '%Y-%m-%d %H:%M:%S')
+ else:
+ date_planned = newdate.strftime('%Y-%m-%d %H:%M:%S')
+
purchase_order_line= {
'name': product.partner_ref,
'product_qty': line.product_qty,
'product_id': line.product_id.id,
'product_uom': uom_id,
'price_unit': price,
- 'date_planned': newdate.strftime('%Y-%m-%d %H:%M:%S'),
+ 'date_planned': date_planned,
'notes': product.description_purchase,
}
taxes_ids = line.product_id.product_tmpl_id.supplier_taxes_id