← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 769538] Re: Onchange on one2many and many2one

 

Mr. Gadhia.
I strongly disagree with your argumentation
Under your assumption, no onchange should ever be allowed to change other fields (not just in one2many or many2many fields). The potential recursion is accepted on other types of fields. I see no bigger risk by having an homgeneous behaviour on all types of fields.
In fact, the risk is present ion todays modules, and it is currently handled by the programmer of the modules, who should test his own code to ensure no data condition is leading the system to a recursion error.
At last, if you think that this risk is unbearable, no onchange should admit a change on other field, a conclusion that I can not imaging it could be accepted by the development community at all.
If the plattform will not provide this feature, you will force the module programmer to implement the chained onchange behaviour by himself (only for this type of field! not for the simpler ones). It will imply exactly the same kind of tests and risks of recursion, and thus the system will not be any safer, but more complicated to programm and error prone!
I ask you for a reconsideration of your position, leaving the responsability of a correct testing to the module developer, but provinding a coherent behaviour on all types of fields and a simplified experience to the developer

-- 
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/769538

Title:
  Onchange on one2many and many2one

Status in OpenERP GTK Client:
  Invalid

Bug description:
  Working on GTK 6.0.1, in an onchange event for a one2many or many2one
  field, if you return a changed field, the onchange event of the
  changed field is not called.

  If you have an A field (many2one or one2many) with an onchange event,
  that returns {'value': {'b_field': new_value}}, and the b_field has
  also an onchange event, the screen will be updated on client but the
  'b_field''s onchange event is not called. If the 'b_field' is directly
  modified, the corresponding onchange event is called

  Checked with debug_rpc_answer log-level
  May be present also on Web client


References