-
-
+
+
The , the latest payment follow-up
diff --git a/addons/crm/crm_phonecall.py b/addons/crm/crm_phonecall.py
index 19bc98c585a..be92fcad2bf 100644
--- a/addons/crm/crm_phonecall.py
+++ b/addons/crm/crm_phonecall.py
@@ -31,6 +31,15 @@ class crm_phonecall(osv.osv):
_description = "Phonecall"
_order = "id desc"
_inherit = ['mail.thread']
+
+ def _meeting_count(self, cr, uid, ids, field_name, arg, context=None):
+ res = dict(map(lambda x: (x,0), ids))
+ try:
+ for meeting in self.browse(cr, uid, ids, context=context):
+ res[meeting.id] = len(meeting.meeting_ids)
+ except:
+ pass
+ return res
_columns = {
'date_action_last': fields.datetime('Last Action', readonly=1),
'date_action_next': fields.datetime('Next Action', readonly=1),
@@ -65,6 +74,8 @@ class crm_phonecall(osv.osv):
'date_closed': fields.datetime('Closed', readonly=True),
'date': fields.datetime('Date'),
'opportunity_id': fields.many2one ('crm.lead', 'Lead/Opportunity'),
+ 'meeting_ids': fields.one2many('calendar.event', 'phonecall_id', 'Phonecalls'),
+ 'meeting_count': fields.function(_meeting_count, string='# Meetings', type='integer'),
}
def _get_default_state(self, cr, uid, context=None):
diff --git a/addons/crm/crm_phonecall_view.xml b/addons/crm/crm_phonecall_view.xml
index 60b5934ac53..e41040905b2 100644
--- a/addons/crm/crm_phonecall_view.xml
+++ b/addons/crm/crm_phonecall_view.xml
@@ -64,15 +64,15 @@
-
-
-
-
+
+
+
+
diff --git a/addons/hr_timesheet/hr_timesheet_view.xml b/addons/hr_timesheet/hr_timesheet_view.xml
index 0cd8a880a68..0546099e581 100644
--- a/addons/hr_timesheet/hr_timesheet_view.xml
+++ b/addons/hr_timesheet/hr_timesheet_view.xml
@@ -118,10 +118,8 @@
-
-
+
diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py
index 91d50e93236..537e3f5bfda 100644
--- a/addons/mrp/mrp.py
+++ b/addons/mrp/mrp.py
@@ -1111,8 +1111,24 @@ class mrp_production_product_line(osv.osv):
class product_product(osv.osv):
_inherit = "product.product"
+ def _bom_count(self, cr, uid, ids, field_name, arg, context=None):
+ res = dict(map(lambda x: (x,{'bom_count': 0, 'mo_count': 0, 'bom_strct':0}), ids))
+ try:
+ for bom in self.browse(cr, uid, ids, context=context):
+ res[bom.id] = {
+ 'bom_count': len(bom.bom_ids),
+ 'mo_count': len(bom.mo_ids),
+ 'bom_strct':len(bom.bom_ids),
+ }
+ except:
+ pass
+ return res
_columns = {
'bom_ids': fields.one2many('mrp.bom', 'product_id', 'Bill of Materials'),
+ 'mo_ids': fields.one2many('mrp.production', 'product_id', 'Manufacturing Orders'),
+ 'bom_count': fields.function(_bom_count, string='# Bill of Material', type='integer', multi="bom_count"),
+ 'bom_strct': fields.function(_bom_count, string='# Bill of Material Structure', type='integer', multi="bom_count"),
+ 'mo_count': fields.function(_bom_count, string='# Manufacturing Orders', type='integer', multi="bom_count"),
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml
index 6073d02fcc0..feba58568d5 100644
--- a/addons/mrp/mrp_view.xml
+++ b/addons/mrp/mrp_view.xml
@@ -1040,9 +1040,18 @@
-
-
-
+
+
+
diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py
index 5e3f8b54752..1f4bc75b45e 100644
--- a/addons/procurement/procurement.py
+++ b/addons/procurement/procurement.py
@@ -613,8 +613,17 @@ class product_template(osv.osv):
class product_product(osv.osv):
_inherit="product.product"
+ def _orderpoint_count(self, cr, uid, ids, field_name, arg, context=None):
+ res = dict(map(lambda x: (x,0), ids))
+ try:
+ for orderpoint in self.browse(cr, uid, ids, context=context):
+ res[orderpoint.id] = len(orderpoint.orderpoint_ids)
+ except:
+ pass
+ return res
_columns = {
'orderpoint_ids': fields.one2many('stock.warehouse.orderpoint', 'product_id', 'Minimum Stock Rules'),
+ 'orderpoint_count': fields.function(_orderpoint_count, string='# Orderpoints', type='integer'),
}
diff --git a/addons/procurement/procurement_view.xml b/addons/procurement/procurement_view.xml
index faec656cf20..596ce2f0ba0 100644
--- a/addons/procurement/procurement_view.xml
+++ b/addons/procurement/procurement_view.xml
@@ -357,7 +357,10 @@
-
+
-
+
diff --git a/addons/sale/sale.py b/addons/sale/sale.py
index 667f15a375d..ce7fc697ad9 100644
--- a/addons/sale/sale.py
+++ b/addons/sale/sale.py
@@ -1024,4 +1024,18 @@ class account_invoice(osv.Model):
workflow.trg_validate(uid, 'account.invoice', id, 'invoice_cancel', cr)
return super(account_invoice, self).unlink(cr, uid, ids, context=context)
+class product_product(osv.Model):
+ _inherit = 'product.product'
+ def _sales_count(self, cr, uid, ids, field_name, arg, context=None):
+ res = dict(map(lambda x: (x,0), ids))
+ try:
+ for sale in self.browse(cr, uid, ids, context=context):
+ res[sale.id] = len(sale.sales_ids)
+ except:
+ pass
+ return res
+ _columns = {
+ 'sales_ids': fields.one2many('sale.order.line', 'product_id', 'Sales '),
+ 'sales_count': fields.function(_sales_count, string='# Sales', type='integer'),
+ }
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml
index c9ffb94b985..7ea9d441c5c 100644
--- a/addons/sale/sale_view.xml
+++ b/addons/sale/sale_view.xml
@@ -499,7 +499,10 @@
-
+
diff --git a/addons/stock/product.py b/addons/stock/product.py
index 3eddf0a1c72..863b7111bb0 100644
--- a/addons/stock/product.py
+++ b/addons/stock/product.py
@@ -352,7 +352,14 @@ class product_product(osv.osv):
for id in ids:
res[id][f] = stock.get(id, 0.0)
return res
-
+ def _move_count(self, cr, uid, ids, field_name, arg, context=None):
+ res = dict(map(lambda x: (x,0), ids))
+ try:
+ for move in self.browse(cr, uid, ids, context=context):
+ res[move.id] = len(move.move_ids)
+ except:
+ pass
+ return res
_columns = {
'reception_count': fields.function(_stock_move_count, string="Reception", type='integer', multi='pickings'),
'delivery_count': fields.function(_stock_move_count, string="Delivery", type='integer', multi='pickings'),
@@ -413,6 +420,8 @@ class product_product(osv.osv):
help="If real-time valuation is enabled for a product, the system will automatically write journal entries corresponding to stock moves." \
"The inventory variation account set on the product category will represent the current inventory value, and the stock input and stock output account will hold the counterpart moves for incoming and outgoing products."
, required=True),
+ 'move_ids': fields.one2many('stock.move', 'product_id', 'Moves'),
+ 'move_count': fields.function(_move_count, string='# Moves', type='integer'),
}
_defaults = {
diff --git a/addons/stock/product_view.xml b/addons/stock/product_view.xml
index 11f970d6ddb..a3fa9224bbe 100644
--- a/addons/stock/product_view.xml
+++ b/addons/stock/product_view.xml
@@ -73,8 +73,14 @@
-
-
+
+
+