Files
odoo_source/addons/stock/wizard/stock_overprocessed_transfer.py
T
Adrian Torres 4b38cc6590 [REM] *: calls to @api.multi
Multi is the default api for methods, it is not necessary to explicitly
decorate methods with it, adds clutter and most people use it because
they see that the rest of the code uses it.

Done with `find . -type f -name '*.py' | xargs sed -i '/@api.multi/d'`
2019-07-17 14:13:12 +02:00

24 lines
916 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)
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
def action_confirm(self):
self.ensure_one()
return self.picking_id.with_context(skip_overprocessed_check=True).button_validate()