Community mailing list archives

community@mail.odoo.com

Re: Capability of triggering action from an onchange, or similar functionality

by
Numa Extreme Systems, Gustavo Marino
- 11/15/2015 06:06:45
Hello:
It is related with the fact that during the creation of a record, data live only in the user interface (the browser front end). So, no real id is assigned to the record till it is written into the database. Thus, no action could be called because no id is available! (and this is the reason to show buttons in grey).

A workaround was implemented when you are at the main object level (for example, the sales order). Before calling the button action, the record is first created in database.

The workaround is not implemented if you are in a sub-record of the main object, and thus all buttons are grey till you save the record.

The solution is not simple. In the front end, the same workaround used in the main object should be available for sub-records. That means, show active buttons, but before calling the button's action, create the object hierarchy in the database. This is not so simple because on creation in database you can not correlate sub-records with actual ids of the newly created objects (in the simpler case the follow the same order, but is possible to change the order or create additional objects in a create method override).

The problem is not easy unless you are ready to face a major re-engineering of the UI code and associated web controller methods, and most probably the wire methods.

Are you completely sure you can not get an equivalent result with one2many computed fields? This case is supported!

Regards

Gustavo Adrian Marino

 

Mobile:  +54 911 5498 2515

Email: gamarino@numaes.com

Skype: gustavo.adrian.marino

 

<img border="0" width="213" height="94" src="cid:image001.jpg@01CC37F5.99B4CD20" alt="Descripción: Numa Logo V 1-0">



2015-11-15 1:27 GMT-03:00 OpenERP Master <openerpmaster@gmail.com>:
Hello,

This is not the same. I have reviewed this functionality. It is a warning parameter that is built into the on_change method and is only capable of returning a message.

On Sat, Nov 14, 2015 at 8:42 PM, Caudal Eric <caudaleric@gmail.com> wrote:

It is similar to the warning about out of stock in SOL.
You could get your inspiration there


On Sun, Nov 15, 2015, 02:31 OpenERP Master <openerpmaster@gmail.com> wrote:
Hello,

I am using version 8.0

Is it possible for a scenario where business user adds a new line to a sale order, and entering the sku or changing the quantity triggers a popup window, (action) that displays them related products to add to the sale order.

I already have this as a button on the sale order line, but you cannot click the button until you save the sale order, which is no good. The customer needs to be able to select from related products immediately after adding the sale.order.line

Looking for onchange event trigger action, but some other way possible I would consider

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe

--

Eric  Caudal (from my mobile)

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe