[MERGE]: Merge with lp:openobject-trunk-dev-addons2

bzr revid: ksa@tinyerp.co.in-20101123051658-lwxejhtmdt7rl3sb
This commit is contained in:
ksa (Open ERP)
2010-11-23 10:46:58 +05:30
10 changed files with 30 additions and 58 deletions
+2 -19
View File
@@ -53,22 +53,11 @@ class mrp_workcenter(osv.osv):
'costs_journal_id': fields.many2one('account.analytic.journal', 'Analytic Journal'),
'costs_general_account_id': fields.many2one('account.account', 'General Account', domain=[('type','<>','view')]),
'resource_id': fields.many2one('resource.resource','Resource', ondelete='cascade', required=True),
'product_id': fields.many2one('product.product','Product'),
}
_defaults = {
'capacity_per_cycle': 1.0,
'resource_type': 'material',
}
def on_change_product_cost(self, cr, uid, ids, product_id, context=None):
if context is None:
context = {}
res = {'value':{}}
if product_id:
cost = self.pool.get('product.product').browse(cr, uid, product_id, context=context)
res = {'value' : {'costs_hour' :cost.standard_price }}
return res
mrp_workcenter()
@@ -748,10 +737,7 @@ class mrp_production(osv.osv):
'account_id': account,
'general_account_id': wc.costs_general_account_id.id,
'journal_id': wc.costs_journal_id.id,
'ref': wc.code,
'product_id': wc.product_id.id,
'unit_amount': wc.costs_hour * wc.time_cycle,
'product_uom_id': wc.product_id.uom_id.id
'code': wc.code
} )
if wc.costs_journal_id and wc.costs_general_account_id:
value = wc_line.cycle * wc.costs_cycle
@@ -764,10 +750,7 @@ class mrp_production(osv.osv):
'account_id': account,
'general_account_id': wc.costs_general_account_id.id,
'journal_id': wc.costs_journal_id.id,
'ref': wc.code,
'product_id': wc.product_id.id,
'unit_amount': wc.costs_hour * wc.time_cycle,
'product_uom_id': wc.product_id.uom_id.id
'code': wc.code,
} )
return amount
+12 -13
View File
@@ -160,13 +160,12 @@
</group>
<group col="2" colspan="2">
<separator colspan="2" string="Costing Information"/>
<field name="product_id" on_change="on_change_product_cost(product_id)"/>
<field name="costs_hour"/>
<field name="costs_hour_account_id" groups="analytic.group_analytic_accounting"/>
<field name="costs_cycle"/>
<field name="costs_cycle_account_id" groups="analytic.group_analytic_accounting"/>
<field name="costs_journal_id" attrs="{'required':['|',('costs_hour_account_id', '=', True),('costs_cycle_account_id', '=', True)]}" groups="analytic.group_analytic_accounting"/>
<field name="costs_general_account_id" attrs="{ 'required':['|',('costs_cycle_account_id', '=', True),('costs_hour_account_id', '=', True)]}" groups="analytic.group_analytic_accounting"/>
<field name="costs_journal_id" groups="analytic.group_analytic_accounting"/>
<field name="costs_general_account_id" groups="analytic.group_analytic_accounting"/>
</group>
<separator colspan="4" string="Description"/>
<field colspan="4" name="note" nolabel="1"/>
@@ -584,8 +583,8 @@
<page string="Consumed Products">
<field name="bom_id" domain="[('product_id','=',product_id),('bom_id','=',False)]" on_change="bom_id_change(bom_id)"/>
<field name="routing_id" groups="base.group_extended" select="1" widget="selection"/>
<field name="location_src_id" domain="[('usage','=','internal')]" on_change="location_id_change(location_src_id,location_dest_id)" widget="selection"/>
<field name="location_dest_id" domain="[('usage','=','internal')]" widget="selection"/>
<field name="location_src_id" domain="[('usage','=','internal')]" on_change="location_id_change(location_src_id,location_dest_id)"/>
<field name="location_dest_id" domain="[('usage','=','internal')]"/>
<separator string="" colspan="4"/>
<field colspan="2" name="move_lines" nolabel="1" widget="one2many_list"
@@ -594,7 +593,7 @@
<field name="product_id" />
<field name="product_qty" string="Qty"/>
<field name="product_uom" string="UOM" widget="selection"/>
<field name="location_id" string="Source Loc." widget="selection"/>
<field name="location_id" string="Source Loc."/>
<field name="state" invisible="1"/>
<button name="%(stock.move_consume)d"
string="Consume Products" type="action"
@@ -613,7 +612,7 @@
<field name="product_id" readonly="1"/>
<field name="product_qty" readonly="1" string="Qty"/>
<field name="product_uom" readonly="1" string="UOM" widget="selection"/>
<field name="location_dest_id" readonly="1" string="Destination Loc." widget="selection"/>
<field name="location_dest_id" readonly="1" string="Destination Loc."/>
<field name="prodlot_id" context="{'product_id': product_id}"/>
<field name="state" invisible="1"/>
<field name="scrapped" invisible="1"/>
@@ -648,11 +647,11 @@
<field name="product_id" />
<field name="product_qty" string="Qty"/>
<field name="product_uom" string="UOM" widget="selection"/>
<field name="location_id" string="Source Loc." widget="selection"/>
<field name="location_id" string="Source Loc." />
<field name="state" invisible="1"/>
<button name="%(stock.action_partial_move)d"
string="Partial"
type="action" states="confirmed,assigned"
<button name="%(stock.action_partial_move)d"
string="Partial"
type="action" states="confirmed,assigned"
icon="gtk-justify-fill"/>
<button name="%(stock.move_scrap)d"
string="Scrap Products" type="action"
@@ -927,9 +926,9 @@
<menuitem action="mrp_workcenter_action" id="menu_view_resource_search_mrp" parent="menu_pm_resources_config" sequence="1"/>
<menuitem action="resource.action_resource_calendar_form" id="menu_view_resource_calendar_search_mrp" parent="menu_pm_resources_config" sequence="1"/>
<menuitem action="resource.action_resource_calendar_leave_tree" id="menu_view_resource_calendar_leaves_search_mrp" parent="menu_pm_resources_config" sequence="1"/>
<!-- Planning -->
<menuitem id="menu_mrp_planning" name="Planning"
parent="base.menu_mrp_root" sequence="2"
groups="base.group_extended"/>
+1 -1
View File
@@ -25,7 +25,7 @@ class mrp_price(osv.osv_memory):
_name = 'mrp.product_price'
_description = 'Product Price'
_columns = {
'number': fields.integer('Quantity', required=True, help="Specify quantity of products to produce or buy. Report of Cost structure will be displayed base on this quantity."),
'number': fields.integer('Quantity', required=True, help="Specify quantity of products to produce or buy. Report of Cost structure will be displayed base on this qunatity."),
}
_defaults = {
'number': 1,
+1 -2
View File
@@ -327,8 +327,7 @@ class product_template(osv.osv):
return True
_constraints = [
# As Per do changes given by lp bug : 543979
# (_check_uos, 'Error: UOS must be in a different category than the UOM', ['uos_id']),
(_check_uos, 'Error: UOS must be in a different category than the UOM', ['uos_id']),
(_check_uom, 'Error: The default UOM and the purchase UOM must be in the same category.', ['uom_id']),
]
+1 -1
View File
@@ -1551,7 +1551,7 @@ msgstr "Verkäufe je Verkäufer"
#. module: sale
#: view:sale.order:0
msgid "Logistic"
msgid "Logistics"
msgstr "Logistik"
#. module: sale
+1 -1
View File
@@ -70,7 +70,7 @@ class stock_picking(osv.osv):
def _get_price_unit_invoice(self, cursor, user, move_line, type):
if move_line.sale_line_id and move_line.sale_line_id.product_id.id == move_line.product_id.id:
from_uom_id = move_line.product_id.uom_id.id
to_uom_id = move_line.product_id.uos_id.id
to_uom_id = move_line.product_id.uos_id and move_line.product_id.uos_id.id or False
price = move_line.sale_line_id.price_unit
coeff = move_line.product_id.uos_coeff
if from_uom_id != to_uom_id and coeff != 0:
+2 -13
View File
@@ -1904,12 +1904,6 @@ class stock_move(osv.osv):
acc_variation = accounts.get('property_stock_variation', False)
journal_id = accounts['stock_journal']
if acc_dest == acc_variation:
raise osv.except_osv(_('Error!'), _('Can not create Journal Entry, Output Account on defined on this product and Variant account on category of this product is same.'))
if acc_src == acc_variation:
raise osv.except_osv(_('Error!'), _('Can not create Journal Entry, Input Account on defined on this product and Variant account on category of this product is same.'))
if not acc_src:
raise osv.except_osv(_('Error!'), _('There is no stock input account defined for this product or its category: "%s" (id: %d)') % \
(move.product_id.name, move.product_id.id,))
@@ -2422,11 +2416,6 @@ class stock_inventory(osv.osv):
return self.pool.get('stock.move').create(cr, uid, move_vals)
def action_done(self, cr, uid, ids, context=None):
""" Finished the inventory
@return: True
"""
if context is None:
context = {}
move_obj = self.pool.get('stock.move')
for inv in self.browse(cr, uid, ids, context=context):
move_obj.action_done(cr, uid, [x.id for x in inv.move_ids], context=context)
@@ -2434,7 +2423,7 @@ class stock_inventory(osv.osv):
return True
def action_confirm(self, cr, uid, ids, context=None):
""" Confirm the inventory and writes its finished date
""" Finishes the inventory and writes its finished date
@return: True
"""
if context is None:
@@ -2445,7 +2434,7 @@ class stock_inventory(osv.osv):
product_context = dict(context, compute_child=False)
location_obj = self.pool.get('stock.location')
for inv in self.browse(cr, uid, ids, context=context):
for inv in self.browse(cr, uid, ids):
move_ids = []
for line in inv.inventory_line_id:
pid = line.product_id.id
+3 -3
View File
@@ -100,7 +100,7 @@
<field name="prod_lot_id" groups="base.group_extended"/>
<button name="%(stock.action_view_stock_inventory_line_split)d"
string="Split inventory lines" groups="base.group_extended"
type="action" icon="terp-stock_effects-object-colorize" states="draft"/>
type="action" icon="terp-stock_effects-object-colorize" states="draft,confirm"/>
<field name="state" invisible="True"/>
</tree>
<form string="Products ">
@@ -1370,8 +1370,8 @@
<group colspan="2" col="2">
<separator colspan="2" string="Move Information"/>
<field name="name" string="Reason"/>
<field name="product_uos_qty" groups="product.product_uos" colspan="4"/>
<field name="product_uos" groups="product.product_uos" colspan="4"/>
<field name="product_uos_qty" groups="product.group_uos" colspan="4"/>
<field name="product_uos" groups="product.group_uos" colspan="4"/>
</group>
<group colspan="2" col="2">
+4 -3
View File
@@ -254,9 +254,6 @@ class split_in_production_lot(osv.osv_memory):
current_move = move_obj.copy(cr, uid, move.id, default_val)
new_move.append(current_move)
if inventory_id:
inventory_obj.write(cr, uid, inventory_id, {'move_ids': [(4, new_move[0])]}, context=context)
if quantity_rest == 0:
current_move = move.id
prodlot_id = False
@@ -277,6 +274,10 @@ class split_in_production_lot(osv.osv_memory):
update_val['state'] = move.state
move_obj.write(cr, uid, [move.id], update_val)
if inventory_id and new_move:
for m_id in new_move:
inventory_obj.write(cr, uid, inventory_id, {'move_ids': [(4, m_id)]}, context=context)
return new_move
split_in_production_lot()
+3 -2
View File
@@ -79,8 +79,9 @@ class stock_split_into(osv.osv_memory):
current_move = move_obj.copy(cr, uid, move.id, default_val)
new_move.append(current_move)
if inventory_id:
inventory_obj.write(cr, uid, inventory_id, {'move_ids': [(4, new_move[0])]}, context=context)
if inventory_id and new_move:
for m_id in new_move:
inventory_obj.write(cr, uid, inventory_id, {'move_ids': [(4, m_id)]}, context=context)
return {}
stock_split_into()