[IMP] mrp: open produce product wizard + add barcode in mrp report
This commit is contained in:
committed by
Josse Colpaert
parent
ac442a3f08
commit
3ae55ed232
@@ -365,6 +365,12 @@ class MrpProduction(models.Model):
|
||||
move_to_assign.action_assign()
|
||||
return True
|
||||
|
||||
@api.multi
|
||||
def open_produce_product(self):
|
||||
self.ensure_one()
|
||||
action = self.env.ref('mrp.act_mrp_product_produce').read()[0]
|
||||
return action
|
||||
|
||||
@api.multi
|
||||
def button_plan(self):
|
||||
""" Create work orders. And probably do stuff, like things. """
|
||||
|
||||
@@ -441,4 +441,4 @@ class MrpWorkorder(models.Model):
|
||||
self.ensure_one()
|
||||
action = self.env.ref('stock.action_stock_scrap').read()[0]
|
||||
action['domain'] = [('workorder_id', '=', self.id)]
|
||||
return action
|
||||
return action
|
||||
@@ -6,8 +6,16 @@
|
||||
<t t-call="report.internal_layout">
|
||||
<div class="page">
|
||||
<div class="oe_structure"/>
|
||||
<h2>Production Order # : <span t-field="o.name"/></h2>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-7">
|
||||
<h2>Production Order # : <span t-field="o.name"/></h2>
|
||||
</div>
|
||||
<div class="col-xs-5">
|
||||
<span class="text-right">
|
||||
<img t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('Code128', o.name, 600, 100)" style="width:350px;height:60px"/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt32 mb32">
|
||||
<div class="col-xs-3">
|
||||
<strong>Source Document:</strong><br/>
|
||||
@@ -73,6 +81,9 @@
|
||||
<th class="text-center" groups="stock.group_stock_multi_locations">
|
||||
<strong>Destination Location</strong>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<strong>Barcode</strong>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -95,6 +106,11 @@
|
||||
<td class="text-center" groups="stock.group_stock_multi_locations">
|
||||
<span t-field="line.location_dest_id.name"/>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span t-if="line.product_id.barcode">
|
||||
<img t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('Code128', line.product_id.barcode, 600, 100)" style="width:300px;height:50px"/>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</t>
|
||||
</tbody>
|
||||
|
||||
@@ -48,8 +48,8 @@
|
||||
<button name="button_mark_done" attrs="{'invisible': [('check_to_done', '=', False)]}" string="Mark as Done" type="object" class="oe_highlight"/>
|
||||
<button name="action_assign" attrs="{'invisible': [('availability', 'in', ('assigned', 'none'))]}" string="Check availability" type="object" class="oe_highlight"/>
|
||||
<button name="button_plan" attrs="{'invisible': ['|', ('state', '!=', 'confirmed'), ('routing_id', '=', False)]}" type="object" string="Create Workorders" class="oe_highlight"/>
|
||||
<button name="%(act_mrp_product_produce)d" attrs="{'invisible': ['|', '|', ('availability', 'not in', ['partially_available', 'assigned']), ('state', 'not in', ('confirmed','progress')), ('routing_id', '!=', False)]}" string="Produce" type="action" class="oe_highlight"/>
|
||||
<button name="%(act_mrp_product_produce)d" attrs="{'invisible': ['|', '|', ('availability', '!=', 'waiting'), ('state', 'not in', ('confirmed','progress')), ('routing_id', '!=', False)]}" string="Produce" type="action"/>
|
||||
<button name="open_produce_product" attrs="{'invisible': ['|', '|', ('availability', 'not in', ['partially_available', 'assigned']), ('state', 'not in', ('confirmed','progress')), ('routing_id', '!=', False)]}" string="Produce" type="object" class="oe_highlight"/>
|
||||
<button name="open_produce_product" attrs="{'invisible': ['|', '|', ('availability', '!=', 'waiting'), ('state', 'not in', ('confirmed','progress')), ('routing_id', '!=', False)]}" string="Produce" type="object"/>
|
||||
<button name="post_inventory" string="Post Inventory" type="object" class="oe_highlight" attrs="{'invisible': [('post_visible', '=', False)]}"/>
|
||||
<button name="action_cancel" type="object" string="Cancel" attrs="{'invisible': ['|', ('state', 'in', ('done','cancel')), ('check_to_done', '=', True)]}"/>
|
||||
<button name="button_scrap" type="object" string="Scrap" attrs="{'invisible': ['|', ('availability', '=', 'none'), ('state', 'in', ('cancel'))]}"/>
|
||||
|
||||
Reference in New Issue
Block a user