Partial port of mrp_average_cost (I just maked it installable)
This commit is contained in:
@@ -1,3 +1 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from . import mrp
|
from . import mrp
|
||||||
|
|||||||
@@ -1,29 +1,11 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
##############################################################################
|
# Copyright (C) 2016-2019 Akretion (http://www.akretion.com)
|
||||||
#
|
|
||||||
# MRP Average Cost module for Odoo
|
|
||||||
# Copyright (C) 2016 Akretion (http://www.akretion.com)
|
|
||||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
#
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
# This program is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU Affero General Public License as
|
|
||||||
# published by the Free Software Foundation, either version 3 of the
|
|
||||||
# License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# 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 Affero General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU Affero General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
'name': 'MRP Average Cost',
|
'name': 'MRP Average Cost',
|
||||||
'version': '0.1',
|
'version': '12.0.1.0.0',
|
||||||
'category': 'Manufactuing',
|
'category': 'Manufactuing',
|
||||||
'license': 'AGPL-3',
|
'license': 'AGPL-3',
|
||||||
'summary': 'Update standard_price upon validation of a manufacturing order',
|
'summary': 'Update standard_price upon validation of a manufacturing order',
|
||||||
@@ -37,7 +19,7 @@ This module adds this feature : when you validate a manufacturing order of a pro
|
|||||||
|
|
||||||
Together with this module, I recommend the use of my module product_usability, available in the same branch, which contains a backport of the model product.price.history from v8 to v7.
|
Together with this module, I recommend the use of my module product_usability, available in the same branch, which contains a backport of the model product.price.history from v8 to v7.
|
||||||
|
|
||||||
Please contact Alexis de Lattre from Akretion <alexis.delattre@akretion.com> for any help or question about this module.
|
This module has been written by Alexis de Lattre from Akretion <alexis.delattre@akretion.com>.
|
||||||
""",
|
""",
|
||||||
'author': 'Akretion',
|
'author': 'Akretion',
|
||||||
'website': 'http://www.akretion.com',
|
'website': 'http://www.akretion.com',
|
||||||
@@ -1,50 +1,30 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
##############################################################################
|
# Copyright (C) 2016-2019 Akretion (http://www.akretion.com)
|
||||||
#
|
|
||||||
# MRP Average Cost module for Odoo
|
|
||||||
# Copyright (C) 2016 Akretion (http://www.akretion.com)
|
|
||||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
#
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
# This program is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU Affero General Public License as
|
|
||||||
# published by the Free Software Foundation, either version 3 of the
|
|
||||||
# License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# 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 Affero General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU Affero General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
from openerp.osv import orm, fields
|
from odoo import models, fields, api, _
|
||||||
from openerp.tools.translate import _
|
import odoo.addons.decimal_precision as dp
|
||||||
import openerp.addons.decimal_precision as dp
|
from odoo.tools import float_compare, float_is_zero
|
||||||
from openerp.tools import float_compare, float_is_zero
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class MrpBomLabourLine(orm.Model):
|
class MrpBomLabourLine(models.Model):
|
||||||
_name = 'mrp.bom.labour.line'
|
_name = 'mrp.bom.labour.line'
|
||||||
_description = 'Labour lines on BOM'
|
_description = 'Labour lines on BOM'
|
||||||
|
|
||||||
_columns = {
|
bom_id = fields.Many2one(
|
||||||
'bom_id': fields.many2one(
|
'mrp.bom', string='Labour Lines', ondelete='cascade')
|
||||||
'mrp.bom', 'Labour Lines', ondelete='cascade'),
|
labour_time = fields.Float(
|
||||||
'labour_time': fields.float(
|
string='Labour Time', required=True,
|
||||||
'Labour Time', required=True,
|
digits=dp.get_precision('Labour Hours'),
|
||||||
digits_compute=dp.get_precision('Labour Hours'),
|
|
||||||
help="Average labour time for the production of "
|
help="Average labour time for the production of "
|
||||||
"items of the BOM, in hours."),
|
"items of the BOM, in hours.")
|
||||||
'labour_cost_profile_id': fields.many2one(
|
labour_cost_profile_id = fields.Many2one(
|
||||||
'labour.cost.profile', 'Labour Cost Profile', required=True),
|
'labour.cost.profile', string='Labour Cost Profile', required=True)
|
||||||
'note': fields.text('Note'),
|
note = fields.Text(string='Note')
|
||||||
}
|
|
||||||
|
|
||||||
_sql_constraints = [(
|
_sql_constraints = [(
|
||||||
'labour_time_positive',
|
'labour_time_positive',
|
||||||
@@ -52,86 +32,67 @@ class MrpBomLabourLine(orm.Model):
|
|||||||
"The value of the field 'Labour Time' must be positive or 0.")]
|
"The value of the field 'Labour Time' must be positive or 0.")]
|
||||||
|
|
||||||
|
|
||||||
class MrpBom(orm.Model):
|
class MrpBom(models.Model):
|
||||||
_inherit = 'mrp.bom'
|
_inherit = 'mrp.bom'
|
||||||
|
|
||||||
def _compute_total_labour_cost(
|
@api.depends('labour_line_ids.labour_time', 'labour_line_ids.labour_cost_profile_id.hour_cost')
|
||||||
self, cr, uid, ids, name, arg, context=None):
|
def _compute_total_labour_cost(self):
|
||||||
res = {}
|
for bom in self:
|
||||||
for bom in self.browse(cr, uid, ids, context=context):
|
|
||||||
cost = 0.0
|
cost = 0.0
|
||||||
for lline in bom.labour_line_ids:
|
for lline in bom.labour_line_ids:
|
||||||
cost += lline.labour_time * lline.labour_cost_profile_id.hour_cost
|
cost += lline.labour_time * lline.labour_cost_profile_id.hour_cost
|
||||||
res[bom.id] = cost
|
bom.total_labour_cost = cost
|
||||||
return res
|
|
||||||
|
|
||||||
def _get_bom_from_labour_lines(self, cr, uid, ids, context=None):
|
@api.depends('bom_line_ids.product_id.standard_price', 'total_labour_cost', 'extra_cost')
|
||||||
return self.pool['mrp.bom'].search(
|
def _compute_total_cost(self):
|
||||||
cr, uid, [('labour_line_ids', 'in', ids)], context=context)
|
|
||||||
|
|
||||||
def _get_bom_from_cost_profile(self, cr, uid, ids, context=None):
|
|
||||||
labour_line_ids = self.pool['mrp.bom.labour.line'].search(
|
|
||||||
cr, uid, [('labour_cost_profile_id', 'in', ids)], context=context)
|
|
||||||
return self.pool['mrp.bom'].search(
|
|
||||||
cr, uid, [('labour_line_ids', 'in', labour_line_ids)], context=context)
|
|
||||||
|
|
||||||
def _compute_total_cost(
|
|
||||||
self, cr, uid, ids, name, arg, context=None):
|
|
||||||
res = {}
|
|
||||||
puo = self.pool['product.uom']
|
puo = self.pool['product.uom']
|
||||||
for bom in self.browse(cr, uid, ids, context=context):
|
for bom in self:
|
||||||
component_cost = 0.0
|
component_cost = 0.0
|
||||||
for line in bom.bom_lines:
|
for line in bom.bom_line_ids:
|
||||||
component_price = line.product_id.standard_price
|
component_price = line.product_id.standard_price
|
||||||
component_qty_product_uom = puo._compute_qty_obj(
|
component_qty_product_uom = puo._compute_qty_obj(
|
||||||
cr, uid, line.product_uom, line.product_qty,
|
cr, uid, line.product_uom, line.product_qty,
|
||||||
line.product_id.uom_id, context=context)
|
line.product_id.uom_id, context=context) # TODO
|
||||||
component_cost += component_price * component_qty_product_uom
|
component_cost += component_price * component_qty_product_uom
|
||||||
total_cost = component_cost + bom.extra_cost + bom.total_labour_cost
|
total_cost = component_cost + bom.extra_cost + bom.total_labour_cost
|
||||||
res[bom.id] = {
|
bom.total_components_cost = component_cost
|
||||||
'total_components_cost': component_cost,
|
bom.total_cost = total_cost
|
||||||
'total_cost': total_cost,
|
|
||||||
}
|
|
||||||
return res
|
|
||||||
|
|
||||||
_columns = {
|
labour_line_ids = fields.One2many(
|
||||||
'labour_line_ids': fields.one2many(
|
'mrp.bom.labour.line', 'bom_id', string='Labour Lines')
|
||||||
'mrp.bom.labour.line', 'bom_id', 'Labour Lines'),
|
total_labour_cost = fields.Float(
|
||||||
'total_labour_cost': fields.function(
|
compute='_compute_total_labour_cost', readonly=True,
|
||||||
_compute_total_labour_cost, type='float', readonly=True,
|
digits=dp.get_precision('Product Price'),
|
||||||
digits_compute=dp.get_precision('Product Price'),
|
string="Total Labour Cost", store=True)
|
||||||
string="Total Labour Cost", store={
|
extra_cost = fields.Float(
|
||||||
'labour.cost.profile': (_get_bom_from_cost_profile, [
|
string='Extra Cost', track_visibility='onchange',
|
||||||
'hour_cost', 'company_id'], 10),
|
digits=dp.get_precision('Product Price'),
|
||||||
'mrp.bom.labour.line': (_get_bom_from_labour_lines, [
|
|
||||||
'bom_id', 'labour_time', 'labour_cost_profile_id'], 20),
|
|
||||||
}),
|
|
||||||
'extra_cost': fields.float(
|
|
||||||
'Extra Cost', track_visibility='onchange',
|
|
||||||
digits_compute=dp.get_precision('Product Price'),
|
|
||||||
help="Extra cost for the production of the quantity of "
|
help="Extra cost for the production of the quantity of "
|
||||||
"items of the BOM, in company currency. "
|
"items of the BOM, in company currency. "
|
||||||
"You can use this field to enter the cost of the consumables "
|
"You can use this field to enter the cost of the consumables "
|
||||||
"that are used to produce the product but are not listed in "
|
"that are used to produce the product but are not listed in "
|
||||||
"the BOM"),
|
"the BOM")
|
||||||
'total_components_cost': fields.function(
|
total_components_cost = fields.Float(
|
||||||
_compute_total_cost, type='float', readonly=True,
|
compute='_compute_total_cost', readonly=True,
|
||||||
digits_compute=dp.get_precision('Product Price'),
|
digits=dp.get_precision('Product Price'),
|
||||||
multi='total-cost', string='Total Components Cost'),
|
string='Total Components Cost')
|
||||||
'total_cost': fields.function(
|
total_cost = fields.Float(
|
||||||
_compute_total_cost, type='float', readonly=True,
|
compute='_compute_total_cost', readonly=True,
|
||||||
multi='total-cost', string='Total Cost',
|
string='Total Cost',
|
||||||
digits_compute=dp.get_precision('Product Price'),
|
digits=dp.get_precision('Product Price'),
|
||||||
help="Total Cost = Total Components Cost + "
|
help="Total Cost = Total Components Cost + "
|
||||||
"Total Labour Cost + Extra Cost"),
|
"Total Labour Cost + Extra Cost")
|
||||||
'company_currency_id': fields.related(
|
company_currency_id = fields.Many2one(
|
||||||
'company_id', 'currency_id', readonly=True, type='many2one',
|
related='company_id.currency_id', readonly=True,
|
||||||
relation='res.currency', string='Company Currency'),
|
string='Company Currency')
|
||||||
# to display in bom lines
|
# to display in bom lines
|
||||||
'standard_price': fields.related(
|
|
||||||
'product_id', 'standard_price', readonly=True,
|
class MrpBomLine(models.Model):
|
||||||
type='float', string='Standard Price')
|
_inherit = 'mrp.bom.line'
|
||||||
}
|
|
||||||
|
standard_price = fields.Float(
|
||||||
|
related='product_id.standard_price', readonly=True,
|
||||||
|
string='Standard Price')
|
||||||
|
|
||||||
def manual_update_product_standard_price(self, cr, uid, ids, context=None):
|
def manual_update_product_standard_price(self, cr, uid, ids, context=None):
|
||||||
if context is None:
|
if context is None:
|
||||||
@@ -167,58 +128,50 @@ class MrpBom(orm.Model):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
class LabourCostProfile(orm.Model):
|
class LabourCostProfile(models.Model):
|
||||||
_name = 'labour.cost.profile'
|
_name = 'labour.cost.profile'
|
||||||
_inherit = ['mail.thread']
|
_inherit = ['mail.thread']
|
||||||
_description = 'Labour Cost Profile'
|
_description = 'Labour Cost Profile'
|
||||||
|
|
||||||
_columns = {
|
name = fields.Char(
|
||||||
'name': fields.char(
|
string='Name', required=True, track_visibility='onchange')
|
||||||
'Name', required=True, track_visibility='onchange'),
|
hour_cost = fields.Float(
|
||||||
'hour_cost': fields.float(
|
string='Cost per Hour', required=True,
|
||||||
'Cost per Hour', required=True,
|
digits=dp.get_precision('Product Price'),
|
||||||
digits_compute=dp.get_precision('Product Price'),
|
|
||||||
track_visibility='onchange',
|
track_visibility='onchange',
|
||||||
help="Labour cost per hour per person in company currency"),
|
help="Labour cost per hour per person in company currency")
|
||||||
'company_id': fields.many2one('res.company', 'Company', required=True),
|
company_id = fields.Many2one(
|
||||||
'company_currency_id': fields.related(
|
'res.company', string='Company', required=True,
|
||||||
'company_id', 'currency_id', readonly=True, type='many2one',
|
default=lambda self: self.env['res.company']._company_default_get())
|
||||||
relation='res.currency', string='Company Currency')
|
company_currency_id = fields.Many2one(
|
||||||
}
|
related='company_id.currency_id', readonly=True, store=True,
|
||||||
|
string='Company Currency')
|
||||||
|
|
||||||
_defaults = {
|
@api.depends('name', 'hour_cost', 'company_currency_id.symbol')
|
||||||
'company_id': lambda self, cr, uid, context:
|
def name_get(self):
|
||||||
self.pool['res.company']._company_default_get(
|
|
||||||
cr, uid, 'labour.cost.profile', context=context),
|
|
||||||
}
|
|
||||||
|
|
||||||
def name_get(self, cr, uid, ids, context=None):
|
|
||||||
res = []
|
res = []
|
||||||
if isinstance(ids, (int, long)):
|
for record in self:
|
||||||
ids = [ids]
|
|
||||||
for record in self.browse(cr, uid, ids, context=context):
|
|
||||||
res.append((record.id, u'%s (%s %s)' % (
|
res.append((record.id, u'%s (%s %s)' % (
|
||||||
record.name, record.hour_cost,
|
record.name, record.hour_cost,
|
||||||
record.company_currency_id.symbol)))
|
record.company_currency_id.symbol)))
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|
||||||
class MrpProduction(orm.Model):
|
class MrpProduction(models.Model):
|
||||||
_inherit = 'mrp.production'
|
_inherit = 'mrp.production'
|
||||||
|
|
||||||
_columns = {
|
unit_cost = fields.Float(
|
||||||
'unit_cost': fields.float(
|
string='Unit Cost', readonly=True,
|
||||||
'Unit Cost', readonly=True,
|
digits=dp.get_precision('Product Price'),
|
||||||
digits_compute=dp.get_precision('Product Price'),
|
|
||||||
help="This cost per unit in the unit of measure of the product "
|
help="This cost per unit in the unit of measure of the product "
|
||||||
"in company currency takes into account "
|
"in company currency takes into account "
|
||||||
"the cost of the raw materials and the labour cost defined on"
|
"the cost of the raw materials and the labour cost defined on"
|
||||||
"the BOM."),
|
"the BOM.")
|
||||||
'company_currency_id': fields.related(
|
company_currency_id = fields.Many2one(
|
||||||
'company_id', 'currency_id', readonly=True, type='many2one',
|
related='company_id.currency_id', readonly=True,
|
||||||
relation='res.currency', string='Company Currency'),
|
string='Company Currency')
|
||||||
}
|
|
||||||
|
|
||||||
|
# TODO port to v12
|
||||||
def compute_order_unit_cost(self, cr, uid, order, context=None):
|
def compute_order_unit_cost(self, cr, uid, order, context=None):
|
||||||
puo = self.pool['product.uom']
|
puo = self.pool['product.uom']
|
||||||
mo_total_price = 0.0 # In the UoM of the M0
|
mo_total_price = 0.0 # In the UoM of the M0
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<openerp>
|
<odoo noupdate="1">
|
||||||
<data noupdate="1">
|
|
||||||
|
|
||||||
<record forcecreate="True" id="labour_hours" model="decimal.precision">
|
<record forcecreate="True" id="labour_hours" model="decimal.precision">
|
||||||
<field name="name">Labour Hours</field>
|
<field name="name">Labour Hours</field>
|
||||||
@@ -16,10 +15,8 @@
|
|||||||
<field name="interval_type">days</field>
|
<field name="interval_type">days</field>
|
||||||
<field name="numbercall">-1</field> <!-- don't limit the number of calls -->
|
<field name="numbercall">-1</field> <!-- don't limit the number of calls -->
|
||||||
<field name="doall" eval="False"/>
|
<field name="doall" eval="False"/>
|
||||||
<field name="model" eval="'mrp.bom'"/>
|
<field name="model_id" ref="mrp.model_mrp_bom"/>
|
||||||
<field name="function" eval="'_phantom_update_product_standard_price'"/>
|
<field name="code">model._phantom_update_product_standard_price()</field>
|
||||||
<field name="args" eval="'()'"/>
|
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
</data>
|
</odoo>
|
||||||
</openerp>
|
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
Copyright (C) 2016 Akretion (http://www.akretion.com/)
|
Copyright (C) 2016-2019 Akretion (http://www.akretion.com/)
|
||||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
The licence is in the file __openerp__.py
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<openerp>
|
<odoo>
|
||||||
<data>
|
|
||||||
|
|
||||||
<record id="mrp_bom_form_view" model="ir.ui.view">
|
<record id="mrp_bom_form_view" model="ir.ui.view">
|
||||||
<field name="name">mrp_average_cost.mrp.bom.form</field>
|
<field name="name">mrp_average_cost.mrp.bom.form</field>
|
||||||
<field name="model">mrp.bom</field>
|
<field name="model">mrp.bom</field>
|
||||||
<field name="inherit_id" ref="mrp.mrp_bom_form_view"/>
|
<field name="inherit_id" ref="mrp.mrp_bom_form_view"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//div[@groups='mrp.group_mrp_routings']" position="after">
|
<field name="picking_type_id" position="after">
|
||||||
<field name="total_components_cost" widget="monetary"
|
<field name="total_components_cost" widget="monetary"
|
||||||
options="{'currency_field': 'company_currency_id'}"/>
|
options="{'currency_field': 'company_currency_id'}"/>
|
||||||
<field name="total_labour_cost" widget="monetary"
|
<field name="total_labour_cost" widget="monetary"
|
||||||
@@ -29,15 +29,15 @@
|
|||||||
string="Update Cost Price of Product" class="oe_link"/>
|
string="Update Cost Price of Product" class="oe_link"/>
|
||||||
</div>
|
</div>
|
||||||
<field name="company_currency_id" invisible="1"/>
|
<field name="company_currency_id" invisible="1"/>
|
||||||
</xpath>
|
</field>
|
||||||
<page string="Components" position="after">
|
<notebook position="inside">
|
||||||
<page string="Labour" name="labour_lines">
|
<page string="Labour" name="labour_lines">
|
||||||
<group name="labour_lines_grp">
|
<group name="labour_lines_grp">
|
||||||
<field name="labour_line_ids" nolabel="1"/>
|
<field name="labour_line_ids" nolabel="1"/>
|
||||||
</group>
|
</group>
|
||||||
</page>
|
</page>
|
||||||
</page>
|
</notebook>
|
||||||
<xpath expr="//field[@name='bom_lines']/tree/field[@name='product_uom']" position="after">
|
<xpath expr="//field[@name='bom_line_ids']/tree/field[@name='product_uom_id']" position="after">
|
||||||
<field name="standard_price"/>
|
<field name="standard_price"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
@@ -60,13 +60,12 @@
|
|||||||
<field name="name">mrp_bom_labour_line.form</field>
|
<field name="name">mrp_bom_labour_line.form</field>
|
||||||
<field name="model">mrp.bom.labour.line</field>
|
<field name="model">mrp.bom.labour.line</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="Labour Line" version="7.0">
|
<form string="Labour Line">
|
||||||
<group name="main">
|
<group name="main">
|
||||||
<field name="bom_id" invisible="not context.get('mrp_bom_labour_line_main_view')"/>
|
<field name="bom_id" invisible="not context.get('mrp_bom_labour_line_main_view')"/>
|
||||||
<label for="labour_time"/>
|
<label for="labour_time"/>
|
||||||
<div name="labour_time">
|
<div name="labour_time">
|
||||||
<field name="labour_time" class="oe_inline"/>
|
<field name="labour_time" class="oe_inline"/> hours
|
||||||
<label string="hours"/>
|
|
||||||
</div>
|
</div>
|
||||||
<field name="labour_cost_profile_id"/>
|
<field name="labour_cost_profile_id"/>
|
||||||
<field name="note"/>
|
<field name="note"/>
|
||||||
@@ -81,7 +80,7 @@
|
|||||||
<field name="name">labour_cost_profile_form</field>
|
<field name="name">labour_cost_profile_form</field>
|
||||||
<field name="model">labour.cost.profile</field>
|
<field name="model">labour.cost.profile</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="Labour Cost Profile" version="7.0">
|
<form string="Labour Cost Profile">
|
||||||
<group name="main">
|
<group name="main">
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
<field name="hour_cost" widget="monetary" options="{'currency_field': 'company_currency_id'}"/>
|
<field name="hour_cost" widget="monetary" options="{'currency_field': 'company_currency_id'}"/>
|
||||||
@@ -111,14 +110,14 @@
|
|||||||
</record>
|
</record>
|
||||||
|
|
||||||
<menuitem id="labour_cost_profile_menu" action="labour_cost_profile_action"
|
<menuitem id="labour_cost_profile_menu" action="labour_cost_profile_action"
|
||||||
parent="mrp.menu_mrp_configuration"/>
|
parent="mrp.menu_mrp_configuration" sequence="200"/>
|
||||||
|
|
||||||
<record id="mrp_production_form_view" model="ir.ui.view">
|
<record id="mrp_production_form_view" model="ir.ui.view">
|
||||||
<field name="name">mrp_average_cost.mrp_production_form</field>
|
<field name="name">mrp_average_cost.mrp_production_form</field>
|
||||||
<field name="inherit_id" ref="mrp.mrp_production_form_view"/>
|
<field name="inherit_id" ref="mrp.mrp_production_form_view"/>
|
||||||
<field name="model">mrp.production</field>
|
<field name="model">mrp.production</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<field name="date_finished" position="after">
|
<field name="availability" position="after">
|
||||||
<field name="unit_cost" widget="monetary" options="{'currency_field': 'company_currency_id'}" attrs="{'invisible': [('state', '!=', 'done')]}"/>
|
<field name="unit_cost" widget="monetary" options="{'currency_field': 'company_currency_id'}" attrs="{'invisible': [('state', '!=', 'done')]}"/>
|
||||||
<field name="company_currency_id" invisible="1"/>
|
<field name="company_currency_id" invisible="1"/>
|
||||||
</field>
|
</field>
|
||||||
@@ -126,5 +125,4 @@
|
|||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|
||||||
</data>
|
</odoo>
|
||||||
</openerp>
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||||
access_labour_cost_profile_read,Read access on labour.cost.profile to MRP user,model_labour_cost_profile,mrp.group_mrp_user,1,0,0,0
|
access_labour_cost_profile_read,Read access on labour.cost.profile to MRP user,model_labour_cost_profile,mrp.group_mrp_user,1,0,0,0
|
||||||
access_labour_cost_profile_read_sale,Read access on labour.cost.profile to Sale user,model_labour_cost_profile,base.group_sale_salesman,1,0,0,0
|
access_labour_cost_profile_read_sale,Read access on labour.cost.profile to Sale user,model_labour_cost_profile,sales_team.group_sale_salesman,1,0,0,0
|
||||||
access_labour_cost_profile_read_stock,Read access on labour.cost.profile to Stock user,model_labour_cost_profile,stock.group_stock_user,1,0,0,0
|
access_labour_cost_profile_read_stock,Read access on labour.cost.profile to Stock user,model_labour_cost_profile,stock.group_stock_user,1,0,0,0
|
||||||
access_labour_cost_profile_full,Full access on labour.cost.profile to MRP manager,model_labour_cost_profile,mrp.group_mrp_manager,1,1,1,1
|
access_labour_cost_profile_full,Full access on labour.cost.profile to MRP manager,model_labour_cost_profile,mrp.group_mrp_manager,1,1,1,1
|
||||||
access_mrp_bom_labour_line_read,Read access on mrp.bom.labour.line to MRP user,model_mrp_bom_labour_line,mrp.group_mrp_user,1,0,0,0
|
access_mrp_bom_labour_line_read,Read access on mrp.bom.labour.line to MRP user,model_mrp_bom_labour_line,mrp.group_mrp_user,1,0,0,0
|
||||||
access_mrp_bom_labour_line_read_sale,Read access on mrp.bom.labour.line to Sale user,model_mrp_bom_labour_line,base.group_sale_salesman,1,0,0,0
|
access_mrp_bom_labour_line_read_sale,Read access on mrp.bom.labour.line to Sale user,model_mrp_bom_labour_line,sales_team.group_sale_salesman,1,0,0,0
|
||||||
access_mrp_bom_labour_line_read_stock,Read access on mrp.bom.labour.line to Stock user,model_mrp_bom_labour_line,stock.group_stock_user,1,0,0,0
|
access_mrp_bom_labour_line_read_stock,Read access on mrp.bom.labour.line to Stock user,model_mrp_bom_labour_line,stock.group_stock_user,1,0,0,0
|
||||||
access_mrp_bom_labour_line_full,Full access on mrp.bom.labour.line to MRP manager,model_mrp_bom_labour_line,mrp.group_mrp_manager,1,1,1,1
|
access_mrp_bom_labour_line_full,Full access on mrp.bom.labour.line to MRP manager,model_mrp_bom_labour_line,mrp.group_mrp_manager,1,1,1,1
|
||||||
|
|||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<openerp>
|
<odoo noupdate="1">
|
||||||
<data noupdate="1">
|
|
||||||
|
|
||||||
<record id="labour_cost_profile_rule" model="ir.rule">
|
<record id="labour_cost_profile_rule" model="ir.rule">
|
||||||
<field name="name">Labour Cost Profile multi-company</field>
|
<field name="name">Labour Cost Profile multi-company</field>
|
||||||
@@ -8,5 +7,4 @@
|
|||||||
<field name="domain_force">['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])]</field>
|
<field name="domain_force">['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])]</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
</data>
|
</odoo>
|
||||||
</openerp>
|
|
||||||
|
|||||||
Reference in New Issue
Block a user