don't know is this a bug or not.
*code*
*models/db.py*
db.delivery_header.sale_order_no.show_if =
(db.delivery_header.delivery_type == 'Sale Order')
*controllers/default.py*
def delivery_form():
if request.post_vars.delivery_type == 'Sale Order':
db.delivery_header.stock_transfer_no.requires =
IS_EMPTY_OR(IS_IN_DB(db(db.stock_transfer_header.status == 'Stock
Transfer'),
db.stock_transfer_header.id,
db.stock_transfer_header._format) )
db.delivery_header.sale_order_no.requires =
IS_IN_DB(db(db.sale_order_header.status == 'Invoice'),
db.sale_order_header.id,
db.sale_order_header._format)
if request.post_vars.delivery_type == 'Stock Transfer':
db.delivery_header.stock_transfer_no.requires =
IS_IN_DB(db(db.stock_transfer_header.status == 'Stock Transfer'),
db.stock_transfer_header.id,
db.stock_transfer_header._format)
db.delivery_header.sale_order_no.requires =
IS_EMPTY_OR(IS_IN_DB(db(db.sale_order_header.status == 'Invoice'),
db.sale_order_header.id,
db.sale_order_header._format) )
form = SQLFORM(db.delivery_header)
"""
cutted
"""
return dict(form = form)
why the drop down form field is not shown the query
(db.sale_order_header.status == 'Invoice') as expected in the first place?
after i submit the form and receive a form error in drop down form field,
after that the drop down form field is shown the query
(db.sale_order_header.status == 'Invoice') as expected.
thanks and best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.