14
14
('sent', 'RFQ Sent'),
15
15
('draftbid', 'Draft Bid'), # added
16
16
('bid', 'Bid Encoded'), # Bid Received renamed into Bid Encoded
17
('bid_selected', 'Bid selected'), # added
17
18
('draftpo', 'Draft PO'), # added
18
19
('confirmed', 'Waiting Approval'),
19
20
('approved', 'Purchase Confirmed'),
236
237
value['value']['dest_address_id'] = dest_id
240
def po_tender_requisition_selected(self, cr, uid, ids, context=None):
241
"""Workflow function that write state 'bid selected'"""
242
return self.write(cr, uid, ids, {'state': 'bid_selected'},
240
246
class purchase_order_line(orm.Model):
241
247
_inherit = 'purchase.order.line'
243
249
def onchange_product_id(self, cr, uid, ids, pricelist_id, product_id, qty, uom_id,
244
250
partner_id, date_order=False, fiscal_position_id=False, date_planned=False,
245
name=False, price_unit=False, context=None, state='draft', type='rfq', **kwargs):
251
name=False, price_unit=False, context=None, state='draftpo', type='purchase', **kwargs):
246
252
res = super(purchase_order_line, self).onchange_product_id(cr, uid, ids,
247
253
pricelist_id, product_id, qty, uom_id, partner_id, date_order,
248
254
fiscal_position_id, date_planned, name, price_unit, context)
249
if state == 'draft' and type == 'bid':
255
if state == 'draft' and type == 'rfq':
250
256
res['value'].update({'price_unit': 0})
251
257
elif state in ('sent', 'draftbid', 'bid'):
252
258
if 'price_unit' in res['value']: