Browse Source

[ADD] Initiail Commit

pull/29/head
SHEREEF PT 8 years ago
parent
commit
e2d8b0a636
  1. 30
      mrp_secondary_uom/README.rst
  2. 24
      mrp_secondary_uom/__init__.py
  3. 50
      mrp_secondary_uom/__manifest__.py
  4. 9
      mrp_secondary_uom/data/mrp_sec_uom_round.xml
  5. 25
      mrp_secondary_uom/models/__init__.py
  6. 121
      mrp_secondary_uom/models/change_production_qnty.py
  7. 113
      mrp_secondary_uom/models/mrp_sec_uom.py
  8. BIN
      mrp_secondary_uom/static/description/5.png
  9. BIN
      mrp_secondary_uom/static/description/6.png
  10. BIN
      mrp_secondary_uom/static/description/Finished Products.png
  11. BIN
      mrp_secondary_uom/static/description/MRP Order.png
  12. BIN
      mrp_secondary_uom/static/description/banner.jpg
  13. BIN
      mrp_secondary_uom/static/description/change.png
  14. BIN
      mrp_secondary_uom/static/description/cybro_logo.png
  15. BIN
      mrp_secondary_uom/static/description/icon.png
  16. 135
      mrp_secondary_uom/static/description/index.html
  17. BIN
      mrp_secondary_uom/static/description/partial production.png
  18. BIN
      mrp_secondary_uom/static/description/update.png
  19. 64
      mrp_secondary_uom/views/mrp_sec_uom.xml

30
mrp_secondary_uom/README.rst

@ -0,0 +1,30 @@
=======================
MRP - Secondary UoM v10
=======================
This module Manage the Manufacturing process with secondary UoM.
Installation
============
Just select it from available modules to install it, there is no need to extra installations.
Configuration
=============
After installing this module, Go to Inventory->Configuration->Setting->Products->Unit of Measures->
Enable the different units of measure for products (TICK on Some 'products may be sold/purchased in different unit of
measures').
Features
========
* Allows to manage MRP with Secondary UoM.
* Products to Produce With Secondary UoM.
* Produced Products With Secondary UoM.
Credits
=======
Developer: Nikhil krishnan @ cybrosys, nikhil@cybrosys.in

24
mrp_secondary_uom/__init__.py

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nikhil krishnan(<http://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import models

50
mrp_secondary_uom/__manifest__.py

@ -0,0 +1,50 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nikhil krishnan(<http://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': 'MRP - Secondary UoM',
'version': '10.0.1.0',
'category': 'Manufacturing',
'summary': 'Secondary UoM in Manufacturing Order',
'description': """
Manage the Manufacturing process with secondary UoM
===================================================
This module allows you to cover planning, ordering, stocks and the manufacturing with a Secondary UoM. It handles the
Products to Produce & Produced Products according to the production with Secondary UoM
-----------------------------------------------------------------------------------------
* Allows to manage MRP with Secondary UoM
* Products to Produce With Secondary UoM
* Produced Products With Secondary UoM
""",
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'website': "http://www.cybrosys.com",
'depends': ['mrp'],
'data': ['views/mrp_sec_uom.xml',
'data/mrp_sec_uom_round.xml'],
'images': ['static/description/banner.jpg'],
'license': 'LGPL-3',
'installable': True,
'application': False,
}

9
mrp_secondary_uom/data/mrp_sec_uom_round.xml

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record forcecreate="True" id="sec_uom_ratio_rounding" model="decimal.precision">
<field name="name">Secondary UoM Ratio</field>
<field name="digits">10</field>
</record>
</data>
</odoo>

25
mrp_secondary_uom/models/__init__.py

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nikhil krishnan(<https://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################
import mrp_sec_uom
import change_production_qnty

121
mrp_secondary_uom/models/change_production_qnty.py

@ -0,0 +1,121 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nikhil krishnan(<https://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from odoo import api, fields, models, _
from odoo.exceptions import UserError
import math
class ChangeProductionQty(models.TransientModel):
_inherit = 'change.production.qty'
mrp_sec_qty = fields.Float(string='Product Secondary Qty')
mrp_sec_uom = fields.Many2one('product.uom', string='Secondary Unit')
@api.model
def default_get(self, fields):
res = super(ChangeProductionQty, self).default_get(fields)
prod_obj = self.env['mrp.production']
prod = prod_obj.browse(self._context.get('active_id'))
if 'product_qty' in fields:
res.update({'product_qty': prod.product_qty})
if 'mrp_sec_qty' in fields:
res.update({'mrp_sec_qty': prod.mrp_sec_qty})
if 'mrp_sec_uom' in fields:
res.update({'mrp_sec_uom': prod.mrp_sec_uom.id})
return res
@api.model
def _update_product_to_produce(self, production, qty, ratio, sec_uom):
production_move = production.move_finished_ids.filtered(lambda x:x.product_id.id == production.product_id.id and x.state not in ('done', 'cancel'))
if production_move:
production_move.write({
'product_uom_qty': qty,
'stock_move_sec_uom': sec_uom.id,
'ratio_sec_uom': ratio,
})
else:
production_move = production._generate_finished_moves()
production_move = production.move_finished_ids.filtered(lambda x : x.state not in ('done', 'cancel') and production.product_id.id == x.product_id.id)
production_move.write({
'product_uom_qty': qty,
'stock_move_sec_uom': sec_uom.id,
'ratio_sec_uom': ratio,
})
@api.multi
def change_prod_qty(self):
for wizard in self:
production = wizard.mo_id
produced = sum(production.move_finished_ids.mapped('quantity_done'))
if wizard.product_qty < produced:
raise UserError(_("You have already processed %d. Please input a quantity higher than %d ")%(produced, produced))
ratio = wizard.mrp_sec_qty/wizard.product_qty
production.write({'product_qty': wizard.product_qty,
'mrp_sec_qty': wizard.mrp_sec_qty,
'mrp_sec_uom': wizard.mrp_sec_uom.id,
'mrp_ratio_sec_uom': ratio
})
factor = production.product_uom_id._compute_quantity(production.product_qty - production.qty_produced, production.bom_id.product_uom_id) / production.bom_id.product_qty
boms, lines = production.bom_id.explode(production.product_id, factor, picking_type=production.bom_id.picking_type_id)
for line, line_data in lines:
production._update_raw_move(line, line_data)
operation_bom_qty = {}
for bom, bom_data in boms:
for operation in bom.routing_id.operation_ids:
operation_bom_qty[operation.id] = bom_data['qty']
self._update_product_to_produce(production, production.product_qty - production.qty_produced,
ratio, production.mrp_sec_uom)
moves = production.move_raw_ids.filtered(lambda x: x.state not in ('done', 'cancel'))
moves.do_unreserve()
moves.action_assign()
for wo in production.workorder_ids:
operation = wo.operation_id
if operation_bom_qty.get(operation.id):
cycle_number = math.ceil(operation_bom_qty[operation.id] / operation.workcenter_id.capacity) # TODO: float_round UP
wo.duration_expected = (operation.workcenter_id.time_start +
operation.workcenter_id.time_stop +
cycle_number * operation.time_cycle * 100.0 / operation.workcenter_id.time_efficiency)
if production.product_id.tracking == 'serial':
quantity = 1.0
else:
quantity = wo.qty_production - wo.qty_produced
quantity = quantity if (quantity > 0) else 0
wo.qty_producing = quantity
if wo.qty_produced < wo.qty_production and wo.state == 'done':
wo.state = 'progress'
# assign moves; last operation receive all unassigned moves
# TODO: following could be put in a function as it is similar as code in _workorders_create
# TODO: only needed when creating new moves
moves_raw = production.move_raw_ids.filtered(lambda move: move.operation_id == operation and move.state not in ('done', 'cancel'))
if wo == production.workorder_ids[-1]:
moves_raw |= production.move_raw_ids.filtered(lambda move: not move.operation_id)
moves_finished = production.move_finished_ids.filtered(lambda move: move.operation_id == operation) #TODO: code does nothing, unless maybe by_products?
moves_raw.mapped('move_lot_ids').write({'workorder_id': wo.id})
(moves_finished + moves_raw).write({'workorder_id': wo.id})
if wo.move_raw_ids.filtered(lambda x: x.product_id.tracking != 'none') and not wo.active_move_lot_ids:
wo._generate_lot_ids()
return {}

113
mrp_secondary_uom/models/mrp_sec_uom.py

@ -0,0 +1,113 @@
# -*- coding: utf-8 -*-
#
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nikhil krishnan(<https://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from odoo import models, fields, api
import odoo.addons.decimal_precision as dp
class MRPSecUOM(models.Model):
_inherit = 'mrp.production'
mrp_sec_qty = fields.Float('Secondary Quantity', readonly=True)
mrp_sec_uom = fields.Many2one('product.uom', 'Secondary Unit')
mrp_ratio_sec_uom = fields.Float('Ratio 2ndry Quantity', digits=dp.get_precision('Secondary UoM Ratio'))
# Over write this fuction for add the new line of code: 'ratio_sec_uom': self.mrp_ratio_sec_uom,
def _generate_finished_moves(self):
move = self.env['stock.move'].create({
'name': self.name,
'date': self.date_planned_start,
'date_expected': self.date_planned_start,
'product_id': self.product_id.id,
'product_uom': self.product_uom_id.id,
'product_uom_qty': self.product_qty,
'ratio_sec_uom': self.mrp_ratio_sec_uom,
'stock_move_sec_uom': self.mrp_sec_uom.id,
'location_id': self.product_id.property_stock_production.id,
'location_dest_id': self.location_dest_id.id,
'move_dest_id': self.procurement_ids and self.procurement_ids[0].move_dest_id.id or False,
'procurement_id': self.procurement_ids and self.procurement_ids[0].id or False,
'company_id': self.company_id.id,
'production_id': self.id,
'origin': self.name,
'group_id': self.procurement_group_id.id,
})
move.action_confirm()
return move
@api.model
def create(self, vals):
if vals.get('mrp_sec_qty'):
if vals.get('product_qty'):
vals['mrp_ratio_sec_uom'] = float(vals['mrp_sec_qty'])/float(vals['product_qty'])
return super(MRPSecUOM, self).create(vals)
class StockMoveSecUOM(models.Model):
_inherit = 'stock.move'
stock_move_sec_qty_to_produce = fields.Float(string='To Produce (2ndry)',
compute='compute_stock_move_sec_qty_to_produce')
stock_move_sec_uom = fields.Many2one('product.uom', string='2ndry UoM')
stock_move_sec_qty_produced = fields.Float(string='Produced (2ndry)',
compute='compute_stock_move_sec_qty_produced')
ratio_sec_uom = fields.Float(string='Ratio 2ndry Quantity', digits=dp.get_precision('Secondary UoM Ratio'))
def compute_stock_move_sec_qty_to_produce(self):
for rec in self:
rec.stock_move_sec_qty_to_produce = rec.ratio_sec_uom * rec.product_uom_qty
def compute_stock_move_sec_qty_produced(self):
for rec in self:
rec.stock_move_sec_qty_produced = rec.ratio_sec_uom * rec.quantity_done
class MRPProductProduceSecUOM(models.TransientModel):
_inherit = 'mrp.product.produce'
product_produce_sec_qty = fields.Float(string='2ndry Quantity')
ratio_sec_uom = fields.Float(string='Ratio 2ndry Quantity', digits=dp.get_precision('Secondary UoM Ratio'))
product_produce_sec_uom = fields.Many2one('product.uom', string='2ndry UoM')
@api.model
def default_get(self, fields):
res = super(MRPProductProduceSecUOM, self).default_get(fields)
if self._context and self._context.get('active_id'):
production = self.env['mrp.production'].browse(self._context['active_id'])
serial_finished = (production.product_id.tracking == 'serial')
if serial_finished:
sec_qty = production.mrp_ratio_sec_uom
else:
sec_qty = res['product_qty'] * production.mrp_ratio_sec_uom
res['product_produce_sec_qty'] = sec_qty
res['product_produce_sec_uom'] = production.mrp_sec_uom.id
res['ratio_sec_uom'] = production.mrp_ratio_sec_uom
return res
@api.onchange('product_qty', 'product_produce_sec_qty')
def onchange_product_qty(self):
sec_qty = self.product_qty * self.ratio_sec_uom
self.product_produce_sec_qty = sec_qty

BIN
mrp_secondary_uom/static/description/5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
mrp_secondary_uom/static/description/6.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
mrp_secondary_uom/static/description/Finished Products.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
mrp_secondary_uom/static/description/MRP Order.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

BIN
mrp_secondary_uom/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

BIN
mrp_secondary_uom/static/description/change.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
mrp_secondary_uom/static/description/cybro_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
mrp_secondary_uom/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

135
mrp_secondary_uom/static/description/index.html

@ -0,0 +1,135 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan">MRP - Secondary UoM</h2>
<h3 class="oe_slogan"> Manage the Manufacturing process with secondary UoM </h3>
<h4 class="oe_slogan"><a href="https://www.cybrosys.com">Cybrosys Technologies</a> </h4>
</div>
<div class="oe_row oe_spaced">
<h4><p style="margin-left: 42px;">Major Features:</p></h4>
<ul>
<li style="list-style:none !important;"><span style="color:green;"> &#9733;</span>&nbsp;&nbsp;Allows to manage MRP with Secondary UoM.</li>
<li style="list-style:none !important;"><span style="color:green;"> &#9733;</span>&nbsp;&nbsp; Products to Produce With Secondary UoM.</li>
<li style="list-style:none !important;"><span style="color:green;"> &#9733;</span>&nbsp;&nbsp; Produced Products With Secondary UoM.</li>
</ul>
</div>
<div class="oe_span12">
<div class="oe_demo oe_picture oe_screenshot">
<img src="MRP Order.png">
</div>
</div>
<div class="oe_span12">
<p class="oe_mt32">
<p>This module allows you to cover planning, ordering, stocks and the manufacturing with a Secondary
UoM. It handles the Products to Produce & Produced Products according to the production with Secondary UoM.</p>
</p>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<p class="oe_mt32">
<p>As shown here, When we create a MO with a Primary and Secondary Product Quantities and UOMs.
After saving, Order is in 'Confirmed' state. Same time we can see a record
created in 'Finished Products' with secondary UoM. </p>
</p>
</div>
<div class="oe_span12">
<div class="oe_demo oe_picture oe_screenshot">
<img src="Finished Products.png">
</div>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<p class="oe_mt32">
<p>We can change the Primary Quantity, Secondary Quantity and Secondary UoM at any time. There
will be an 'Update' Button to handle the same.</p>
</div>
<div class="col-md-6">
<div class="oe_demo oe_picture oe_screenshot">
<img src="update.png">
</div>
</div>
<div class="col-md-1">
<i style="font-size: 66px;color: #d81212;padding-top: 45px;" class="fa fa-long-arrow-right" aria-hidden="true"></i>
</div>
<div class="col-md-5">
<div class="oe_demo oe_picture oe_screenshot">
<img src="change.png">
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<img src="5.png">
</div>
</div>
<div class="oe_span6">
<p class="oe_mt32">
<p>When we click on the 'Produce' button, The same window is appear with Secondary
Quantity and UoM.</p>
<p>If we Produce Partially or completely, It automatically calculate the Secondary quantity with same ratio.</p>
</p>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span6">
<p class="oe_mt32">
<p>Update the Produced Products records.</p>
</p>
</div>
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<img src="partial production.png">
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2>
<div class="oe_slogan" style="margin-top:10px !important;">
<div>
<a class="btn btn-primary btn-lg mt8"
style="color: #FFFFFF !important;border-radius: 0;" href="https://www.cybrosys.com"><i
class="fa fa-envelope"></i> Email </a> <a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;"
href="https://www.cybrosys.com/contact/"><i
class="fa fa-phone"></i> Contact Us </a> <a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;"
href="https://www.cybrosys.com/odoo-customization-and-installation/"><i
class="fa fa-check-square"></i> Request Customization </a>
</div>
<br>
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block">
<div>
<a href="https://twitter.com/cybrosys" target="_blank"><i class="fa fa-2x fa-twitter" style="color:white;background: #00a0d1;width:35px;"></i></a></td>
<a href="https://www.linkedin.com/company/cybrosys-technologies-pvt-ltd" target="_blank"><i class="fa fa-2x fa-linkedin" style="color:white;background: #31a3d6;width:35px;padding-left: 3px;"></i></a></td>
<a href="https://www.facebook.com/cybrosystechnologies" target="_blank"><i class="fa fa-2x fa-facebook" style="color:white;background: #3b5998;width:35px;padding-left: 8px;"></i></a></td>
<a href="https://plus.google.com/106641282743045431892/about" target="_blank"><i class="fa fa-2x fa-google-plus" style="color:white;background: #c53c2c;width:35px;padding-left: 3px;"></i></a></td>
<a href="https://in.pinterest.com/cybrosys" target="_blank"><i class="fa fa-2x fa-pinterest" style="color:white;background: #ac0f18;width:35px;padding-left: 3px;"></i></a></td>
</div>
</div>
</section>

BIN
mrp_secondary_uom/static/description/partial production.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
mrp_secondary_uom/static/description/update.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

64
mrp_secondary_uom/views/mrp_sec_uom.xml

@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="mrp_production_sec_uom_form_view" model="ir.ui.view">
<field name="name">mrp.production.uom.form</field>
<field name="model">mrp.production</field>
<field name="inherit_id" ref="mrp.mrp_production_form_view"/>
<field name="arch" type="xml">
<!--*********************IN MO Form****************************************-->
<xpath expr="//field[@name='bom_id']" position="before">
<label for="mrp_sec_qty" string="Product Secondary Quantity"/>
<div class="o_row">
<field name="mrp_sec_qty" attrs="{'readonly': [('has_moves', '=', True)]}" style="width:94px;"/>
<field name="mrp_sec_uom" attrs="{'readonly': [('has_moves', '=', True)]}" style="width:100px;" groups="product.group_uom"/>
<field name="mrp_ratio_sec_uom" invisible="1"/>
</div>
</xpath>
<!--*********************STOCK MOVES IN MO****************************************-->
<xpath expr="//notebook/page[2]/field[@name='move_finished_ids']/tree/field[@name='product_uom_qty']" position="after">
<field name="stock_move_sec_qty_to_produce"/>
</xpath>
<xpath expr="//notebook/page[2]/field[@name='move_finished_ids']/tree/field[@name='quantity_done']" position="after">
<field name="stock_move_sec_qty_produced"/>
<field name="stock_move_sec_uom" groups="product.group_uom"/>
<field name="ratio_sec_uom" invisible="1" />
</xpath>
<!--******************************************************************************-->
</field>
</record>
<!--*********************Update wizard****************************************-->
<record id="view_mrp_product_produce_wizard_sec_uom" model="ir.ui.view">
<field name="name">MRP Product Produce</field>
<field name="model">mrp.product.produce</field>
<field name="inherit_id" ref="mrp.view_mrp_product_produce_wizard"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='product_tracking']" position="before">
<!--<div class="o_row">-->
<!--<field name="product_qty" class="oe_inline" colspan="2"/>-->
<!--<field name="product_uom_id" style="width:94px;" readonly="1" groups="product.group_uom"/>-->
<!--</div>-->
<field name="ratio_sec_uom" invisible="1"/>
<field name="product_produce_sec_qty" />
<field name="product_produce_sec_uom" options='{"no_open":True}' readonly="1" groups="product.group_uom"/>
</xpath>
<!--******************************************************************************-->
</field>
</record>
<!--*********************Change Product Quantity And Secondary UoM****************************************-->
<record id="view_change_production_mrp_sec_qty_wizard" model="ir.ui.view">
<field name="name">Change Product Qty</field>
<field name="model">change.production.qty</field>
<field name="inherit_id" ref="mrp.view_change_production_qty_wizard"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='product_qty']" position="after">
<field name="mrp_sec_qty"/>
<field name="mrp_sec_uom" style="width:96px;" groups="product.group_uom"/>
</xpath>
</field>
</record>
</data>
</odoo>
Loading…
Cancel
Save