View unanswered posts | View active topics
|
Page 1 of 1
|
[ 4 posts ] |
|
| Author |
Message |
|
aw
|
Post subject: [SOLVED] _defaults{ question Posted: Fri Jul 29, 2011 2:15 pm |
|
Joined: Wed Nov 25, 2009 2:36 pm Posts: 73 Location: Germany
|
|
Hallo,
here is what i want to do:
in sale order there is a field which contains a discount percent value. if i add a new line to the order the default value of the discount field of sale.order.line should be the value of the discount percent field of the sale order. I know i have to inherit the sale.order.line class and add _defaults {discount: but i don't know how get the value of the field in sale.order, becaus sale.order.line.order_id isn't filled out yet.
any ideas?
Thank you.
aw
_________________ OpenERP 6.0.3 on Ubuntu 10.04 LTS Server Clients: WinXP SP3 & Win7 GTK
Last edited by aw on Tue Aug 02, 2011 7:15 am, edited 1 time in total.
|
|
| Top |
|
 |
|
gdaddy
|
Post subject: Re: _defaults{ question Posted: Fri Jul 29, 2011 10:25 pm |
|
Joined: Wed Jan 27, 2010 6:21 pm Posts: 797 Location: Auckland, NZ
|
|
Defaults could work but it would be really messy and user unfriendly IMO. Having to save parent, then sale order line to populate default.
You should use an onchange method instead which can access unsaved values. A lot like a sale order line uses the unsaved parent pricelist when calculating price.
_________________ Graeme
|
|
| Top |
|
 |
|
aw
|
Post subject: Re: _defaults{ question Posted: Mon Aug 01, 2011 8:50 am |
|
Joined: Wed Nov 25, 2009 2:36 pm Posts: 73 Location: Germany
|
|
You are absolutely right.
I shouldn't do such things on friday afternoons...
I'll try it that way.
Thank you so far.
_________________ OpenERP 6.0.3 on Ubuntu 10.04 LTS Server Clients: WinXP SP3 & Win7 GTK
|
|
| Top |
|
 |
|
aw
|
Post subject: Re: _defaults{ question Posted: Mon Aug 01, 2011 2:20 pm |
|
Joined: Wed Nov 25, 2009 2:36 pm Posts: 73 Location: Germany
|
|
works fine.
Thank you.
_________________ OpenERP 6.0.3 on Ubuntu 10.04 LTS Server Clients: WinXP SP3 & Win7 GTK
|
|
| Top |
|
 |
|
Page 1 of 1
|
[ 4 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
|