diff --git a/addons/account/account_menuitem.xml b/addons/account/account_menuitem.xml index 3713606c490..58830a19693 100644 --- a/addons/account/account_menuitem.xml +++ b/addons/account/account_menuitem.xml @@ -2,7 +2,7 @@ - diff --git a/addons/account/board_account_view.xml b/addons/account/board_account_view.xml index fa6dac769a3..3037c9d3b0d 100644 --- a/addons/account/board_account_view.xml +++ b/addons/account/board_account_view.xml @@ -63,8 +63,6 @@ - - diff --git a/addons/crm/board_crm_view.xml b/addons/crm/board_crm_view.xml index 60fb24f1a7a..b8e05b68cf5 100644 --- a/addons/crm/board_crm_view.xml +++ b/addons/crm/board_crm_view.xml @@ -102,7 +102,6 @@ menu - diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index e609c8808ef..5f61e9be93e 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -612,7 +612,6 @@ domain="[]" help="Show Sales Team"/> - diff --git a/addons/crm/crm_meeting_view.xml b/addons/crm/crm_meeting_view.xml index 24799e97421..048d7a886bc 100644 --- a/addons/crm/crm_meeting_view.xml +++ b/addons/crm/crm_meeting_view.xml @@ -282,11 +282,7 @@ domain="[('user_id','=',uid)]" help="My Meetings" /> - - - + diff --git a/addons/crm/res_partner.py b/addons/crm/res_partner.py index 3d43bc76022..86619aa9e77 100644 --- a/addons/crm/res_partner.py +++ b/addons/crm/res_partner.py @@ -24,14 +24,26 @@ from osv import fields,osv class res_partner(osv.osv): """ Inherits partner and adds CRM information in the partner form """ _inherit = 'res.partner' + + def _opportunity_meeting_count(self, cr, uid, ids, field_name, arg, context=None): + res = {} + for partner in self.browse(cr, uid, ids, context): + res[partner.id] = { + 'opportunity_count': len(partner.opportunity_ids), + 'meeting_count': len(partner.meeting_ids), + } + return res + _columns = { 'section_id': fields.many2one('crm.case.section', 'Sales Team'), 'opportunity_ids': fields.one2many('crm.lead', 'partner_id',\ - 'Leads and Opportunities'), + 'Leads and Opportunities', domain="[('state','in', ('draft','open','pending'))]"), 'meeting_ids': fields.one2many('crm.meeting', 'partner_id',\ - 'Meetings'), + 'Meetings', domain="[('date','>=', time.strftime('%Y-%m-%d 00:00:00'))]"), 'phonecall_ids': fields.one2many('crm.phonecall', 'partner_id',\ 'Phonecalls'), + 'opportunity_count': fields.function(_opportunity_meeting_count, string="Opportunity", type='integer', multi='opp_meet'), + 'meeting_count': fields.function(_opportunity_meeting_count, string="Meeting", type='integer', multi='opp_meet'), } def redirect_partner_form(self, cr, uid, partner_id, context=None): diff --git a/addons/crm/res_partner_view.xml b/addons/crm/res_partner_view.xml index 6926464cd93..b169f92680d 100644 --- a/addons/crm/res_partner_view.xml +++ b/addons/crm/res_partner_view.xml @@ -42,6 +42,46 @@ + + + + + + res.partner.kanban.inherit + res.partner + kanban + + + + + + + + + Opportunities() + + + Meetings() + + + + + res.partner.crm.info.inherit1 diff --git a/addons/document/board_document_view.xml b/addons/document/board_document_view.xml index 27325662815..acfcf4cb63a 100644 --- a/addons/document/board_document_view.xml +++ b/addons/document/board_document_view.xml @@ -49,9 +49,6 @@ id="menu_reports_document_manager" icon="terp-graph"/> - - board.document.manager.form1 board.board diff --git a/addons/hr/hr_board.xml b/addons/hr/hr_board.xml index b026b40bd80..e665c5067eb 100644 --- a/addons/hr/hr_board.xml +++ b/addons/hr/hr_board.xml @@ -24,7 +24,6 @@ - @@ -52,7 +51,5 @@ - - diff --git a/addons/hr_holidays/hr_holidays.py b/addons/hr_holidays/hr_holidays.py index 08f4904a2ce..5f5307403cb 100644 --- a/addons/hr_holidays/hr_holidays.py +++ b/addons/hr_holidays/hr_holidays.py @@ -484,18 +484,23 @@ class hr_employee(osv.osv): remaining[employee_id] = 0.0 return remaining - def _get_leave_status(self, cr, uid, ids, name, args, context=None): - holidays_id = self.pool.get('hr.holidays').search(cr, uid, - [('employee_id', 'in', ids), ('date_from','<=',time.strftime('%Y-%m-%d %H:%M:%S')), - ('date_to','>=',time.strftime('%Y-%m-%d %H:%M:%S')),('type','=','remove'),('state','not in',('cancel','refuse'))], + def _get_leave_status(self, cr, uid, ids, name, args, context=None): + holidays_obj = self.pool.get('hr.holidays') + holidays_id = holidays_obj.search(cr, uid, + [('employee_id', 'in', ids), ('date_from','<=',time.strftime('%Y-%m-%d %H:%M:%S')), + ('date_to','>=',time.strftime('%Y-%m-%d 23:59:59')),('type','=','remove'),('state','not in',('cancel','refuse'))], context=context) result = {} for id in ids: result[id] = { 'current_leave_state': False, 'current_leave_id': False, + 'leave_date_from':False, + 'leave_date_to':False, } for holiday in self.pool.get('hr.holidays').browse(cr, uid, holidays_id, context=context): + result[holiday.employee_id.id]['leave_date_from'] = holiday.date_from + result[holiday.employee_id.id]['leave_date_to'] = holiday.date_to result[holiday.employee_id.id]['current_leave_state'] = holiday.state result[holiday.employee_id.id]['current_leave_id'] = holiday.holiday_status_id.id return result @@ -506,6 +511,8 @@ class hr_employee(osv.osv): selection=[('draft', 'New'), ('confirm', 'Waiting Approval'), ('refuse', 'Refused'), ('validate1', 'Waiting Second Approval'), ('validate', 'Approved'), ('cancel', 'Cancelled')]), 'current_leave_id': fields.function(_get_leave_status, multi="leave_status", string="Current Leave Type",type='many2one', relation='hr.holidays.status'), + 'leave_date_from': fields.function(_get_leave_status, multi='leave_status', type='date', string='From Date'), + 'leave_date_to': fields.function(_get_leave_status, multi='leave_status', type='date', string='To Date'), 'last_login': fields.related('user_id', 'date', type='datetime', string='Latest Connection', readonly=1) } diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml index 57756c5cb35..5a93d50afab 100644 --- a/addons/hr_holidays/hr_holidays_view.xml +++ b/addons/hr_holidays/hr_holidays_view.xml @@ -526,11 +526,13 @@ + +
  • - + diff --git a/addons/hr_holidays/security/ir_rule.xml b/addons/hr_holidays/security/ir_rule.xml index f05008203df..8e8c97bf7ea 100644 --- a/addons/hr_holidays/security/ir_rule.xml +++ b/addons/hr_holidays/security/ir_rule.xml @@ -2,18 +2,5 @@ - - Manager Holidays - - [(1,'=',1)] - - - - Employee Holidays - - [('employee_id.user_id','=',user.id)] - - - diff --git a/addons/membership/membership_view.xml b/addons/membership/membership_view.xml index b65386ca9c9..99763dc176b 100644 --- a/addons/membership/membership_view.xml +++ b/addons/membership/membership_view.xml @@ -193,19 +193,26 @@ - + tree - + form + + + kanban + + + + diff --git a/addons/mrp/board_manufacturing_view.xml b/addons/mrp/board_manufacturing_view.xml index 514b018032a..c3cc21ce893 100644 --- a/addons/mrp/board_manufacturing_view.xml +++ b/addons/mrp/board_manufacturing_view.xml @@ -35,9 +35,5 @@ id="menu_board_manufacturing" parent="menus_dash_mrp" sequence="1"/> - - - diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index 3c353e031f2..5d06a80b024 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -263,20 +263,27 @@ - + tree - + form - + + + kanban + + + + + diff --git a/addons/project/board_project_view.xml b/addons/project/board_project_view.xml index 8126018d3a5..fa6816ebbf7 100644 --- a/addons/project/board_project_view.xml +++ b/addons/project/board_project_view.xml @@ -117,9 +117,5 @@ parent="menu_project_dashboard" sequence="1"/> - - diff --git a/addons/purchase/board_purchase_view.xml b/addons/purchase/board_purchase_view.xml index ad4c97aad4a..a7753fe33b4 100644 --- a/addons/purchase/board_purchase_view.xml +++ b/addons/purchase/board_purchase_view.xml @@ -116,8 +116,5 @@ parent="menu_purchase_deshboard" sequence="4"/> - - - diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml index fe6c9b1d3f3..edc5d54cd51 100644 --- a/addons/purchase/purchase_view.xml +++ b/addons/purchase/purchase_view.xml @@ -318,7 +318,7 @@ + sequence="0"/> Purchase Orders @@ -329,7 +329,7 @@ Use this menu to search within your purchase orders by references, supplier, products, etc. For each purchase order, you can track the products received, and control the supplier invoices. - + diff --git a/addons/purchase_requisition/purchase_requisition_view.xml b/addons/purchase_requisition/purchase_requisition_view.xml index d09564f221e..d1854a5f516 100644 --- a/addons/purchase_requisition/purchase_requisition_view.xml +++ b/addons/purchase_requisition/purchase_requisition_view.xml @@ -177,7 +177,7 @@ diff --git a/addons/sale/__init__.py b/addons/sale/__init__.py index 2688b61ddd9..fe19b7fa609 100644 --- a/addons/sale/__init__.py +++ b/addons/sale/__init__.py @@ -25,6 +25,7 @@ import sale import stock +import res_partner import wizard import report import company diff --git a/addons/sale/__openerp__.py b/addons/sale/__openerp__.py index c121739166a..a78af4e051e 100644 --- a/addons/sale/__openerp__.py +++ b/addons/sale/__openerp__.py @@ -80,6 +80,7 @@ Dashboard for Sales Manager that includes: 'sale_report.xml', 'sale_data.xml', 'sale_view.xml', + 'res_partner_view.xml', 'report/sale_report_view.xml', 'stock_view.xml', 'process/sale_process.xml', diff --git a/addons/sale/board_sale_view.xml b/addons/sale/board_sale_view.xml index a0101c347bf..510a7ac28f7 100644 --- a/addons/sale/board_sale_view.xml +++ b/addons/sale/board_sale_view.xml @@ -82,7 +82,9 @@ form - + + + @@ -112,7 +114,5 @@ form - - diff --git a/addons/sale/res_partner.py b/addons/sale/res_partner.py new file mode 100644 index 00000000000..2122f88af5b --- /dev/null +++ b/addons/sale/res_partner.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from osv import fields,osv +from tools.translate import _ + +class res_partner(osv.osv): + _inherit = 'res.partner' + + def _sale_order_count(self, cr, uid, ids, field_name, arg, context=None): + res = {} + for partner in self.browse(cr, uid, ids, context): + res[partner.id] = len(partner.sale_order_ids) + return res + + _columns = { + 'sale_order_count': fields.function(_sale_order_count, string='# of Sales Order', type='integer'), + } + diff --git a/addons/sale/res_partner_view.xml b/addons/sale/res_partner_view.xml new file mode 100644 index 00000000000..6a011749282 --- /dev/null +++ b/addons/sale/res_partner_view.xml @@ -0,0 +1,23 @@ + + + + + + res.partner.kanban.saleorder.inherit + res.partner + kanban + + + + + + + + Sales() + + + + + + + diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml index f19a6a58fec..3d6549ff614 100644 --- a/addons/sale/sale_view.xml +++ b/addons/sale/sale_view.xml @@ -1,6 +1,8 @@ - + + + sale.shop diff --git a/addons/stock/board_warehouse_view.xml b/addons/stock/board_warehouse_view.xml index 9f15eba5389..38412228723 100644 --- a/addons/stock/board_warehouse_view.xml +++ b/addons/stock/board_warehouse_view.xml @@ -71,5 +71,6 @@ + diff --git a/addons/stock/product.py b/addons/stock/product.py index e7838bb490a..426ae9cd9a4 100644 --- a/addons/stock/product.py +++ b/addons/stock/product.py @@ -26,6 +26,27 @@ import decimal_precision as dp class product_product(osv.osv): _inherit = "product.product" + def _stock_move_count(self, cr, uid, ids, field_name, arg, context=None): + res = dict([(id, {'reception_count': 0, 'delivery_count': 0}) for id in ids]) + move_pool=self.pool.get('stock.move') + moves = move_pool.read_group(cr, uid, [ + ('product_id', 'in', ids), + ('picking_id.type', '=', 'in'), + ('state','in',('draft','confirmed','assigned','pending')) + ], ['product_id'], ['product_id']) + for move in moves: + product_id = move['product_id'][0] + res[product_id][reception_count] = move['product_id_count'] + moves = move_pool.read_group(cr, uid, [ + ('product_id', 'in', ids), + ('picking_id.type', '=', 'out'), + ('state','in',('draft','confirmed','assigned','pending')) + ], ['product_id'], ['product_id']) + for move in moves: + product_id = move['product_id'][0] + res[product_id][reception_count] = move['product_id_count'] + return res + def get_product_accounts(self, cr, uid, product_id, context=None): """ To get the stock input account, stock output account and stock journal related to product. @param product_id: product id @@ -331,6 +352,8 @@ class product_product(osv.osv): 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'), 'qty_available': fields.function(_product_available, multi='qty_available', type='float', digits_compute=dp.get_precision('Product Unit of Measure'), string='Quantity On Hand', diff --git a/addons/stock/product_view.xml b/addons/stock/product_view.xml index 65a1a8c2ef3..aca84d33473 100644 --- a/addons/stock/product_view.xml +++ b/addons/stock/product_view.xml @@ -125,6 +125,32 @@ + + + Receive Products + stock.move + ir.actions.act_window + form + tree,form + [('product_id','=',active_id),('picking_id.type','=','in')] + + + + Here you can receive individual products, no matter what purchase order or picking order they come from. You will find the list of all products you are waiting for. Once you receive an order, you can filter based on the name of the supplier or the purchase order reference. Then you can confirm all products received using the buttons on the right of each line. + + + + Receive Products + stock.move + ir.actions.act_window + form + tree,form + [('product_id','=',active_id),('picking_id.type','=','out')] + + + + You will find in this list all products you have to deliver to your customers. You can process the deliveries directly from this list using the buttons on the right of each line. You can filter the products to deliver by customer, products or sale order (using the Origin field). + Product Kanban @@ -136,6 +162,8 @@ + +
    @@ -151,6 +179,12 @@
  • Price:
  • Cost:
  • + + Receptions() + + + Deliveries() +