-
+
diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py
index cf203a60c7f..ecac11f856a 100644
--- a/addons/mrp/mrp.py
+++ b/addons/mrp/mrp.py
@@ -910,12 +910,11 @@ class mrp_production(osv.osv):
# Internal shipment is created for Stockable and Consumer Products
if production_line.product_id.type not in ('product', 'consu'):
return False
- move_name = _('PROD: %s') % production.name
source_location_id = production.location_src_id.id
if not destination_location_id:
destination_location_id = source_location_id
return stock_move.create(cr, uid, {
- 'name': move_name,
+ 'name': production.name,
'picking_id': shipment_id,
'product_id': production_line.product_id.id,
'product_qty': production_line.product_qty,
@@ -965,9 +964,8 @@ class mrp_production(osv.osv):
stock_move = self.pool.get('stock.move')
source_location_id = production.product_id.product_tmpl_id.property_stock_production.id
destination_location_id = production.location_dest_id.id
- move_name = _('PROD: %s') + production.name
data = {
- 'name': move_name,
+ 'name': production.name,
'date': production.date_planned,
'product_id': production.product_id.id,
'product_qty': production.product_qty,
@@ -990,12 +988,11 @@ class mrp_production(osv.osv):
# Internal shipment is created for Stockable and Consumer Products
if production_line.product_id.type not in ('product', 'consu'):
return False
- move_name = _('PROD: %s') % production.name
destination_location_id = production.product_id.product_tmpl_id.property_stock_production.id
if not source_location_id:
source_location_id = production.location_src_id.id
move_id = stock_move.create(cr, uid, {
- 'name': move_name,
+ 'name': production.name,
'date': production.date_planned,
'product_id': production_line.product_id.id,
'product_qty': production_line.product_qty,
diff --git a/addons/sale/sale.py b/addons/sale/sale.py
index c47bf1357c8..34f3c536917 100644
--- a/addons/sale/sale.py
+++ b/addons/sale/sale.py
@@ -50,6 +50,16 @@ class sale_order(osv.osv):
_inherit = ['mail.thread', 'ir.needaction_mixin']
_description = "Sales Order"
+ def onchange_shop_id(self, cr, uid, ids, shop_id, context=None):
+ v = {}
+ if shop_id:
+ shop = self.pool.get('sale.shop').browse(cr, uid, shop_id, context=context)
+ if shop.project_id.id:
+ v['project_id'] = shop.project_id.id
+ if shop.pricelist_id.id:
+ v['pricelist_id'] = shop.pricelist_id.id
+ return {'value': v}
+
def copy(self, cr, uid, id, default=None, context=None):
if not default:
default = {}
@@ -900,7 +910,6 @@ class sale_order_line(osv.osv):
fpos = fiscal_position and self.pool.get('account.fiscal.position').browse(cr, uid, fiscal_position) or False
if update_tax: #The quantity only have changed
result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, product_obj.taxes_id)
- result.update({'type': product_obj.procure_method})
if not flag:
result['name'] = self.pool.get('product.product').name_get(cr, uid, [product_obj.id], context=context_partner)[0][1]
diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml
index d97c9924036..5505a6a88b5 100644
--- a/addons/sale/sale_view.xml
+++ b/addons/sale/sale_view.xml
@@ -181,7 +181,7 @@
-
+
@@ -200,7 +200,7 @@
+ on_change="product_id_change(parent.pricelist_id, product_id, product_uom_qty, product_uom, product_uos_qty, product_uos, name, parent.partner_id, False, True, parent.date_order, False, parent.fiscal_position, False, context)"/>
-
+
sale.shop.inherit.form
sale.shop
@@ -13,7 +13,7 @@
-
+
sale.shop.sale.stock
sale.shop
@@ -41,7 +41,8 @@
+ attrs="{'invisible': ['|','|','|',('picking_ids','=',False),('picking_ids','=',[]), ('state', 'not in', ('progress','manual')),('shipped','=',True)]}"/>
+
diff --git a/addons/sale_stock/test/sale_order_onchange.yml b/addons/sale_stock/test/sale_order_onchange.yml
new file mode 100644
index 00000000000..1026e5627c3
--- /dev/null
+++ b/addons/sale_stock/test/sale_order_onchange.yml
@@ -0,0 +1,22 @@
+-
+ In order to test the onchange of the Sale Order, I create a product
+-
+ !record {model: product.product, id: product_onchange1}:
+ name: 'Devil Worship Book'
+ list_price: 66.6
+ procure_method: 'make_to_order'
+-
+ Now i create a sale order that uses my new product
+-
+ !record {model: sale.order, id: sale_order_onchange1}:
+ partner_id: base.res_partner_2
+ order_line:
+ - product_id: sale_stock.product_onchange1
+ product_uom_qty: 10
+-
+ I verify that the onchange of product on sale order line was correctly triggered
+-
+ !assert {model: sale.order, id: sale_order_onchange1, string: The onchange function of product was not correctly triggered}:
+ - order_line[0].name == u'Devil Worship Book'
+ - order_line[0].price_unit == 66.6
+ - order_line[0].type == 'make_to_order'
diff --git a/addons/survey/survey_view.xml b/addons/survey/survey_view.xml
index 01d6098df55..0247a205700 100644
--- a/addons/survey/survey_view.xml
+++ b/addons/survey/survey_view.xml
@@ -1125,7 +1125,8 @@
-
+
+
@@ -1139,6 +1140,7 @@
+