Files
odoo_source/addons/stock/wizard/stock_overprocessed_transfer.py
T
Nimesh Jethva e13efbd8b4 [IMP]stock_*: Improvement in model description
Purpose of this commit is to give description more "business oriented"
because those descriptions appears in Odoo Studio which is supposed to be used by end users, not only by developers.

Related Task ID : 37311
2018-09-21 11:45:15 +02:00

26 lines
946 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
from odoo.exceptions import UserError
class StockOverProcessedTransfer(models.TransientModel):
_name = 'stock.overprocessed.transfer'
_description = 'Transfer Over Processed Stock'
picking_id = fields.Many2one('stock.picking')
overprocessed_product_name = fields.Char(compute='_compute_overprocessed_product_name',
readonly=True)
@api.multi
def _compute_overprocessed_product_name(self):
for wizard in self:
moves = wizard.picking_id._get_overprocessed_stock_moves()
wizard.overprocessed_product_name = moves[0].product_id.display_name
@api.multi
def action_confirm(self):
self.ensure_one()
return self.picking_id.with_context(skip_overprocessed_check=True).button_validate()