View unanswered posts | View active topics
|
Page 1 of 1
|
[ 3 posts ] |
|
| Author |
Message |
|
anasb079
|
Post subject: Is it possible to auto-generate a 'fields.char' field ? Posted: Fri Jul 29, 2011 3:17 am |
|
Joined: Wed Jun 15, 2011 7:22 pm Posts: 104
|
|
Hello,
I would like to retrieve a field value and put it in a field of type 'fields.char (...)', for example the field' name 'of' product '. I was able to do that with fields of types 'fields.related (...)' and' 'fields.function (...) and I would like to know if it is possible to do that with a 'fields .char (...) field ?
Thank you for your answers.
|
|
| Top |
|
 |
|
gdaddy
|
Post subject: Re: Is it possible to auto-generate a 'fields.char' field ? Posted: Fri Jul 29, 2011 5:23 am |
|
Joined: Wed Jan 27, 2010 6:21 pm Posts: 797 Location: Auckland, NZ
|
|
As an example that is precisely what the description field of sale.order.line does.
It uses an onchange method in order to achieve this. onchange_product_id. This method is a little bit complex to learn about onchange from, but there is plenty of examples in source code and documentation on how to do this.
However it only changes when the field(s) to which the onchange method is assigned change.
_________________ Graeme
|
|
| Top |
|
 |
|
anasb079
|
Post subject: Re: Is it possible to auto-generate a 'fields.char' field ? Posted: Fri Jul 29, 2011 6:41 pm |
|
Joined: Wed Jun 15, 2011 7:22 pm Posts: 104
|
|
Thank you for your answer.
I didn't find any 'onchange_product_id' method. I found 'product_id_change' method in 'sale.py' and I couldn't understand it.
I created a class 'Myclass' witch inherits 'product.product'. I have a functional field 'Myfield' wich the value is calculated by the function 'Myfunction'. What I would like to do is: To put the value of 'Myfield' automatically in the field 'name' of 'Myclass' (field constructed by inheritance).
I tried to use on_change events with no success. Could you help me please?
|
|
| Top |
|
 |
|
Page 1 of 1
|
[ 3 posts ] |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum
|