Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
3 Vastaukset
7586 Näkymät

Hi !

I'm creating a shipping module for purchase order.

Now that i've created the config part, I want to create and add automatically a line to a po when the po is generated, either by hand, or by purchase requisition.

This line must be a product, with description and price based on the config part and the supplier who will receive the po.

My idea is to create a function to do the stuff, but I don't know where to call this function, and if it's possible to create and add the "shipping" product.

I know that's an unusual question, but thanks for guiding me.

Avatar
Hylkää
Paras vastaus

You can inherit the purchase.order object and define create method that will be triggered when po generated.

from openerp.osv import fields, osv
class purchase_order(osv.osv):
   _inherit='purchase.order'
   create(cr, user, vals, context=None)
           super(purchase_order,self).create((cr, user, vals, context)
           #--------------TODO-----------------
           #Here are  your code  for  inserting  record  to *purchase.order.line object
           #------------END TODO-------------


Avatar
Hylkää
Tekijä

Thanks for your answer, now I know where to start ^^

Paras vastaus

hai py.. Can you tell me about your new module, its interesting,

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
3
jouluk. 24
13504
1
toukok. 24
1474
1
tammik. 18
51881
0
syysk. 15
3480
2
maalisk. 15
6533