← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 694898] [NEW] [trunk] deleting line in editable tree view does not call on_change

 

Public bug reported:

I have an on_change function in a view, all it does is when a line
changes in an editable tree view, it adds up the quantities and places
that value into a field on the form.  So a list (tree) of quantities
times lengths = total (form field).  The same behaviour is exhibited
when tree view is not editable.

Using add, and edit everything behaves as expected.
However on_change is not called if I use the red delete button which I would expect.  The line has changed afterall.
I manually inserted a bool field in to the form to test behaviour to call on_change and after using the one2many widget delete button and calling on_change manually everything updates as expected.

If I exit the modal form, save the document, then go back in, everything
works.

The on_change function is embedded in the widget declaration in the form
view.  The qty updated is product_uom_qty in sale.order.line.

									<field colspan="3" mode="tree,form" name="cut_line"	nolabel="1" attrs="{'invisible':[('ctl_ok','=',0)]}" widget="one2many_list" on_change="onchange_cutlist(cut_line, manual_ok)">
										<form string="Cut List">
											<field name="qty" on_change="onchange_cut(qty,length)"/>
											<field name="length" on_change="onchange_cut(qty,length)"/>
											<field name="qty_subtotal"/>
											<field name="name" />
										</form>
										<tree string="Cut List">
											<field name="qty" on_change="onchange_cut(qty,length)"/>
											<field name="length" on_change="onchange_cut(qty,length)"/>
											<field name="qty_subtotal" />
											<field name="name" />
											<field name="sequence" invisible="True"/>
										</tree>
									</field>

Using trunk - all todays revisions - but it has been like this for some
time possibly forever.

** Affects: openobject-server
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/694898

Title:
  [trunk] deleting line in editable tree view does not call on_change

Status in OpenObject Server:
  New

Bug description:
  I have an on_change function in a view, all it does is when a line changes in an editable tree view, it adds up the quantities and places that value into a field on the form.  So a list (tree) of quantities times lengths = total (form field).  The same behaviour is exhibited when tree view is not editable.

Using add, and edit everything behaves as expected.
However on_change is not called if I use the red delete button which I would expect.  The line has changed afterall.
I manually inserted a bool field in to the form to test behaviour to call on_change and after using the one2many widget delete button and calling on_change manually everything updates as expected.

If I exit the modal form, save the document, then go back in, everything works.

The on_change function is embedded in the widget declaration in the form view.  The qty updated is product_uom_qty in sale.order.line.

									<field colspan="3" mode="tree,form" name="cut_line"	nolabel="1" attrs="{'invisible':[('ctl_ok','=',0)]}" widget="one2many_list" on_change="onchange_cutlist(cut_line, manual_ok)">
										<form string="Cut List">
											<field name="qty" on_change="onchange_cut(qty,length)"/>
											<field name="length" on_change="onchange_cut(qty,length)"/>
											<field name="qty_subtotal"/>
											<field name="name" />
										</form>
										<tree string="Cut List">
											<field name="qty" on_change="onchange_cut(qty,length)"/>
											<field name="length" on_change="onchange_cut(qty,length)"/>
											<field name="qty_subtotal" />
											<field name="name" />
											<field name="sequence" invisible="True"/>
										</tree>
									</field>

Using trunk - all todays revisions - but it has been like this for some time possibly forever.





Follow ups

References