mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[IMP] stock_request_submit: black, isort
This commit is contained in:
committed by
Patrick Wilson
parent
c63c40110b
commit
1f54d6088e
@@ -5,18 +5,19 @@ from odoo import api, fields, models
|
||||
|
||||
|
||||
class StockRequest(models.Model):
|
||||
_inherit = 'stock.request'
|
||||
_inherit = "stock.request"
|
||||
|
||||
def __get_request_states(self):
|
||||
states = super().__get_request_states()
|
||||
if not ('submitted', 'Submitted') in states:
|
||||
if not ("submitted", "Submitted") in states:
|
||||
states.insert(
|
||||
states.index(('draft', 'Draft')) + 1,
|
||||
('submitted', 'Submitted'))
|
||||
states.index(("draft", "Draft")) + 1, ("submitted", "Submitted")
|
||||
)
|
||||
return states
|
||||
|
||||
route_id = fields.Many2one(states={'draft': [('readonly', False)],
|
||||
'submitted': [('readonly', False)]})
|
||||
route_id = fields.Many2one(
|
||||
states={"draft": [("readonly", False)], "submitted": [("readonly", False)]}
|
||||
)
|
||||
|
||||
@api.multi
|
||||
def action_submit(self):
|
||||
@@ -24,9 +25,11 @@ class StockRequest(models.Model):
|
||||
|
||||
@api.multi
|
||||
def _action_submit(self):
|
||||
self.state = 'submitted'
|
||||
self.state = "submitted"
|
||||
|
||||
def _skip_procurement(self):
|
||||
return super(StockRequest, self)._skip_procurement() and \
|
||||
self.state != 'submitted' or \
|
||||
self.product_id.type not in ('consu', 'product')
|
||||
return (
|
||||
super(StockRequest, self)._skip_procurement()
|
||||
and self.state != "submitted"
|
||||
or self.product_id.type not in ("consu", "product")
|
||||
)
|
||||
|
||||
@@ -5,11 +5,11 @@ from odoo import api, models
|
||||
|
||||
|
||||
class StockRequestOrder(models.Model):
|
||||
_inherit = 'stock.request.order'
|
||||
_inherit = "stock.request.order"
|
||||
|
||||
@api.multi
|
||||
def action_submit(self):
|
||||
for line in self.stock_request_ids:
|
||||
line.action_submit()
|
||||
self.state = 'submitted'
|
||||
self.state = "submitted"
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user