Skip to content

Commit

Permalink
Merge pull request #42 from jgrandguillaume/add-create-call-for-bids-…
Browse files Browse the repository at this point in the history
…button-in-lrl

Add create call for bids button in lrl
  • Loading branch information
jgrandguillaume committed Nov 14, 2014
2 parents c5886fd + 2bcf38f commit 9a91f60
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
19 changes: 19 additions & 0 deletions logistic_requisition/model/logistic_requisition.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,20 @@ def _do_sourced(self):
' various source line actions'))
self.state = 'sourced'

@api.one
def _do_create_po_requisition(self):
""" Create a call for bid for all sourcing lines with
procurement_method = 'procurement' contained
in the Line
"""
source_lines = self.source_ids
if not source_lines:
raise except_orm(_('No sourcing line Found'),
_('No sourcing line were found, '
'please create one.'))
pricelist = self.requisition_id.pricelist_id or None
source_lines._action_create_po_requisition(pricelist=pricelist)

@api.one
def _do_draft(self):
self.state = 'draft'
Expand Down Expand Up @@ -681,6 +695,11 @@ def button_sourced(self):
self._do_sourced()
return True

@api.multi
def button_create_po_requisition(self):
self._do_create_po_requisition()
return True

@api.model
def _open_cost_estimate(self):
return {
Expand Down
4 changes: 4 additions & 0 deletions logistic_requisition/view/logistic_requisition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,10 @@
string="Line Sourced"
type="object"
class="oe_highlight"/>
<button name="button_create_po_requisition"
states="assigned"
string="Create Call for Bids"
type="object"/>
<button name="button_create_cost_estimate"
states="sourced"
string="Create Cost Estimate"
Expand Down

0 comments on commit 9a91f60

Please sign in to comment.