diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py
index d122da7d19e..e575fbd3f78 100644
--- a/addons/account/account_move_line.py
+++ b/addons/account/account_move_line.py
@@ -145,6 +145,18 @@ class account_move_line(osv.osv):
return data
def _default_get(self, cr, uid, fields, context={}):
+
+ period_obj = self.pool.get('account.period')
+
+ #check if the period_id changed in the context from client side
+ if context.get('period_id', False):
+ period_id = context.get('period_id')
+ if type(period_id) == str:
+ ids = period_obj.search(cr, uid, [('name','ilike',period_id)])
+ context.update({
+ 'period_id':ids[0]
+ })
+
# Compute simple values
data = super(account_move_line, self).default_get(cr, uid, fields, context)
# Starts: Manual entry from account.move form
@@ -185,8 +197,6 @@ class account_move_line(osv.osv):
if not 'move_id' in fields: #we are not in manual entry
return data
- period_obj = self.pool.get('account.period')
-
# Compute the current move
move_id = False
partner_id = False
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 08d042f4b59..d4c294c76a0 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -273,9 +273,6 @@
-
-
-
@@ -287,8 +284,6 @@
-
-