Skip to Content
Menu
This question has been flagged
1 Reply
2483 Views

On Puchase.py

 def make_po(self, cr, uid, ids, context=None):

.......
available_draft_po_ids = po_obj.search(cr, uid, [

('partner_id', '=', partner.id), ('state', '=', 'draft'), ('picking_type_id', '=', procurement.rule_id.picking_type_id.id),
('location_id', '=', procurement.location_id.id), ('company_id', '=', procurement.company_id.id), ('dest_address_id', '=', procurement.partner_dest_id.id)], context=context)

......

i want set value of available_draft_po_ids is null but i don't want modify base code on purchase.py

So how to override it?

(sorry i speak English very bad)

Avatar
Discard
Best Answer


def _prepare_invoice(self, cr, uid, order, lines, context=None):

res=super(CLASS NAME, self)._prepare_invoice(cr, uid, order, lines, context=context)

print order.order_policy

inv_obj = self.pool.get('account.invoice.line')

inv_obj.write(cr, uid, lines, {'Order': order.Order.id}, context=context)

inv_obj.write(cr, uid, lines, {'staff': order.staff.id}, context=context)

return res



here i am overriding _prepare_invoice from  sale/sale.py.AND not changing the current execution of that function

Avatar
Discard
Related Posts Replies Views Activity
2
Feb 22
15258
2
Dec 23
21828
1
Aug 23
12546
1
Aug 23
11041
1
Jul 23
7223