-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BAH-3852 | Validation pop up when confirming stock picking (#169)
* BAH-3852 | Add. Model and view to show popup while doing stock moves * BAH-3852 | Add. Security access to new model * BAH-3852 | Refactor. Add subfolder for validation wizard in stock module * BAH-3852 | Add. Handle display of validation pop up for stock receipt and internal transfer * BAH-3852 | Refactor. Remove unused fields * BAH-3852 | Refactor. Extract constants for picking codes
- Loading branch information
Showing
7 changed files
with
124 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# -*- coding: utf-8 -*- | ||
from . import models | ||
from . import report | ||
from . import wizard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | ||
stock_batch_future_forecast_user,Stock Batch Future Forecast Stock User,model_batch_stock_future_forecast,stock.group_stock_user,1,1,1,0 | ||
stock_report_prod_by_last_moved_user,Stock Report Products by Last Moved Stock User,model_prod_last_moved_report,stock.group_stock_user,1,1,1,0 | ||
access_stock_picking_validation,access_stock_picking_validation,model_stock_picking_validate_wizard,,1,1,1,1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import stock_picking_validate_wizard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from odoo import api, fields, models, _ | ||
|
||
import logging | ||
|
||
_logger = logging.getLogger(__name__) | ||
|
||
|
||
class StockPickingValidateWizard(models.TransientModel): | ||
_name = 'stock.picking.validate.wizard' | ||
_description = 'Validation Wizard for Stock Picking Operations' | ||
|
||
move_lines = fields.Many2many('stock.move.line', readonly=True) | ||
picking_id = fields.Many2one('stock.picking', 'Picking') | ||
picking_code = fields.Selection(related='picking_id.picking_type_id.code', readonly=True) | ||
source_location = fields.Many2one('stock.location', related='picking_id.location_id', string="Source Location", | ||
readonly=True) | ||
destination_location = fields.Many2one('stock.location', related='picking_id.location_dest_id', | ||
string="Destination Location", readonly=True) | ||
|
||
def btn_confirm(self): | ||
return self.picking_id.with_context(validation_confirmed=True).button_validate() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<record id="stock_picking_validate_wizard_view" model="ir.ui.view"> | ||
<field name="name">Validate Stock Picking</field> | ||
<field name="model">stock.picking.validate.wizard</field> | ||
<field name="arch" type="xml"> | ||
<form string="Validation"> | ||
<field name="picking_id" invisible="1"/> | ||
<field name="picking_code" invisible="1"/> | ||
<div class="row h3" attrs="{'invisible': [['picking_code', '!=', 'internal']]}"> | ||
<div class="col-sm"> | ||
<label for="source_location"/> | ||
<field name="source_location"/> | ||
</div> | ||
<div class="col-sm"> | ||
<label for="destination_location"/> | ||
<field name="destination_location"/> | ||
</div> | ||
</div> | ||
<br/> | ||
<field name="move_lines"> | ||
<tree string="Stock Move Lines"> | ||
<field name="product_id"/> | ||
<field name="qty_done" string="Quantity"/> | ||
<field name="balance" string="Balance Quantity" | ||
attrs="{'column_invisible': [['parent.picking_code', '!=', 'internal']]}"/> | ||
<field name="product_uom_id"/> | ||
<field name="lot_id" | ||
attrs="{'column_invisible': [['parent.picking_code', '!=', 'internal']]}"/> | ||
<field name="lot_name" string="Lot/Serial Number" | ||
attrs="{'column_invisible': [['parent.picking_code', '!=', 'incoming']]}"/> | ||
<field name="expiration_date" | ||
attrs="{'column_invisible': [['parent.picking_code', '!=', 'incoming']]}"/>/> | ||
<field name="cost_price" | ||
attrs="{'column_invisible': [['parent.picking_code', '!=', 'incoming']]}"/> | ||
<field name="sale_price" | ||
attrs="{'column_invisible': [['parent.picking_code', '!=', 'incoming']]}"/> | ||
<field name="mrp" attrs="{'column_invisible': [['parent.picking_code', '!=', 'incoming']]}"/> | ||
</tree> | ||
</field> | ||
<footer> | ||
<button name="btn_confirm" | ||
string="Confirm" | ||
type="object" | ||
data-hotkey="q" | ||
class="btn-primary"/> | ||
<button string="Discard" | ||
class="btn-secondary" | ||
special="cancel" data-hotkey="z"/> | ||
</footer> | ||
</form> | ||
</field> | ||
</record> | ||
</odoo> |