bemade_picking_upstream to 17.0
This commit is contained in:
parent
a2602e2ba6
commit
9af0635e8f
3 changed files with 9 additions and 16 deletions
|
|
@ -18,7 +18,7 @@
|
|||
#
|
||||
{
|
||||
'name': 'Show Upstream Pickings',
|
||||
'version': '15.0.1.0.0',
|
||||
'version': '17.0.1.0.0',
|
||||
'summary': 'Show upstream pickings when a picking is waiting on other moves.',
|
||||
'category': 'Stock',
|
||||
'author': 'Bemade Inc.',
|
||||
|
|
|
|||
|
|
@ -17,10 +17,10 @@ class StockPicking(models.Model):
|
|||
compute_sudo=True,
|
||||
)
|
||||
|
||||
@api.depends('move_lines', 'move_lines.move_orig_ids', 'move_lines.move_orig_ids.picking_id')
|
||||
@api.depends('move_ids', 'move_ids.move_orig_ids', 'move_ids.move_orig_ids.picking_id')
|
||||
def _compute_upstream_picking_ids(self):
|
||||
for rec in self:
|
||||
rec.upstream_picking_ids = rec.move_lines.mapped('move_orig_ids').mapped('picking_id') - rec
|
||||
rec.upstream_picking_ids = rec.move_ids.mapped('move_orig_ids').mapped('picking_id') - rec
|
||||
rec.upstream_picking_count = len(rec.upstream_picking_ids)
|
||||
|
||||
def action_view_upstream_transfers(self):
|
||||
|
|
|
|||
|
|
@ -1,21 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="stock_picking_view_form" model="ir.ui.view">
|
||||
<field name="inherit_id" ref="stock.view_picking_form"/>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="arch" type="xml">
|
||||
<button name="action_see_move_scrap" position="before">
|
||||
<field name="upstream_picking_ids" invisible="1"/>
|
||||
<field name="upstream_picking_count" invisible="1"/>
|
||||
<button
|
||||
name="action_view_upstream_transfers"
|
||||
string="Upstream Transfer(s)"
|
||||
type="object"
|
||||
class="oe_stat_button"
|
||||
icon="fa-pause"
|
||||
attrs="{'invisible': [('upstream_picking_count', '=', 0)]}">
|
||||
<field invisible="1" name="upstream_picking_ids"/>
|
||||
<field invisible="1" name="upstream_picking_count"/>
|
||||
<button class="oe_stat_button" icon="fa-pause" invisible="upstream_picking_count == 0" name="action_view_upstream_transfers" string="Upstream Transfer(s)" type="object">
|
||||
</button>
|
||||
</button>
|
||||
</field>
|
||||
</button></field>
|
||||
</record>
|
||||
</odoo>
|
||||
</odoo>
|
||||
|
|
|
|||
Loading…
Reference in a new issue