bzr revid: hmo@tinyerp.com-20100712112332-e1uhmq93a2jesv0z
This commit is contained in:
Harry (OpenERP)
2010-07-12 16:53:32 +05:30
11 changed files with 117 additions and 26 deletions
+1
View File
@@ -69,6 +69,7 @@
'wizard/change_production_qty_view.xml',
'wizard/mrp_price_view.xml',
'wizard/mrp_workcenter_load_view.xml',
'wizard/mrp_change_standard_price_view.xml',
# 'wizard/mrp_track_prod_view.xml',
'mrp_view.xml',
'mrp_wizard.xml',
+4 -3
View File
@@ -63,11 +63,12 @@ class product_product(osv.osv):
"""
res = super(product_product, self).do_change_standard_price(cr, uid, ids, datas, context=context)
bom_obj = self.pool.get('mrp.bom')
change = context.get('change_parent_price', False)
def _compute_price(bom):
price = 0.0
if bom.bom_id :
if bom.bom_id.bom_lines :
for bom_line in bom.bom_id.bom_lines :
if bom.bom_id and change:
if bom.bom_id.bom_lines:
for bom_line in bom.bom_id.bom_lines:
prod_price = self.read(cr, uid, bom_line.product_id.id, ['standard_price'])['standard_price']
price += bom_line.product_qty * prod_price
+2 -2
View File
@@ -265,10 +265,10 @@
<para style="terp_default_Centre_8">[[ formatLang(o.date_planned, date_time = True) ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ o.sale_ref or removeParentNode('para')]]</para>
<para style="terp_default_Centre_8">[[ 'sale_ref' in o._columns.keys() and o.sale_ref or removeParentNode('para') ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ o.sale_name or removeParentNode('para') ]]</para>
<para style="terp_default_Centre_8">[[ 'sale_name' in o._columns.keys() and o.sale_name or removeParentNode('para') ]]</para>
</td>
</tr>
</blockTable>
+1
View File
@@ -24,6 +24,7 @@ import mrp_price
import mrp_workcenter_load
#import mrp_track_prod
import change_production_qty
import mrp_change_standard_price
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -0,0 +1,48 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# 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 osv import fields, osv
class change_standard_price(osv.osv_memory):
_inherit = "stock.change.standard.price"
_description = "Change Standard Price"
_columns = {
'change_parent_price': fields.boolean('Change Parent Price'),
}
def change_price(self, cr, uid, ids, context):
""" Changes the Standard Price of Parent Product according to BoM
only when the field 'change_parent_price' is True.
And creates an account move accordingly.
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
@param ids: List of IDs selected
@param context: A standard dictionary
@return:
"""
res = self.browse(cr, uid, ids)
context.update({'change_parent_price': res[0].change_parent_price})
return super(change_standard_price, self).change_price(cr, uid, ids, context=context)
change_standard_price()
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_change_standard_price_inherit" model="ir.ui.view">
<field name="name">Change Standard Price (Inherit)</field>
<field name="model">stock.change.standard.price</field>
<field name="inherit_id" ref="stock.view_change_standard_price"/>
<field name="type">form</field>
<field name="arch" type="xml">
<field name="new_price" position="after">
<field name="change_parent_price"/>
</field>
</field>
</record>
</data>
</openerp>
+36 -13
View File
@@ -4,6 +4,41 @@
<menuitem id="menu_mrp_planning" name="Planning"
parent="base.menu_mrp_root" sequence="2"
groups="base.group_extended"/>
<record id="mrp_production_form_inherit_view" model="ir.ui.view">
<field name="name">mrp.production.form.inherit</field>
<field name="model">mrp.production</field>
<field name="type">form</field>
<field name="inherit_id" ref="mrp.mrp_production_form_view"/>
<field name="arch" type="xml">
<xpath expr="/form/notebook/page/field[@name='workcenter_lines']/form/field[@name='hour']" position="after">
<group colspan="8" col="8">
<field name="state"/>
<button name="button_draft" string="Set Draft" states="cancel" icon="gtk-convert"/>
<button name="button_start_working" string="Start" states="draft" icon="gtk-go-forward"/>
<button name="button_resume" string="Resume" states="pause" icon="gtk-media-pause"/>
<button name="button_cancel" string="Cancel" states="draft,startworking" icon="gtk-cancel"/>
<button name="button_pause" string="Pause" states="startworking" icon="gtk-media-pause"/>
<button name="button_done" string="Finished" states="startworking" icon="gtk-ok"/>
</group>
</xpath>
</field>
</record>
<record id="mrp_production_form_inherit_view2" model="ir.ui.view">
<field name="name">mrp.production.form.inherit2</field>
<field name="model">mrp.production</field>
<field name="type">form</field>
<field name="inherit_id" ref="mrp.mrp_production_form_view"/>
<field name="arch" type="xml">
<xpath expr="/form/notebook/page/field[@name='workcenter_lines']/tree/field[@name='hour']" position="after">
<field name="state"/>
<button name="button_start_working" string="Start working" states="draft,pause" icon="gtk-go-forward"/>
<button name="button_done" string="Finished" states="startworking" icon="gtk-jump-to"/>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="mrp_production_workcenter_tree_view_inherit">
<field name="name">mrp.production.workcenter.line.tree</field>
<field name="model">mrp.production.workcenter.line</field>
@@ -150,7 +185,7 @@
</record>
<!-- Action for tree view of workcenter line -->
<!-- Action for All Operations -->
<record model="ir.actions.act_window" id="mrp_production_wc_action_form">
<field name="name">Work Orders</field>
@@ -158,21 +193,9 @@
<field name="res_model">mrp.production.workcenter.line</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,gantt,calendar,graph</field>
<field name="domain">[('id','=',active_id)]</field>
<field name="search_view_id" ref="view_mrp_production_workcenter_form_view_filter"/>
</record>
<!-- Action for All Operations -->
<record model="ir.actions.act_window" id="mrp_production_wc_action">
<field name="name">All Work Orders</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.production.workcenter.line</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,graph,calendar,gantt</field>
</record>
<record model="ir.actions.act_window" id="mrp_production_wc_action_planning">
<field name="name">Work Orders Planning</field>
<field name="type">ir.actions.act_window</field>
+3 -3
View File
@@ -276,9 +276,9 @@
<font color="white"> </font>
</para>
</section>
<para style="terp_default_5cm_Above_Space">[[ (line.state == 'done' or line.state == 'confirmed') and removeParentNode('para') ]]</para>
<para style="terp_default_Bold_9">Non Assigned Products: [[ ( line.state == 'assigned' or line.state == 'done' or line.state == 'confirmed' ) and removeParentNode('para') ]]</para>
<para style="terp_default_1cm_above_space">[[ (line.state == 'done' or line.state == 'confirmed') and removeParentNode('para') ]]</para>
<para style="terp_default_5cm_Above_Space">[[ (move_lines.state == 'done' or move_lines.state == 'confirmed') and removeParentNode('para') ]]</para>
<para style="terp_default_Bold_9">Non Assigned Products: [[ ( move_lines.state == 'assigned' or move_lines.state == 'done' or move_lines.state == 'confirmed' ) and removeParentNode('para') ]]</para>
<para style="terp_default_1cm_above_space">[[ (move_lines.state == 'done' or move_lines.state == 'confirmed') and removeParentNode('para') ]]</para>
<section>
<para style="terp_default_8">[[ repeatIn([line for line in picking.move_lines if (line.state != 'assigned' )],'move_lines') ]]</para>
<blockTable colWidths="197.0,68.0,61.0,57,46.0,26.0,74.0" style="Move_Line_Content_Other_State">
+3 -3
View File
@@ -268,9 +268,9 @@
<font color="white"> </font>
</para>
</section>
<para style="terp_default_5cm_Above_Space">[[ (line.state == 'done' or line.state == 'confirmed') and removeParentNode('para') ]]</para>
<para style="terp_default_Bold_9">Non Assigned Products: [[ ( line.state == 'assigned' or line.state == 'done' or line.state == 'confirmed' ) and removeParentNode('para') ]]</para>
<para style="terp_default_1cm_above_space">[[ (line.state == 'done' or line.state == 'confirmed') and removeParentNode('para') ]]</para>
<para style="terp_default_5cm_Above_Space">[[ (move_lines.state == 'done' or move_lines.state == 'confirmed') and removeParentNode('para') ]]</para>
<para style="terp_default_Bold_9">Non Assigned Products: [[ ( move_lines.state == 'assigned' or move_lines.state == 'done' or move_lines.state == 'confirmed' ) and removeParentNode('para') ]]</para>
<para style="terp_default_1cm_above_space">[[ (move_lines.state == 'done' or move_lines.state == 'confirmed') and removeParentNode('para') ]]</para>
<section>
<para style="terp_default_8">[[ repeatIn([line for line in picking.move_lines if (line.state != 'assigned' )],'move_lines') ]]</para>
<blockTable colWidths="257.0,57.0,62.0,46.0,26.0,74.0" style="Move_Line_Content_Other_State">
+1 -1
View File
@@ -43,7 +43,7 @@ This module may be useful for different purposes:
'demo_xml': [],
'installable': True,
'test':[
# 'test/stock_location.yml'
'test/stock_location.yml'
],
'active': False,
'certificate': '0046505115101',
@@ -159,7 +159,7 @@
country_id: base.in
partner_id: res_partner_microlinktechnologies0
street: Ash House, Ash Road
title: Ms.
title: base.res_partner_title_miss
-