[FIX]: fix a problem of period_id, default value comes is str it should be in int,

need improve @ client after that this code does not required

bzr revid: mga@tinyerp.com-20100813100843-7hn9arrkyx0cdmct
This commit is contained in:
Mantavya Gajjar 2010-08-13 15:38:43 +05:30
parent b1c4e52abc
commit 308981d14e
2 changed files with 12 additions and 7 deletions

View File

@ -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

View File

@ -273,9 +273,6 @@
<field colspan="4" name="name" select="1"/>
<field name="field" select="1"/>
<field name="sequence"/>
<!-- <newline/>-->
<!-- <field name="readonly"/>-->
<!-- <field name="required"/>-->
</form>
</field>
</record>
@ -287,8 +284,6 @@
<tree string="Journal Column">
<field name="sequence"/>
<field name="name"/>
<!-- <field name="required"/>-->
<!-- <field name="readonly"/>-->
</tree>
</field>
</record>