credativ team mailing list archive
-
credativ team
-
Mailing list archive
-
Message #00137
[Bug 890110] Re: new field default value is calculated only once during initialisation
Hello Kirill ,
I have checked this issue at my end and I found that when you
upgrade data base all partner sequence will 000000001 ,If you
not upgrade this gives you blank sequence field , so both
are inconsistency so I am confirming this issue.
I have attached a screen shot for more reference.
Thanks for reporting.
** Changed in: openobject-server
Importance: Undecided => Low
** Changed in: openobject-server
Status: New => Confirmed
** Changed in: openobject-server
Assignee: (unassigned) => OpenERP's Framework R&D (openerp-dev-framework)
--
You received this bug notification because you are a member of OpenERP
Framework Experts, which is subscribed to OpenERP Server.
https://bugs.launchpad.net/bugs/890110
Title:
new field default value is calculated only once during initialisation
Status in OpenERP Server:
Confirmed
Bug description:
OpenERP server 6.0.3
Steps to reproduce:
1) create new sequence
<record id="partner_code_sequence_code" model="ir.sequence.type">
<field name="name">Partner code sequence</field>
<field name="code">res.partner.code</field>
</record>
<record id="partner_code_sequence" model="ir.sequence">
<field name="name">Partner code sequence</field>
<field name="code">res.partner.code</field>
<field name="active">True</field>
<field name="prefix"></field>
<field name="padding">9</field>
<field name="number_increment">1</field>
<field name="number_next">1</field>
</record>
2) inherit res.partner, add new field with default value from sequence
class res_partner(osv.osv):
_inherit='res.partner'
_columns = {
'code': fields.char('Code', 9, required=True),
}
_defaults = {
'code': lambda self, cr, uid, *a: self.pool.get('ir.sequence').get(
cr, uid, 'res.partner.code'),
}
res_partner()
3) update database
Actual result: all existing partners have code "000000001"
Expected result: value of 'code' field calculated for each partner
To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-server/+bug/890110/+subscriptions