24 lines
751 B
Python
24 lines
751 B
Python
# -*- coding: utf-8 -*-
|
|
from odoo import models, fields, api
|
|
|
|
|
|
class PutawayRuleBatchUpdateWizard(models.TransientModel):
|
|
_name = 'putaway.rule.batch.update.wizard'
|
|
_description = '批量修改上架规则目标位置'
|
|
|
|
location_out_id = fields.Many2one(
|
|
'stock.location',
|
|
string='存储到子位置',
|
|
required=True,
|
|
domain=[('usage', '=', 'internal')],
|
|
options="{'no_create': True}",
|
|
)
|
|
|
|
def action_confirm(self):
|
|
rule_ids = self.env.context.get('active_ids', [])
|
|
if rule_ids:
|
|
self.env['stock.putaway.rule'].browse(rule_ids).write({
|
|
'location_out_id': self.location_out_id.id,
|
|
})
|
|
return {'type': 'ir.actions.act_window_close'}
|