mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[IMP] stock_picking_procure_method: black, isort, prettier
This commit is contained in:
committed by
micheledic
parent
dc80f5a61b
commit
7b7e6d4e9c
@@ -6,26 +6,27 @@ from odoo import api, fields, models
|
||||
|
||||
|
||||
class StockPicking(models.Model):
|
||||
_inherit = 'stock.picking'
|
||||
_inherit = "stock.picking"
|
||||
|
||||
procure_method = fields.Selection(
|
||||
selection='_selection_procure_method',
|
||||
compute='_compute_procure_method',
|
||||
inverse='_inverse_procure_method',
|
||||
string='Supply Method',
|
||||
help='By default, the system will take from the stock in the source '
|
||||
'location and passively wait for availability. The other '
|
||||
'possibility allows you to directly create a procurement on the '
|
||||
'source location (and thus ignore its current stock) to gather '
|
||||
'products. If we want to chain moves and have this one to wait '
|
||||
'for the previous, this second option should be chosen.',
|
||||
selection="_selection_procure_method",
|
||||
compute="_compute_procure_method",
|
||||
inverse="_inverse_procure_method",
|
||||
string="Supply Method",
|
||||
help="By default, the system will take from the stock in the source "
|
||||
"location and passively wait for availability. The other "
|
||||
"possibility allows you to directly create a procurement on the "
|
||||
"source location (and thus ignore its current stock) to gather "
|
||||
"products. If we want to chain moves and have this one to wait "
|
||||
"for the previous, this second option should be chosen.",
|
||||
)
|
||||
|
||||
def _selection_procure_method(self):
|
||||
return self.env['stock.move'].fields_get(
|
||||
allfields=['procure_method'])['procure_method']['selection']
|
||||
return self.env["stock.move"].fields_get(allfields=["procure_method"])[
|
||||
"procure_method"
|
||||
]["selection"]
|
||||
|
||||
@api.depends('move_lines.procure_method')
|
||||
@api.depends("move_lines.procure_method")
|
||||
def _compute_procure_method(self):
|
||||
for picking in self:
|
||||
procure_method = False
|
||||
@@ -38,6 +39,6 @@ class StockPicking(models.Model):
|
||||
picking.procure_method = procure_method
|
||||
|
||||
def _inverse_procure_method(self):
|
||||
self.filtered('procure_method').mapped('move_lines').update({
|
||||
'procure_method': self.procure_method,
|
||||
})
|
||||
self.filtered("procure_method").mapped("move_lines").update(
|
||||
{"procure_method": self.procure_method,}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user