-
+
diff --git a/addons/process/process.py b/addons/process/process.py
index 64a7227599d..5f02b67b879 100644
--- a/addons/process/process.py
+++ b/addons/process/process.py
@@ -87,8 +87,11 @@ class process_process(osv.osv):
pool = pooler.get_pool(cr.dbname)
- process = pool.get('process.process').browse(cr, uid, [id])[0]
- title = process.name
+ process = pool.get('process.process').browse(cr, uid, [id], context)[0]
+
+ name = process.name
+ resource = None
+ state = 'N/A'
expr_context = {}
states = {}
@@ -101,7 +104,9 @@ class process_process(osv.osv):
current_object = pool.get(res_model).browse(cr, uid, [res_id], context)[0]
current_user = pool.get('res.users').browse(cr, uid, [uid], context)[0]
expr_context = Env(current_object, current_user)
- title = _("%s - Resource: %s, State: %s") % (process.name, current_object.name, states.get(getattr(current_object, 'state'), 'N/A'))
+ resource = current_object.name
+ if 'state' in current_object:
+ state = states.get(current_object.state, 'N/A')
perm = pool.get(res_model).perm_read(cr, uid, [res_id], context)[0]
notes = process.note or "N/A"
@@ -247,7 +252,7 @@ class process_process(osv.osv):
y = v['y']
v['y'] = min(y - miny + 10, y)
- return dict(title=title, perm=perm, notes=notes, nodes=nodes, transitions=transitions)
+ return dict(name=name, resource=resource, state=state, perm=perm, notes=notes, nodes=nodes, transitions=transitions)
def copy(self, cr, uid, id, default=None, context={}):
""" Deep copy the entire process.
diff --git a/addons/project_timesheet/project_timesheet.py b/addons/project_timesheet/project_timesheet.py
index 0472d77d4e5..37e238edab0 100644
--- a/addons/project_timesheet/project_timesheet.py
+++ b/addons/project_timesheet/project_timesheet.py
@@ -95,7 +95,7 @@ class project_work(osv.osv):
# delete entry from timesheet too while deleting entry to task.
list_avail_ids = self.pool.get('hr.analytic.timesheet').search(cr, uid, [])
if timesheet_id in list_avail_ids:
- obj = self.pool.get('hr.analytic.timesheet').unlink(cr, uid, [timesheet_id], *args)
+ obj = self.pool.get('hr.analytic.timesheet').unlink(cr, uid, [timesheet_id], *args, **kwargs)
return super(project_work,self).unlink(cr, uid, ids, *args, **kwargs)
diff --git a/addons/purchase/report/order.rml b/addons/purchase/report/order.rml
index 203a4270391..1ced17150ad 100644
--- a/addons/purchase/report/order.rml
+++ b/addons/purchase/report/order.rml
@@ -273,22 +273,22 @@
[[ line.name ]]
|
- [[ ', '.join(map(lambda x: x.name, line.taxes_id)) or '0.00' ]]
+ [[ ', '.join(map(lambda x: x.name, line.taxes_id)) or formatLang(0.00) ]]
|
[[ formatLang( line.date_planned, date=True) ]]
|
- [[ line.product_qty or '0.00' ]]
+ [[ line.product_qty or formatLang(0.00) ]]
|
[[ line.product_uom.name ]]
|
- [[ line.price_unit or '0.00' ]]
+ [[ line.price_unit or formatLang(0.00) ]]
|
- [[ line.price_subtotal or '0.00' ]]
+ [[ line.price_subtotal or formatLang(0.00) ]]
|
@@ -339,7 +339,7 @@
Net Total :
|
- [[ o.amount_untaxed or '0.00' ]]
+ [[ o.amount_untaxed or formatLang(0.00) ]]
|
[[ o.pricelist_id.currency_id.name ]]
@@ -355,7 +355,7 @@
Taxes :
|
- [[ o.amount_tax or '0.00' ]]
+ [[ o.amount_tax or formatLang(0.00) ]]
|
[[ o.pricelist_id.currency_id.name ]]
@@ -371,7 +371,7 @@
Total :
|
- [[ o.amount_total or '0.00' ]]
+ [[ o.amount_total or formatLang(0.00) ]]
|
[[ o.pricelist_id.currency_id.name ]]
diff --git a/addons/purchase/report/request_quotation.rml b/addons/purchase/report/request_quotation.rml
index 6961eb5cf8b..00f04aacf61 100644
--- a/addons/purchase/report/request_quotation.rml
+++ b/addons/purchase/report/request_quotation.rml
@@ -137,7 +137,7 @@
[[ formatLang(order_line.date_planned, date = True) ]]
|
- [[ order_line.product_qty or '' ]]
+ [[ order_line.product_qty or formatLang(0.00)]]
|
[[ (order_line.product_uom and order_line.product_uom.name) or '' ]]
diff --git a/addons/sale/report/order.rml b/addons/sale/report/order.rml
index f68caff3d1e..6ba40118b01 100644
--- a/addons/sale/report/order.rml
+++ b/addons/sale/report/order.rml
@@ -98,12 +98,6 @@
-
-
-
-
-
-
@@ -256,22 +250,22 @@
[[ line.name ]]
|
- [[formatLang( ', '.join(map(lambda x: x.name, line.tax_id))) or '0.00' ]]
+ [[ ', '.join(map(lambda x: x.name, line.tax_id)) or formatLang(0.00) ]]
|
- [[ formatLang(line.product_uos and line.product_uos_qty or line.product_uom_qty) or '0.00']]
+ [[ line.product_uos and line.product_uos_qty or line.product_uom_qty or formatLang(0.00) ]]
|
[[ line.product_uos and line.product_uos.name or line.product_uom.name ]]
|
- [[ formatLang(line.price_unit) or '0.00' ]]
+ [[ line.price_unit or formatLang(0.00) ]]
|
- [[ formatLang(line.discount) and str(line.discount) or '0.00' ]]
+ [[ line.discount and str(line.discount) or formatLang(0.00) ]]
|
- [[ formatLang(line.price_subtotal) or '0.00' ]]
+ [[ line.price_subtotal or formatLang(0.00) ]]
|
@@ -322,7 +316,7 @@
Net Total :
|
- [[ formatLang(o.amount_untaxed) or '0.00' ]]
+ [[ o.amount_untaxed or formatLang(0.00) ]]
|
[[ o.pricelist_id.currency_id.name ]]
@@ -338,7 +332,7 @@
Taxes :
|
- [[ formatLang(o.amount_tax) or '0.00' ]]
+ [[ o.amount_tax or formatLang(0.00) ]]
|
[[ o.pricelist_id.currency_id.name ]]
@@ -354,7 +348,7 @@
Total :
|
- [[ formatLang(o.amount_total) or '0.00' ]]
+ [[ o.amount_total or formatLang(0.00) ]]
|
[[ o.pricelist_id.currency_id.name ]]
diff --git a/addons/sale/sale.py b/addons/sale/sale.py
index 58852e00d8b..4e3d384a057 100644
--- a/addons/sale/sale.py
+++ b/addons/sale/sale.py
@@ -268,7 +268,7 @@ class sale_order(osv.osv):
_order = 'name desc'
# Form filling
- def unlink(self, cr, uid, ids):
+ def unlink(self, cr, uid, ids, context=None):
sale_orders = self.read(cr, uid, ids, ['state'])
unlink_ids = []
for s in sale_orders:
@@ -276,7 +276,7 @@ class sale_order(osv.osv):
unlink_ids.append(s['id'])
else:
raise osv.except_osv(_('Invalid action !'), _('Cannot delete Sale Order(s) which are already confirmed !'))
- return osv.osv.unlink(self, cr, uid, unlink_ids)
+ return osv.osv.unlink(self, cr, uid, unlink_ids, context=context)
def onchange_shop_id(self, cr, uid, ids, shop_id):
diff --git a/addons/stock/report/picking.rml b/addons/stock/report/picking.rml
index 7716dcf9aa7..5f23bd8078d 100644
--- a/addons/stock/report/picking.rml
+++ b/addons/stock/report/picking.rml
@@ -187,7 +187,7 @@
[[ (picking.sale_id and picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id.title) or '' ]] [[ (picking.sale_id and picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id.name) or '' ]]
|
- [[ picking.date ]]
+ [[ formatLang(picking.date,date_time = True) ]]
|
[[ picking.weight or '']]
@@ -216,7 +216,9 @@
|
-
+
+
+
[[ repeatIn([line for line in picking.move_lines if (line.state == 'assigned' )],'move_lines') ]]
diff --git a/addons/stock/report_stock.py b/addons/stock/report_stock.py
index c8224e621dc..36b7c166397 100644
--- a/addons/stock/report_stock.py
+++ b/addons/stock/report_stock.py
@@ -35,6 +35,7 @@ class stock_report_prodlots(osv.osv):
'product_id': fields.many2one('product.product', 'Product', readonly=True, select=True),
'prodlot_id': fields.many2one('stock.production.lot', 'Production lot', readonly=True, select=True),
}
+
def init(self, cr):
cr.execute("""
create or replace view stock_report_prodlots as (
@@ -68,5 +69,10 @@ class stock_report_prodlots(osv.osv):
) as report
group by location_id, product_id, prodlot_id
)""")
+
+ def unlink(self, cr, uid, ids, context={}):
+ raise osv.except_osv(_('Error !'), _('You cannot delete any record!'))
+
+
stock_report_prodlots()
diff --git a/addons/stock/report_stock_view.xml b/addons/stock/report_stock_view.xml
index 1b921098df9..650942b78a8 100644
--- a/addons/stock/report_stock_view.xml
+++ b/addons/stock/report_stock_view.xml
@@ -99,7 +99,30 @@
form
tree,form
-
+
+
+
+
+ stock.location.tree
+ stock.location
+ tree
+
+
+
+
+
+
+
+
+
+
+ Locations' Values
+ stock.location
+ form
+ tree
+
+
+
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index 368591c94a2..1831aa3be29 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -84,7 +84,33 @@ class stock_location(osv.osv):
if 'stock_virtual' in field_names:
res[loc]['stock_virtual'] = prod.virtual_available
return res
-
+
+
+ def product_detail(self, cr, uid, id, field):
+ res = {}
+ res[id] = {}
+ final_value = 0.0
+ field_to_read = 'virtual_available'
+ if field == 'stock_real_value':
+ field_to_read = 'qty_available'
+ cr.execute('select distinct product_id from stock_move where location_id=%s',(id,))
+ result = cr.dictfetchall()
+ if result:
+ for r in result:
+ product = self.pool.get('product.product').read(cr, uid, r['product_id'], [field_to_read,'standard_price','name'])
+ final_value += (product[field_to_read] * product['standard_price'])
+ return final_value
+
+ def _product_value(self, cr, uid, ids, field_names, arg, context={}):
+ result = {}
+ for id in ids:
+ result[id] = {}.fromkeys(field_names, 0.0)
+ for field_name in field_names:
+ for loc in ids:
+ ret_dict = self.product_detail(cr,uid,loc,field=field_name)
+ result[loc][field_name] = ret_dict
+ return result
+
_columns = {
'name': fields.char('Location Name', size=64, required=True, translate=True),
'active': fields.boolean('Active'),
@@ -123,6 +149,8 @@ class stock_location(osv.osv):
'parent_left': fields.integer('Left Parent', select=1),
'parent_right': fields.integer('Right Parent', select=1),
+ 'stock_real_value': fields.function(_product_value, method=True, type='float', string='Real Stock Value', multi="stock"),
+ 'stock_virtual_value': fields.function(_product_value, method=True, type='float', string='Virtual Stock Value', multi="stock"),
}
_defaults = {
'active': lambda *a: 1,
@@ -307,7 +335,7 @@ class stock_tracking(osv.osv):
res = [(r['id'], r['name']+' ['+(r['serial'] or '')+']') for r in self.read(cr, uid, ids, ['name','serial'], context)]
return res
- def unlink(self, cr ,uid, ids):
+ def unlink(self, cr ,uid, ids, context=None):
raise osv.except_osv(_('Error'), _('You can not remove a lot line !'))
stock_tracking()
diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml
index 4fef9daa20e..4497501df35 100644
--- a/addons/stock/stock_view.xml
+++ b/addons/stock/stock_view.xml
@@ -403,7 +403,7 @@
-
+
=============================
Warehouse
=============================
@@ -1360,7 +1360,7 @@
context="{'location': active_id}"
domain="[('product_id','=',active_id),('state','in',('waiting','confirmed','assigned'))]"
id="act_product_stock_move_futur_open"
- name="Futur Stock Moves"
+ name="Future Stock Moves"
res_model="stock.move"
src_model="product.product"/>
@@ -1381,8 +1381,5 @@
-
-
-