On 22/08/13 08:58 -0700, Josias Pérez wrote:
> Hi,
>
> I'm working in a custom module to create BOMs.
>
> This is the code:
>
> @classmethod
> def create_curtain_bom(cls, products):
> for product in products:
>
> lista = {'productA':quantity,'productB':quantity}
> bomid = 10
>
> pool = Pool()
> Input = pool.get('production.bom.input')
>
> to_create_inputs = []
> for li in lista:
> to_create_outputs.append({'product':li,must be to_create_inputs > 'bom':bomid, > 'quantity':lista[li], > 'uom':17}) > if to_create_inputs: > Input.create(to_create_inputs) > > My doubt is how i need to sent the parameters for .create() function, > 'cause it's give me the follow message when it is called: > > AttributeError: 'str' object has no attribute 'iterkeys' We need the full traceback. > I would appreciate if someone tell me how the parameters to create need to > be sent. http://doc.tryton.org/2.8/trytond/doc/ref/models/models.html?highlight=create#trytond.model.ModelStorage.create -- Cédric Krier B2CK SPRL Rue de Rotterdam, 4 4000 Liège Belgium Tel: +32 472 54 46 59 Email/Jabber: [email protected] Website: http://www.b2ck.com/
pgpgolthimryy.pgp
Description: PGP signature
