data['amount_currency'] = v
return data
- def _on_create_write(self, cr, uid, id, context={}):
+ def on_create_write(self, cr, uid, id, context={}):
ml = self.browse(cr, uid, id, context)
return map(lambda x: x.id, ml.move_id.line_id)
state = ' colors="red:state==\'draft\'"'
#xml = '''<?xml version="1.0"?>\n<tree string="%s" editable="top" refresh="5"%s>\n\t''' % (title, state)
- xml = '''<?xml version="1.0"?>\n<tree string="%s" editable="top" refresh="5" on_write="_on_create_write"%s>\n\t''' % (title, state)
+ xml = '''<?xml version="1.0"?>\n<tree string="%s" editable="top" refresh="5" on_write="on_create_write"%s>\n\t''' % (title, state)
fields = []
widths = {
</search>
</field>
</record>
-
+
<record id="action_account_form" model="ir.actions.act_window">
<field name="name">List of Accounts</field>
<field name="res_model">account.account</field>
<field name="type">tree</field>
<field eval="4" name="priority"/>
<field name="arch" type="xml">
- <tree string="Account Entry Line" editable="top" on_write="_on_create_write">
+ <tree string="Account Entry Line" editable="top" on_write="on_create_write">
<field name="date"/>
<field name="period_id"/>
<field name="move_id"/>
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
res[field]['states'][key] = value
return res
- def _onchange_invoice_line_view(self, cr, uid, id, type, context={}, *args):
+ def onchange_invoice_line_view(self, cr, uid, id, type, context={}, *args):
if (not type):
return {}
<field name="type">form</field>
<field name="arch" type="xml">
<xpath expr="/form/notebook/page/field[@name='name']" position="before">
- <field name="state" select="1" on_change="_onchange_invoice_line_view(state)" />
+ <field name="state" select="1" on_change="onchange_invoice_line_view(state)" />
<field name="sequence"/>
</xpath>
</field>