[IMP] removed dashboards, order of menus, count buttons on partner, products
bzr revid: fp@tinyerp.com-20120522143759-lnd5eescth6yxdvu
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<menuitem icon="terp-account" id="menu_finance" name="Accounting" sequence="13"
|
||||
<menuitem icon="terp-account" id="menu_finance" name="Accounting" sequence="14"
|
||||
groups="group_account_user,group_account_manager,group_account_invoice"
|
||||
web_icon="images/accounting.png"
|
||||
web_icon_hover="images/accounting-hover.png"/>
|
||||
|
||||
@@ -63,8 +63,6 @@
|
||||
|
||||
<menuitem id="menu_dashboard_acc" name="Accounting" sequence="30" parent="base.menu_reporting_dashboard" groups="group_account_user,group_account_manager"/>
|
||||
<menuitem action="open_board_account" icon="terp-graph" id="menu_board_account" parent="menu_dashboard_acc" sequence="1"/>
|
||||
<menuitem icon="terp-account" id="account.menu_finance" name="Accounting" sequence="14" action="open_board_account"/>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -102,7 +102,6 @@
|
||||
<field name="usage">menu</field>
|
||||
<field name="view_id" ref="board_crm_form"/>
|
||||
</record>
|
||||
<menuitem id="menu_board_crm" parent="base.menu_reporting_dashboard" action="open_board_crm" sequence="10" groups="base.group_sale_salesman"/>
|
||||
|
||||
<!-- crm mananger dashboard -->
|
||||
<record model="ir.ui.view" id="view_crm_opportunity_categ_graph">
|
||||
|
||||
@@ -612,7 +612,6 @@
|
||||
domain="[]"
|
||||
help="Show Sales Team"/>
|
||||
</field>
|
||||
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="16">
|
||||
<filter string="Salesman" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}" />
|
||||
|
||||
@@ -282,11 +282,7 @@
|
||||
domain="[('user_id','=',uid)]"
|
||||
help="My Meetings" />
|
||||
</field>
|
||||
<field name="section_id" widget="selection">
|
||||
<filter icon="terp-personal+"
|
||||
domain="['|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
|
||||
help="My Sales Team(s)" />
|
||||
</field>
|
||||
<field name="partner_id"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -42,6 +42,46 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<act_window
|
||||
id="crm_meeting_partner"
|
||||
name="Meetings"
|
||||
res_model="crm.meeting"
|
||||
src_model="res.partner"
|
||||
view_mode="calendar,tree,form,gantt"
|
||||
context="{'search_default_partner_id': [active_id],'default_partner_id': active_id}"
|
||||
/>
|
||||
<act_window
|
||||
id="act_res_partner_2_opportunity"
|
||||
name="Opportunities"
|
||||
res_model="crm.lead"
|
||||
src_model="res.partner"
|
||||
view_mode="kanban,tree,form,graph,calendar"
|
||||
domain="[('type','=','opportunity')]"
|
||||
context="{'search_default_partner_id': [active_id],'default_partner_id': active_id}"
|
||||
/>
|
||||
|
||||
<!-- Partner kanban view inherte -->
|
||||
<record model="ir.ui.view" id="crm_lead_partner_kanban_view">
|
||||
<field name="name">res.partner.kanban.inherit</field>
|
||||
<field name="model">res.partner</field>
|
||||
<field name="type">kanban</field>
|
||||
<field name="inherit_id" ref="base.res_partner_kanban_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="mobile" position="after">
|
||||
<field name="opportunity_count"/>
|
||||
<field name="meeting_count"/>
|
||||
</field>
|
||||
<xpath expr="//div[@class='oe_partner_desc']//h4[@class='oe_partner_heading']" position="after">
|
||||
<a name="%(act_res_partner_2_opportunity)d" type="action">
|
||||
<t t-if="record.opportunity_count.value">Opportunities(<t t-esc="record.opportunity_count.value"/>)</t>
|
||||
</a>
|
||||
<a name="%(crm_meeting_partner)d" type="action">
|
||||
<t t-if="record.meeting_count.value">Meetings(<t t-esc="record.meeting_count.value"/>)</t>
|
||||
</a>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Add History tabs to res.partner form -->
|
||||
<record id="view_crm_partner_info_form1" model="ir.ui.view">
|
||||
<field name="name">res.partner.crm.info.inherit1</field>
|
||||
|
||||
@@ -49,9 +49,6 @@
|
||||
id="menu_reports_document_manager"
|
||||
icon="terp-graph"/>
|
||||
|
||||
<menuitem name="Knowledge" icon="terp-stock" id="knowledge.menu_document"
|
||||
sequence="19" groups="base.group_system,base.group_document_user" action="open_board_document_manager"/>
|
||||
|
||||
<record model="ir.ui.view" id="board_document_manager_form1">
|
||||
<field name="name">board.document.manager.form1</field>
|
||||
<field name="model">board.board</field>
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
<field name="view_id" ref="board_hr_form"/>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_hr_root" icon="terp-hr" name="Human Resources" sequence="15" action="open_board_hr"/>
|
||||
<menuitem id="menu_hr_reporting" parent="base.menu_reporting" name="Human Resources" sequence="40" />
|
||||
<menuitem id="menu_hr_dashboard" parent="base.menu_reporting_dashboard" name="Human Resources" sequence="35"/>
|
||||
<menuitem id="menu_hr_dashboard_user" parent="menu_hr_dashboard" action="open_board_hr" icon="terp-graph" sequence="4"/>
|
||||
@@ -52,7 +51,5 @@
|
||||
<field name="view_id" ref="board_hr_manager_form"/>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_hr_dashboard_manager" parent="menu_hr_dashboard" icon="terp-graph" action="open_board_hr_manager" groups="base.group_hr_manager" sequence="5"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
@@ -526,11 +526,13 @@
|
||||
<xpath expr="//templates" position="before">
|
||||
<field name="current_leave_state"/>
|
||||
<field name="last_login"/>
|
||||
<field name="date_from"/>
|
||||
<field name="date_to"/>
|
||||
</xpath>
|
||||
<xpath expr="//div[@class='oe_employee_details']/ul/li" position="before">
|
||||
<li t-if="record.current_leave_id.raw_value || record.last_login.raw_value">
|
||||
<span t-if="record.current_leave_id.raw_value" t-att-class="record.current_leave_state.raw_value=='validate'?'oe_kanban_color_3':'oe_kanban_color_2'">
|
||||
<span class="oe_kanban_button" style="font-size: 100%%">
|
||||
<span class="oe_kanban_button" style="font-size: 100%%" t-att-title="record.date_from.raw_value.toString('ddd dS MMM') + ' - ' + record.date_to.raw_value.toString('ddd dS MMM')" >
|
||||
<field name="current_leave_id"/>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
@@ -2,18 +2,5 @@
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="property_rule_holidays_manager" model="ir.rule">
|
||||
<field name="name">Manager Holidays</field>
|
||||
<field model="ir.model" name="model_id" ref="model_hr_holidays"/>
|
||||
<field name="domain_force">[(1,'=',1)]</field>
|
||||
<field name="groups" eval="[(4,ref('base.group_hr_manager')), (4,ref('base.group_hr_user'))]"/>
|
||||
</record>
|
||||
<record id="property_rule_holidays_employee" model="ir.rule">
|
||||
<field name="name">Employee Holidays</field>
|
||||
<field model="ir.model" name="model_id" ref="model_hr_holidays"/>
|
||||
<field name="domain_force">[('employee_id.user_id','=',user.id)]</field>
|
||||
<field name="groups" eval="[(4,ref('base.group_user'))]"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -193,19 +193,26 @@
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window.view" id="action_membership_members_view_tree">
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="membership_members_tree"/>
|
||||
<field name="act_window_id" ref="action_membership_members"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window.view" id="action_membership_members_view_form">
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="sequence" eval="3"/>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="base.view_partner_form"/>
|
||||
<field name="act_window_id" ref="action_membership_members"/>
|
||||
</record>
|
||||
<record model="ir.actions.act_window.view" id="action_membership_members_view_kanban">
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="view_mode">kanban</field>
|
||||
<field name="view_id" ref="base.res_partner_kanban_view"/>
|
||||
<field name="act_window_id" ref="action_membership_members"/>
|
||||
</record>
|
||||
|
||||
<menuitem name="Association" id="base.menu_association" icon="terp-calendar" sequence="9" action="action_membership_members"/>
|
||||
<menuitem name="Members" parent="menu_membership" id="menu_members" sequence="2" action="action_membership_members"/>
|
||||
|
||||
<!-- PARTNERS -->
|
||||
|
||||
@@ -35,9 +35,5 @@
|
||||
id="menu_board_manufacturing" parent="menus_dash_mrp"
|
||||
sequence="1"/>
|
||||
|
||||
<menuitem icon="terp-mrp" id="base.menu_mrp_root" name="Manufacturing" sequence="8"
|
||||
action="open_board_manufacturing"/>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -263,20 +263,27 @@
|
||||
</record>
|
||||
|
||||
<record id="open_view_product_tree1" model="ir.actions.act_window.view">
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="product_product_tree_view"/>
|
||||
<field name="act_window_id" ref="product_normal_action_sell"/>
|
||||
</record>
|
||||
|
||||
<record id="open_view_product_form1" model="ir.actions.act_window.view">
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="sequence" eval="3"/>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="product_normal_form_view"/>
|
||||
<field name="act_window_id" ref="product_normal_action_sell"/>
|
||||
</record>
|
||||
|
||||
<menuitem id="base.menu_product" parent="base.menu_base_partner" name="Products" sequence="9"/>
|
||||
<record id="open_view_product_kanban1" model="ir.actions.act_window.view">
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="view_mode">kanban</field>
|
||||
<field name="view_id" ref="product_kanban_view"/>
|
||||
<field name="act_window_id" ref="product_normal_action"/>
|
||||
</record>
|
||||
|
||||
<menuitem id="base.menu_product" name="Products" parent="base.menu_base_partner" sequence="9"/>
|
||||
<menuitem action="product.product_normal_action_sell" id="product.menu_products" parent="base.menu_product" sequence="1"/>
|
||||
|
||||
<record id="product_normal_action_puchased" model="ir.actions.act_window">
|
||||
|
||||
@@ -117,9 +117,5 @@
|
||||
parent="menu_project_dashboard"
|
||||
sequence="1"/>
|
||||
|
||||
<menuitem
|
||||
icon="terp-project" id="base.menu_main_pm"
|
||||
name="Project" sequence="10" action="open_board_project"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -116,8 +116,5 @@
|
||||
parent="menu_purchase_deshboard"
|
||||
sequence="4"/>
|
||||
|
||||
<menuitem icon="terp-purchase" id="base.menu_purchase_root" action="open_board_purchase" name="Purchases"/>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -318,7 +318,7 @@
|
||||
</record>
|
||||
<menuitem action="purchase_rfq" id="menu_purchase_rfq"
|
||||
parent="menu_procurement_management"
|
||||
sequence="6"/>
|
||||
sequence="0"/>
|
||||
|
||||
<record id="purchase_form_action" model="ir.actions.act_window">
|
||||
<field name="name">Purchase Orders</field>
|
||||
@@ -329,7 +329,7 @@
|
||||
<field name="search_view_id" ref="view_purchase_order_filter"/>
|
||||
<field name="help">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.</field>
|
||||
</record>
|
||||
<menuitem action="purchase_form_action" id="menu_purchase_form_action" parent="menu_procurement_management" />
|
||||
<menuitem action="purchase_form_action" id="menu_purchase_form_action" parent="menu_procurement_management" sequence="6"/>
|
||||
|
||||
|
||||
<record id="purchase_order_line_form" model="ir.ui.view">
|
||||
|
||||
@@ -177,7 +177,7 @@
|
||||
|
||||
<menuitem
|
||||
id="menu_purchase_requisition_pro_mgt"
|
||||
sequence="0"
|
||||
sequence="10"
|
||||
parent="purchase.menu_procurement_management"
|
||||
action="action_purchase_requisition"/>
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
import sale
|
||||
import stock
|
||||
import res_partner
|
||||
import wizard
|
||||
import report
|
||||
import company
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -82,7 +82,9 @@
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="board_sales_form"/>
|
||||
</record>
|
||||
<menuitem id="menu_board_sales" parent="base.menu_reporting_dashboard" action="open_board_sales" sequence="15" groups="base.group_sale_salesman"/>
|
||||
|
||||
<menuitem id="menu_dashboard_sales" name="Sales" sequence="20" parent="base.menu_reporting_dashboard"/>
|
||||
<menuitem action="open_board_sales" icon="terp-graph" groups="base.group_sale_salesman" id="menu_board_sales" parent="menu_dashboard_sales" sequence="1"/>
|
||||
|
||||
<!-- Sale manager dashboard -->
|
||||
<record id="board_sales_manager_form" model="ir.ui.view">
|
||||
@@ -112,7 +114,5 @@
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="board_sales_manager_form"/>
|
||||
</record>
|
||||
<menuitem id="menu_board_sales_manager" parent="base.menu_reporting_dashboard" action="open_board_sales_manager" sequence="16" groups="base.group_sale_manager"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# 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 <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
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'),
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<!-- Partner kanban view inherte -->
|
||||
<record model="ir.ui.view" id="crm_lead_partner_kanban_view">
|
||||
<field name="name">res.partner.kanban.saleorder.inherit</field>
|
||||
<field name="model">res.partner</field>
|
||||
<field name="type">kanban</field>
|
||||
<field name="inherit_id" ref="base.res_partner_kanban_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="mobile" position="after">
|
||||
<field name="sale_order_count"/>
|
||||
</field>
|
||||
<xpath expr="//h4[@class='oe_partner_heading']" position="after">
|
||||
<a name="%(sale.act_res_partner_2_sale_order)d" type="action">
|
||||
<t t-if="record.sale_order_count.value">Sales(<t t-esc="record.sale_order_count.value" />)</t>
|
||||
</a>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<openerp>
|
||||
<data>
|
||||
<menuitem icon="terp-partner" id="base.menu_base_partner" name="Sales" sequence="1" groups="base.group_sale_salesman"/>
|
||||
<menuitem icon="terp-partner" id="base.menu_base_partner" name="Sales" sequence="1" groups="base.group_sale_salesman,base.group_sale_manager" action="base.action_partner_form"/>
|
||||
<menuitem id="base.menu_product" name="Products" parent="base.menu_base_partner" sequence="9"/>
|
||||
|
||||
|
||||
<record id="view_shop_form" model="ir.ui.view">
|
||||
<field name="name">sale.shop</field>
|
||||
|
||||
@@ -71,5 +71,6 @@
|
||||
<menuitem id="menu_board_warehouse" parent="base.menu_reporting_dashboard" action="open_board_warehouse" sequence="20" groups="group_stock_manager"/>
|
||||
<menuitem icon="terp-stock" id="stock.menu_stock_root" name="Warehouse" groups="group_stock_manager" sequence="5"/>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -125,6 +125,32 @@
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_receive_move" model="ir.actions.act_window">
|
||||
<field name="name">Receive Products</field>
|
||||
<field name="res_model">stock.move</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('product_id','=',active_id),('picking_id.type','=','in')]</field>
|
||||
<field name="view_id" ref="view_move_tree_reception_picking"/>
|
||||
<field name="context" eval="'{\'search_default_product_id\': [active_id]}'"/>
|
||||
<field name="search_view_id" ref="view_move_search_reception_incoming_picking"/>
|
||||
<field name="help">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.</field>
|
||||
</record>
|
||||
|
||||
<record id="action_deliver_move" model="ir.actions.act_window">
|
||||
<field name="name">Receive Products</field>
|
||||
<field name="res_model">stock.move</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('product_id','=',active_id),('picking_id.type','=','out')]</field>
|
||||
<field name="view_id" ref="view_move_tree_reception_picking"/>
|
||||
<field name="context" eval="'{\'search_default_product_id\': [active_id]}'"/>
|
||||
<field name="search_view_id" ref="view_move_search_reception_outcoming_picking"/>
|
||||
<field name="help">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).</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="product.product_kanban_view">
|
||||
<field name="name">Product Kanban</field>
|
||||
@@ -136,6 +162,8 @@
|
||||
<field name="type"/>
|
||||
<field name="product_image"/>
|
||||
<field name="list_price"/>
|
||||
<field name="reception_count"/>
|
||||
<field name="delivery_count"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_product_vignette">
|
||||
@@ -151,6 +179,12 @@
|
||||
<li>Price: <field name="lst_price"></field></li>
|
||||
<li>Cost: <field name="standard_price"></field></li>
|
||||
</ul>
|
||||
<a name="%(action_receive_move)d" type="action">
|
||||
<t t-if="record.reception_count.value">Receptions(<t t-esc="record.reception_count.value"/>)</t>
|
||||
</a>
|
||||
<a name="%(action_deliver_move)d" type="action">
|
||||
<t t-if="record.delivery_count.value">Deliveries(<t t-esc="record.delivery_count.value"/>)</t>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
}
|
||||
|
||||
.oe_product_img {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
-moz-border-radius: 3px;
|
||||
@@ -25,13 +25,13 @@
|
||||
}
|
||||
|
||||
.oe_product_photo {
|
||||
width: 100px;
|
||||
width: 150px;
|
||||
height: auto;
|
||||
clip: rect(5px, 100px, 105px, 0px);
|
||||
}
|
||||
|
||||
.oe_product_photo_wide {
|
||||
height: 100px;
|
||||
height: 150px;
|
||||
width: auto;
|
||||
clip: rect(0px, 110px, 100px, 10px);
|
||||
}
|
||||
|
||||
@@ -650,6 +650,7 @@ class stock_picking(osv.osv):
|
||||
'max_date': fields.function(get_min_max_date, fnct_inv=_set_maximum_date, multi="min_max_date",
|
||||
store=True, type='datetime', string='Max. Expected Date', select=2),
|
||||
'move_lines': fields.one2many('stock.move', 'picking_id', 'Internal Moves', states={'done': [('readonly', True)], 'cancel': [('readonly', True)]}),
|
||||
'product_id': fields.related('move_lines', 'product_id', type='many2one', relation='product.product', string='Product'),
|
||||
'auto_picking': fields.boolean('Auto-Picking', states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
|
||||
'partner_id': fields.many2one('res.partner', 'Partner', states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
|
||||
'invoice_state': fields.selection([
|
||||
|
||||
@@ -854,10 +854,11 @@
|
||||
<filter icon="terp-camera_test" name="confirmed" string="Waiting" domain="[('state','=','confirmed')]" help="Confirmed Internal Moves" />
|
||||
<filter icon="terp-dialog-close" name="done" string="Done" domain="[('state','=','done')]" help="Pickings already processed"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name"/>
|
||||
<field name="origin"/>
|
||||
<field name="name"
|
||||
domain="[('name','ilike', self),('origin','ilike',self)]"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="product_id"/>
|
||||
<field name="stock_journal_id" widget="selection"/>
|
||||
<field name="company_id" widget="selection"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By...">
|
||||
@@ -1085,10 +1086,10 @@
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="To Invoice" name="to_invoice" icon="terp-dolar" domain="[('invoice_state', '=', '2binvoiced')]" />
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name"/>
|
||||
<field name="origin"/>
|
||||
<field name="name"
|
||||
domain="[('name','ilike',self),('origin','ilike',self)]"/>
|
||||
<field name="stock_journal_id" widget="selection"/>
|
||||
<field name="company_id" widget="selection" groups="base.group_multi_company" />
|
||||
<field name="product_id"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By...">
|
||||
@@ -1135,9 +1136,6 @@
|
||||
</record>
|
||||
<menuitem action="action_picking_tree4" id="menu_action_picking_tree4" parent="menu_stock_warehouse_mgmt" sequence="1"/>
|
||||
|
||||
|
||||
|
||||
|
||||
<!--
|
||||
STOCK MOVES
|
||||
-->
|
||||
|
||||
Reference in New Issue
Block a user