From cd64e33d16b067847662e8f4c95221a9ec62bc15 Mon Sep 17 00:00:00 2001
From: "Randhir Mayatra (OpenERP)"
Date: Mon, 1 Oct 2012 14:26:03 +0530
Subject: [PATCH] [IMP] make changes into product,procurement module
bzr revid: rma@tinyerp.com-20121001085603-1s2kt6ufg8fcom8e
---
addons/mrp/mrp_view.xml | 6 ++----
addons/procurement/procurement.py | 19 +++++++++++++------
addons/procurement/procurement_demo.xml | 10 ++++++++++
addons/procurement/procurement_view.xml | 17 ++++++++++++++---
addons/product/product.py | 2 --
addons/product/product_demo.xml | 10 ----------
addons/product/product_view.xml | 2 --
.../purchase_requisition_view.xml | 2 +-
8 files changed, 40 insertions(+), 28 deletions(-)
diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml
index c003711ceb1..9d73705d567 100644
--- a/addons/mrp/mrp_view.xml
+++ b/addons/mrp/mrp_view.xml
@@ -966,7 +966,7 @@
product.normal.form.mrp.inheritproduct.product
-
+ False
@@ -977,7 +977,7 @@
order using the bill of materials assigned to this product.
The delivery order will be ready once the production is done.
-
+
@@ -1052,7 +1052,5 @@
-
-
diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py
index d19e792243f..1c2decb4cdd 100644
--- a/addons/procurement/procurement.py
+++ b/addons/procurement/procurement.py
@@ -32,6 +32,19 @@ import decimal_precision as dp
# then wizard for picking lists & move
#
+class product_template(osv.osv):
+ _inherit="product.template"
+ _columns = {
+ 'type': fields.selection([('product','Stockable Product'),('consu', 'Consumable'),('service','Service')], 'Product Type', required=True, help="Will change the way procurements are processed. Consumable are product where you don't manage stock."),
+ 'procure_method': fields.selection([('make_to_stock','Make to Stock'),('make_to_order','Make to Order')], 'Procurement Method', required=True, help="'Make to Stock': When needed, take from the stock or wait until re-supplying. 'Make to Order': When needed, purchase or produce for the procurement request."),
+ 'supply_method': fields.selection([('produce','Manufacture'),('buy','Buy')], 'Supply Method', required=True, help="Produce will generate production order or tasks, according to the product type. Buy will trigger purchase orders when requested."),
+ }
+ _defaults = {
+ 'procure_method': lambda *a: 'make_to_stock',
+ 'supply_method': lambda *a: 'buy',
+ }
+product_template()
+
class mrp_property_group(osv.osv):
"""
Group of mrp properties.
@@ -627,14 +640,8 @@ class product_product(osv.osv):
_inherit="product.product"
_columns = {
'orderpoint_ids': fields.one2many('stock.warehouse.orderpoint', 'product_id', 'Minimum Stock Rules'),
- 'type': fields.selection([('product','Stockable Product'),('consu', 'Consumable'),('service','Service')], 'Product Type', required=True, help="Will change the way procurements are processed. Consumable are product where you don't manage stock."),
- 'procure_method': fields.selection([('make_to_stock','Make to Stock'),('make_to_order','Make to Order')], 'Procurement Method', required=True, help="'Make to Stock': When needed, take from the stock or wait until re-supplying. 'Make to Order': When needed, purchase or produce for the procurement request."),
- }
- _defaults = {
- 'procure_method': lambda *a: 'make_to_stock',
}
product_product()
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/procurement/procurement_demo.xml b/addons/procurement/procurement_demo.xml
index e4cf500007d..e28927815e3 100644
--- a/addons/procurement/procurement_demo.xml
+++ b/addons/procurement/procurement_demo.xml
@@ -3,23 +3,28 @@
make_to_order
+ producemake_to_order
+ produceproductmake_to_order
+ produceproductmake_to_order
+ produceproductmake_to_order
+ produce
@@ -67,6 +72,7 @@
productmake_to_order
+ produce
@@ -76,11 +82,13 @@
productmake_to_order
+ produceproductmake_to_order
+ produce
@@ -114,6 +122,7 @@
productmake_to_order
+ produce
@@ -168,6 +177,7 @@
make_to_order
+ produce
diff --git a/addons/procurement/procurement_view.xml b/addons/procurement/procurement_view.xml
index debbe03c961..8c3ae9a2336 100644
--- a/addons/procurement/procurement_view.xml
+++ b/addons/procurement/procurement_view.xml
@@ -303,8 +303,9 @@
-
-
+
+
+
@@ -331,6 +332,16 @@
-
+
+ product.template.procurement
+ product.template
+
+
+
+
+
+
+
+
diff --git a/addons/product/product.py b/addons/product/product.py
index e3afc4dbd7d..f42aaba9e26 100644
--- a/addons/product/product.py
+++ b/addons/product/product.py
@@ -281,7 +281,6 @@ class product_template(osv.osv):
'description_purchase': fields.text('Purchase Description',translate=True),
'description_sale': fields.text('Sale Description',translate=True),
'type': fields.selection([('consu', 'Consumable'),('service','Service')], 'Product Type', required=True, help="Will change the way procurements are processed. Consumable are product where you don't manage stock."),
- 'supply_method': fields.selection([('produce','Manufacture'),('buy','Buy')], 'Supply Method', required=True, help="Produce will generate production order or tasks, according to the product type. Buy will trigger purchase orders when requested."),
'sale_delay': fields.float('Customer Lead Time', help="This is the average delay in days between the confirmation of the customer order and the delivery of the finished products. It's the time you promise to your customers."),
'produce_delay': fields.float('Manufacturing Lead Time', help="Average delay in days to produce this product. This is only for the production order and, if it is a multi-level bill of material, it's only for the level of this product. Different lead times will be summed for all levels and purchase orders."),
'rental': fields.boolean('Can be Rent'),
@@ -352,7 +351,6 @@ class product_template(osv.osv):
'company_id': lambda s,cr,uid,c: s.pool.get('res.company')._company_default_get(cr, uid, 'product.template', context=c),
'list_price': lambda *a: 1,
'cost_method': lambda *a: 'standard',
- 'supply_method': lambda *a: 'buy',
'standard_price': lambda *a: 0.0,
'sale_ok': lambda *a: 1,
'sale_delay': lambda *a: 7,
diff --git a/addons/product/product_demo.xml b/addons/product/product_demo.xml
index 76cbd6a5c5d..14477d2401a 100644
--- a/addons/product/product_demo.xml
+++ b/addons/product/product_demo.xml
@@ -70,7 +70,6 @@
20.530.75service
- produceThis type of service include basic monitoring of products.
@@ -83,7 +82,6 @@
25.538.25service
- produceThis type of service include assistance for security questions, system configuration requirements, implementation or special needs.
@@ -96,7 +94,6 @@
450.0300.0consu
- produce4.0
@@ -113,7 +110,6 @@ HDD SH-1
500.0750.0consu
- produce
@@ -131,7 +127,6 @@ HDD SH-1
600.0900.0consu
- produce7.0
@@ -245,7 +240,6 @@ HDD SH-1
20.025.0consu
- produce
@@ -266,7 +260,6 @@ HDD SH-1
1020.01150.0consu
- produce
@@ -277,7 +270,6 @@ HDD SH-1
1100.01250.0consu
- produceOn demand hard-disk having capacity based on requirement.
@@ -367,7 +359,6 @@ QWERTY keyboard
3300.03645.0consu
- produceCustom Laptop based on customer's requirement.
@@ -557,7 +548,6 @@ QWERTY keyboard
155.0173.0consu
- produceFull featured image editing software.
diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml
index de0c7dcdc7a..cc2b2b9fb63 100644
--- a/addons/product/product_view.xml
+++ b/addons/product/product_view.xml
@@ -105,7 +105,6 @@
-
@@ -718,7 +717,6 @@
-
diff --git a/addons/purchase_requisition/purchase_requisition_view.xml b/addons/purchase_requisition/purchase_requisition_view.xml
index 1fafec92bc7..a342f54edfd 100644
--- a/addons/purchase_requisition/purchase_requisition_view.xml
+++ b/addons/purchase_requisition/purchase_requisition_view.xml
@@ -180,7 +180,7 @@
product.form.inheritproduct.product
-
+