[REF] stock_picking_batch: stock picking to its own file
task-2069646
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import stock_picking
|
||||
from . import stock_picking_batch
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class StockPicking(models.Model):
|
||||
_inherit = "stock.picking"
|
||||
|
||||
batch_id = fields.Many2one(
|
||||
'stock.picking.batch', string='Batch Transfer',
|
||||
check_company=True,
|
||||
states={'done': [('readonly', True)], 'cancel': [('readonly', True)]},
|
||||
help='Batch associated to this transfer', copy=False)
|
||||
|
||||
def _should_show_transfers(self):
|
||||
if len(self.batch_id) == 1 and self == self.batch_id.picking_ids:
|
||||
return False
|
||||
return super()._should_show_transfers()
|
||||
@@ -75,18 +75,3 @@ class StockPickingBatch(models.Model):
|
||||
return self.env.ref('stock_picking_batch.mt_batch_state')
|
||||
return super(StockPickingBatch, self)._track_subtype(init_values)
|
||||
|
||||
|
||||
class StockPicking(models.Model):
|
||||
_inherit = "stock.picking"
|
||||
|
||||
batch_id = fields.Many2one(
|
||||
'stock.picking.batch', string='Batch Transfer',
|
||||
check_company=True,
|
||||
states={'done': [('readonly', True)], 'cancel': [('readonly', True)]},
|
||||
help='Batch associated to this transfer', copy=False)
|
||||
|
||||
def _should_show_transfers(self):
|
||||
if len(self.batch_id) == 1 and self == self.batch_id.picking_ids:
|
||||
return False
|
||||
return super()._should_show_transfers()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user