[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:
parent
b1c4e52abc
commit
308981d14e
|
@ -145,6 +145,18 @@ class account_move_line(osv.osv):
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def _default_get(self, cr, uid, fields, context={}):
|
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
|
# Compute simple values
|
||||||
data = super(account_move_line, self).default_get(cr, uid, fields, context)
|
data = super(account_move_line, self).default_get(cr, uid, fields, context)
|
||||||
# Starts: Manual entry from account.move form
|
# 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
|
if not 'move_id' in fields: #we are not in manual entry
|
||||||
return data
|
return data
|
||||||
|
|
||||||
period_obj = self.pool.get('account.period')
|
|
||||||
|
|
||||||
# Compute the current move
|
# Compute the current move
|
||||||
move_id = False
|
move_id = False
|
||||||
partner_id = False
|
partner_id = False
|
||||||
|
|
|
@ -273,9 +273,6 @@
|
||||||
<field colspan="4" name="name" select="1"/>
|
<field colspan="4" name="name" select="1"/>
|
||||||
<field name="field" select="1"/>
|
<field name="field" select="1"/>
|
||||||
<field name="sequence"/>
|
<field name="sequence"/>
|
||||||
<!-- <newline/>-->
|
|
||||||
<!-- <field name="readonly"/>-->
|
|
||||||
<!-- <field name="required"/>-->
|
|
||||||
</form>
|
</form>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
@ -287,8 +284,6 @@
|
||||||
<tree string="Journal Column">
|
<tree string="Journal Column">
|
||||||
<field name="sequence"/>
|
<field name="sequence"/>
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
<!-- <field name="required"/>-->
|
|
||||||
<!-- <field name="readonly"/>-->
|
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
Loading…
Reference in New Issue