Hi guys,
I've this tables:
db.define_table('TipoUnidade',
Field('TipoUnidadeDescricao'),
format='%(TipoUnidadeDescricao)s'
)
db.define_table('Produto',
Field('ID_TipoUnidade', 'reference TipoUnidade',
requires=IS_IN_SET(['Unidade', 'Gramas'])),
Field('CodigoBarras', type='integer'),
Field('CodigoCacauShow', type='integer'),
Field('CustoUnitario', type='double'),
Field('QuantidadeMinima', type='integer'),
Field('ProdutoDescricao', type='string', label='Produto'),
format='%(ProdutoDescricao)s'
)
db.define_table('EntradaProdutoEstoque',
Field('ID_Produto', 'reference Produto'),
Field('Ativo', type='boolean', default=True),
Field('Validade', type='date'),
Field('Data', type='date' ),
Field('Quantidade', type='integer'),
Field('DataDesativacao',type='date'),
Field('Lote'),
format='%(Lote)s' + ' - ' + '%(ID_Produto)s'
)
db.define_table('Kits',
Field('Nome'),
Field('ID_EntradaProduto', 'list:reference
EntradaProdutoEstoque')
#Field('ID_Produto', 'list:reference Produto')
)
db.define_table('SaidaProdutoEstoque',
Field('ID_EntradaProdutoEstoque', 'reference
EntradaProdutoEstoque'),
Field('CustoUnitario', type='double'),
Field('Data', type='date'),
Field('Quantidade', type='integer')
)
and I've this resources:
db.EntradaProdutoEstoque.ID_Produto.requires = IS_IN_DB(db, db.Produto,
db.Produto._format)
db.SaidaProdutoEstoque.ID_EntradaProdutoEstoque.requires =
IS_IN_DB(db(db.EntradaProdutoEstoque.Ativo == True),
db.EntradaProdutoEstoque, db.EntradaProdutoEstoque._format)
I want the table *SaidaProdutoEstoque* on field *ID_EntradaProdutoEstoque* show
*Lote *and the product name referenced on table *EntradaProdutoEstoque *on
Field *ID_Produto *where the name of product is on table *Produto*
It's possible?
--
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.