[MERGE] merged with main addons trunk
bzr revid: qdp-launchpad@openerp.com-20111109150033-wj1740vdifkc5b3n
This commit is contained in:
commit
c6ab1b152a
|
@ -306,9 +306,9 @@ class account_invoice(osv.osv):
|
|||
view_id = view_id[0]
|
||||
res = super(account_invoice,self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
|
||||
|
||||
type = context.get('journal_type', 'sale')
|
||||
type = context.get('journal_type', False)
|
||||
for field in res['fields']:
|
||||
if field == 'journal_id':
|
||||
if field == 'journal_id' and type:
|
||||
journal_select = journal_obj._name_search(cr, uid, '', [('type', '=', type)], context=context, limit=None, name_get_uid=1)
|
||||
res['fields'][field]['selection'] = journal_select
|
||||
|
||||
|
|
|
@ -199,15 +199,15 @@
|
|||
</record>
|
||||
|
||||
<record id="conf_cli" model="account.account.template">
|
||||
<field name="code">111</field>
|
||||
<field name="code">12</field>
|
||||
<field name="name">Current Liabilities</field>
|
||||
<field ref="conf_nca" name="parent_id"/>
|
||||
<field ref="conf_bal" name="parent_id"/>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_liability_view1"/>
|
||||
</record>
|
||||
|
||||
<record id="conf_a_pay" model="account.account.template">
|
||||
<field name="code">1111</field>
|
||||
<field name="code">120</field>
|
||||
<field name="name">Creditors</field>
|
||||
<field ref="conf_cli" name="parent_id"/>
|
||||
<field name="type">payable</field>
|
||||
|
@ -216,7 +216,7 @@
|
|||
</record>
|
||||
|
||||
<record id="conf_iva" model="account.account.template">
|
||||
<field name="code">1112</field>
|
||||
<field name="code">121</field>
|
||||
<field name="name">Tax Received</field>
|
||||
<field ref="conf_cli" name="parent_id"/>
|
||||
<field name="type">other</field>
|
||||
|
@ -224,7 +224,7 @@
|
|||
</record>
|
||||
|
||||
<record id="conf_a_reserve_and_surplus" model="account.account.template">
|
||||
<field name="code">1113</field>
|
||||
<field name="code">122</field>
|
||||
<field name="name">Reserve and Profit/Loss Account</field>
|
||||
<field ref="conf_cli" name="parent_id"/>
|
||||
<field name="type">other</field>
|
||||
|
@ -233,7 +233,7 @@
|
|||
</record>
|
||||
|
||||
<record id="conf_o_expense" model="account.account.template">
|
||||
<field name="code">1114</field>
|
||||
<field name="code">123</field>
|
||||
<field name="name">Opening Expense Account</field>
|
||||
<field ref="conf_cli" name="parent_id"/>
|
||||
<field name="type">other</field>
|
||||
|
|
|
@ -44,8 +44,8 @@
|
|||
<filter string="Manager" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Associated Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Parent" icon="terp-folder-orange" domain="[]" context="{'group_by':'parent_id'}"/>
|
||||
<filter string="State" icon="terp-folder-green" domain="[]" context="{'group_by':'state'}" groups="base.group_no_one"/>
|
||||
<filter string="Parent Account" icon="terp-folder-green" domain="[]" context="{'group_by':'parent_id'}"/>
|
||||
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}" groups="base.group_no_one"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
|
|
|
@ -296,7 +296,7 @@
|
|||
<td><para style="P14"><font>[[ (a['type']<>'view' and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font') ]]</font><font color="white">[[ '..'*(a['level']-1) ]]</font><font>[[ a['name'] ]]</font> </para></td>
|
||||
<td><para style="P3"><font>[[ (a['type']<>'view' and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font') ]]</font><font>[[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['debit']) ]]</font><font>[[ a['type']<>'view' and removeParentNode('font') ]] [[formatLang(a['debit']) ]]</font></para></td>
|
||||
<td><para style="P3"><font>[[ (a['type']<>'view' and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font')]]</font><font>[[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['credit']) ]]</font><font>[[ a['type']<>'view' and removeParentNode('font') ]] [[ formatLang(a['credit']) ]]</font> </para></td>
|
||||
<td><para style="P3"><font>[[ (a['type']<>'view' and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font') ]]</font><font>[[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['balance'], currency_obj=company.currency_id) ]]</font><font>[[ a['type']<>'view' and removeParentNode('font') ]] [[ formatLang(a['balance'], currency = company.currency_id) ]]</font> </para></td>
|
||||
<td><para style="P3"><font>[[ (a['type']<>'view' and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font') ]]</font><font>[[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['balance'], currency_obj=company.currency_id) ]]</font><font>[[ a['type']<>'view' and removeParentNode('font') ]] [[ formatLang(a['balance'], currency_obj=company.currency_id) ]]</font> </para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P11">
|
||||
|
|
|
@ -55,7 +55,6 @@ Creates a dashboard for CRM that includes:
|
|||
'author': 'OpenERP SA',
|
||||
'website': 'http://www.openerp.com',
|
||||
'depends': [
|
||||
'base',
|
||||
'base_action_rule',
|
||||
'base_setup',
|
||||
'process',
|
||||
|
@ -88,6 +87,7 @@ Creates a dashboard for CRM that includes:
|
|||
'wizard/crm_add_note_view.xml',
|
||||
'wizard/crm_merge_opportunities_view.xml',
|
||||
|
||||
'board_crm_view.xml',
|
||||
'crm_view.xml',
|
||||
|
||||
'crm_action_rule_view.xml',
|
||||
|
@ -108,7 +108,6 @@ Creates a dashboard for CRM that includes:
|
|||
'crm_installer_view.xml',
|
||||
|
||||
'res_partner_view.xml',
|
||||
'board_crm_view.xml',
|
||||
'board_crm_statistical_view.xml',
|
||||
|
||||
],
|
||||
|
|
|
@ -117,32 +117,32 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="Sales Dashboard">
|
||||
<hpaned>
|
||||
<child1>
|
||||
<action
|
||||
string="My Open Opportunities"
|
||||
name="%(act_my_oppor)d"
|
||||
colspan="4"
|
||||
height="150"
|
||||
groups="base.group_sale_salesman,base.group_sale_manager"
|
||||
width="510"/>
|
||||
<action
|
||||
string="My Meetings"
|
||||
name="%(act_my_meetings)d"
|
||||
height="150"
|
||||
colspan="4"/>
|
||||
</child1>
|
||||
<child2>
|
||||
<action
|
||||
string="My Planned Revenues by Stage"
|
||||
name="%(act_my_oppor_stage)d"
|
||||
groups="base.group_sale_salesman,base.group_sale_manager"
|
||||
colspan="4"/>
|
||||
<action
|
||||
string="My Win/Lost Ratio for the Last Year"
|
||||
name="%(act_sales_pipeline)d"
|
||||
groups="base.group_sale_salesman,base.group_sale_manager"
|
||||
colspan="4"/>
|
||||
</child2>
|
||||
<child1>
|
||||
<action
|
||||
string="My Open Opportunities"
|
||||
name="%(act_my_oppor)d"
|
||||
colspan="4"
|
||||
height="150"
|
||||
groups="base.group_sale_salesman,base.group_sale_manager"
|
||||
width="510"/>
|
||||
<action
|
||||
string="My Meetings"
|
||||
name="%(act_my_meetings)d"
|
||||
height="150"
|
||||
colspan="4"/>
|
||||
</child1>
|
||||
<child2>
|
||||
<action
|
||||
string="My Planned Revenues by Stage"
|
||||
name="%(act_my_oppor_stage)d"
|
||||
groups="base.group_sale_salesman,base.group_sale_manager"
|
||||
colspan="4"/>
|
||||
<action
|
||||
string="My Win/Lost Ratio"
|
||||
name="%(act_sales_pipeline)d"
|
||||
groups="base.group_sale_salesman,base.group_sale_manager"
|
||||
colspan="4"/>
|
||||
</child2>
|
||||
</hpaned>
|
||||
</form>
|
||||
</field>
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
<data>
|
||||
|
||||
<menuitem icon="terp-partner" id="base.menu_base_partner" name="Sales" sequence="0"
|
||||
action="open_board_crm"
|
||||
groups="base.group_sale_manager,base.group_sale_salesman"/>
|
||||
|
||||
<menuitem id="base.menu_crm_config_lead" name="Leads & Opportunities"
|
||||
|
|
|
@ -200,6 +200,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<tree colors="red:state == 'refuse';blue:state == ' draft';black:state in ('confirm','validate','validate1')" string="Leaves Summary">
|
||||
<field name="employee_id"/>
|
||||
<field name="category_id" invisible="1"/>
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="type"/>
|
||||
<field name="name"/>
|
||||
|
@ -453,9 +454,9 @@
|
|||
|
||||
<!-- Shortcuts -->
|
||||
<act_window name="Leaves" domain="[('type','=','remove')]" context="{'search_default_employee_id': [active_id], 'default_employee_id': active_id}" res_model="hr.holidays" src_model="hr.employee" view_id="view_holiday" id="act_hr_employee_holiday_request"/>
|
||||
|
||||
|
||||
<!-- Assing leave -->
|
||||
|
||||
|
||||
<record id="hr_holidays_leaves_assign_tree_view" model="ir.ui.view">
|
||||
<field name="name">hr.employee.leave.tree</field>
|
||||
<field name="model">hr.employee</field>
|
||||
|
@ -466,7 +467,7 @@
|
|||
<field name="remaining_leaves" string="Remaining Legal Leaves"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="hr_holidays_leaves_assign_legal">
|
||||
<field name="name">Allocate Leaves for Employees</field>
|
||||
|
@ -484,7 +485,7 @@
|
|||
</record>
|
||||
|
||||
<!-- Hr employee inherit Legal Leaves -->
|
||||
|
||||
|
||||
<record id="view_employee_form_leave_inherit" model="ir.ui.view">
|
||||
<field name="name">hr.employee.leave.form.inherit</field>
|
||||
<field name="model">hr.employee</field>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<data>
|
||||
<menuitem
|
||||
id="menu_hr_reporting_holidays"
|
||||
name="Holidays"
|
||||
name="Leaves"
|
||||
parent="hr.menu_hr_reporting"
|
||||
sequence="6"/>
|
||||
</data>
|
||||
|
|
|
@ -313,7 +313,7 @@ class hr_timesheet_sheet(osv.osv):
|
|||
def _default_employee(self, cr, uid, context=None):
|
||||
emp_ids = self.pool.get('hr.employee').search(cr, uid, [('user_id','=',uid)], context=context)
|
||||
return emp_ids and emp_ids[0] or False
|
||||
|
||||
|
||||
_defaults = {
|
||||
'date_from' : _default_date_from,
|
||||
'date_current' : lambda *a: time.strftime('%Y-%m-%d'),
|
||||
|
@ -329,7 +329,7 @@ class hr_timesheet_sheet(osv.osv):
|
|||
if new_user_id:
|
||||
cr.execute('SELECT id \
|
||||
FROM hr_timesheet_sheet_sheet \
|
||||
WHERE (date_from < %s and %s < date_to) \
|
||||
WHERE (date_from <= %s and %s <= date_to) \
|
||||
AND user_id=%s \
|
||||
AND id <> %s',(sheet.date_to, sheet.date_from, new_user_id, sheet.id))
|
||||
if cr.fetchall():
|
||||
|
|
|
@ -35,7 +35,7 @@ class membership_invoice(osv.osv_memory):
|
|||
"""This function returns value of product's member price based on product id.
|
||||
"""
|
||||
if not product_id:
|
||||
return {'value': {'unit_price': False}}
|
||||
return {'value': {'member_price': False}}
|
||||
return {'value': {'member_price': self.pool.get('product.product').price_get(cr, uid, [product_id])[product_id]}}
|
||||
|
||||
def membership_invoice(self, cr, uid, ids, context=None):
|
||||
|
@ -67,4 +67,4 @@ class membership_invoice(osv.osv_memory):
|
|||
|
||||
membership_invoice()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<form string="Membership Invoice">
|
||||
<group colspan="4" >
|
||||
<field name="product_id" colspan="4" domain="[('membership','=',True)]" widget="selection" on_change="onchange_product(product_id)"/>
|
||||
<field name="member_price" colspan="4" readonly="1"/>
|
||||
<field name="member_price" colspan="4" />
|
||||
</group>
|
||||
<group colspan="4" col="6">
|
||||
<button icon="gtk-close" special="cancel" string="Close"/>
|
||||
|
|
|
@ -96,11 +96,11 @@ class pos_box_entries(osv.osv_memory):
|
|||
for data in self.read(cr, uid, ids, context=context):
|
||||
vals = {}
|
||||
curr_company = res_obj.browse(cr, uid, uid, context=context).company_id.id
|
||||
statement_id = statement_obj.search(cr, uid, [('journal_id', '=', data['journal_id']), ('company_id', '=', curr_company), ('user_id', '=', uid), ('state', '=', 'open')], context=context)
|
||||
statement_id = statement_obj.search(cr, uid, [('journal_id', '=', int(data['journal_id'])), ('company_id', '=', curr_company), ('user_id', '=', uid), ('state', '=', 'open')], context=context)
|
||||
if not statement_id:
|
||||
raise osv.except_osv(_('Error !'), _('You have to open at least one cashbox'))
|
||||
|
||||
acc_id = product_obj.browse(cr, uid, data['product_id']).property_account_income
|
||||
acc_id = product_obj.browse(cr, uid, int(data['product_id'])).property_account_income
|
||||
if not acc_id:
|
||||
raise osv.except_osv(_('Error !'), _('Please check that income account is set to %s')%(product_obj.browse(cr, uid, data['product_id']).name))
|
||||
if statement_id:
|
||||
|
|
|
@ -188,11 +188,10 @@ class purchase_order(osv.osv):
|
|||
'shipped_rate': fields.function(_shipped_rate, string='Received', type='float'),
|
||||
'invoiced': fields.function(_invoiced, string='Invoiced & Paid', type='boolean', help="It indicates that an invoice has been paid"),
|
||||
'invoiced_rate': fields.function(_invoiced_rate, string='Invoiced', type='float'),
|
||||
'invoice_method': fields.selection([('manual','Based on purchase order lines'),('order','Draft invoices pre-generated'),('picking','Based on receptions')], 'Invoicing Control', required=True,
|
||||
help="Based on orders: a draft invoice will be generated based on the purchase order. The accountant " \
|
||||
"will just have to validate this invoice for control.\n" \
|
||||
"Based on receptions: a draft invoice will be generated based on validated receptions.\n" \
|
||||
"Pre-generate Invoice: allows you to generate draft suppliers invoices on validation of the PO."
|
||||
'invoice_method': fields.selection([('manual','Based on Purchase Order lines'),('order','Based on generated invoice'),('picking','Based on receptions')], 'Invoicing Control', required=True,
|
||||
help="Based on Purchase Order lines: place individual lines in 'Invoice Control > Based on P.O. lines' frow where you can selectively create an invoice.\n" \
|
||||
"Based on generated invoice: create a draft invoice you can validate later.\n" \
|
||||
"Based on receptions: let you create an invoice when receptions are validated."
|
||||
),
|
||||
'minimum_planned_date':fields.function(_minimum_planned_date, fnct_inv=_set_minimum_planned_date, string='Expected Date', type='date', select=True, help="This is computed as the minimum scheduled date of all purchase order lines' products.",
|
||||
store = {
|
||||
|
@ -436,6 +435,7 @@ class purchase_order(osv.osv):
|
|||
picking_id = self.pool.get('stock.picking').create(cr, uid, {
|
||||
'name': pick_name,
|
||||
'origin': order.name+((order.origin and (':'+order.origin)) or ''),
|
||||
'date': order.date_order,
|
||||
'type': 'in',
|
||||
'address_id': order.dest_address_id.id or order.partner_address_id.id,
|
||||
'invoice_state': istate,
|
||||
|
|
|
@ -112,7 +112,7 @@
|
|||
<field name="help">Use this menu to control the invoices to be received from your supplier. OpenERP pregenerates draft invoices from your purchase orders or receptions, according to your settings. Once you receive a supplier invoice, you can match it with the draft invoice and validate it.</field>
|
||||
</record>
|
||||
|
||||
<menuitem name="Supplier Invoices to Receive"
|
||||
<menuitem name="Based on generated invoice"
|
||||
id="menu_procurement_management_pending_invoice"
|
||||
action="action_invoice_pending"
|
||||
parent="menu_procurement_management_invoice"
|
||||
|
@ -495,14 +495,14 @@
|
|||
|
||||
|
||||
<record id="purchase_line_form_action2" model="ir.actions.act_window">
|
||||
<field name="name">On Purchase Order Lines</field>
|
||||
<field name="name">Based on Purchase Order lines</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">purchase.order.line</field>
|
||||
<field name="domain">[('order_id.invoice_method','<>','picking'), ('state','in',('confirmed','done')), ('invoiced', '=', False)]</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="search_view_id" ref="purchase_order_line_search"/>
|
||||
<field name="help">If you set the invoicing control on a purchase order as "Based on Purchase Order Lines", you can track here all the purchase order lines for which you have not received the supplier invoice yet. Once you are ready to receive a supplier invoice, you can generate a draft supplier invoice based on the lines from this menu.</field>
|
||||
<field name="help">If you set the Invoicing Control on a purchase order as "Based on Purchase Order lines", you can track here all the purchase order lines for which you have not yet received the supplier invoice. Once you are ready to receive a supplier invoice, you can generate a draft supplier invoice based on the lines from this menu.</field>
|
||||
</record>
|
||||
<record id="purchase_line_form_action_tree2" model="ir.actions.act_window.view">
|
||||
<field eval="1" name="sequence"/>
|
||||
|
|
|
@ -104,7 +104,7 @@
|
|||
</record>
|
||||
|
||||
<record id="action_picking_tree4_picking_to_invoice" model="ir.actions.act_window">
|
||||
<field name="name">On Incoming Shipments</field>
|
||||
<field name="name">Based on receptions</field>
|
||||
<field name="res_model">stock.picking</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="view_type">form</field>
|
||||
|
@ -112,7 +112,7 @@
|
|||
<field name="domain">[('type','=','in')]</field>
|
||||
<field name="context">{'contact_display': 'partner_address',"search_default_done":1, "search_default_to_invoice":1}</field>
|
||||
<field name="search_view_id" ref="view_picking_in_search_picking_to_invoice"/>
|
||||
<field name="help">Create invoice from reception of products. If you selected this invoice control method in the purchase order, all receptions done are available here to be invoiced.</field>
|
||||
<field name="help">If you set the Invoicing Control on a purchase order as "Based on receptions", you can track here all the product receptions and create invoices for those receptions.</field>
|
||||
</record>
|
||||
|
||||
<menuitem action="action_picking_tree4_picking_to_invoice"
|
||||
|
|
|
@ -77,11 +77,11 @@ Dashboard for Sales Manager that includes:
|
|||
'sale_workflow.xml',
|
||||
'sale_sequence.xml',
|
||||
'sale_data.xml',
|
||||
'board_sale_view.xml',
|
||||
'sale_view.xml',
|
||||
'report/sale_report_view.xml',
|
||||
'sale_report.xml',
|
||||
'stock_view.xml',
|
||||
'board_sale_view.xml',
|
||||
'process/sale_process.xml',
|
||||
],
|
||||
'demo_xml': ['sale_demo.xml'],
|
||||
|
|
|
@ -33,68 +33,68 @@
|
|||
<menuitem id="board.menu_dasboard" name="Dashboard" sequence="0" parent="base.next_id_64"/>
|
||||
<menuitem action="open_board_sales_manager" icon="terp-graph" id="menu_board_sales_manager" parent="board.menu_dasboard" sequence="0" groups="base.group_sale_manager"/>
|
||||
|
||||
|
||||
<record id="action_quotation_for_sale" model="ir.actions.act_window">
|
||||
<field name="name">My Quotations</field>
|
||||
<field name="res_model">sale.order</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('state','=','draft'),('user_id','=',uid)]</field>
|
||||
<field name="view_id" ref="sale.view_order_tree"/>
|
||||
</record>
|
||||
|
||||
<record id="view_turnover_by_month_tree" model="ir.ui.view">
|
||||
<field name="name">turnover.by.month.tree</field>
|
||||
<field name="model">account.invoice.report</field>
|
||||
<field name="type">tree</field>
|
||||
|
||||
<record id="action_quotation_for_sale" model="ir.actions.act_window">
|
||||
<field name="name">My Quotations</field>
|
||||
<field name="res_model">sale.order</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('state','=','draft'),('user_id','=',uid)]</field>
|
||||
<field name="view_id" ref="sale.view_order_tree"/>
|
||||
</record>
|
||||
|
||||
<record id="view_turnover_by_month_tree" model="ir.ui.view">
|
||||
<field name="name">turnover.by.month.tree</field>
|
||||
<field name="model">account.invoice.report</field>
|
||||
<field name="type">tree</field>
|
||||
<!-- Lower priority to avoid conflicting with default accounting views for reports -->
|
||||
<field name="priority" eval="32"/>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Monthly Turnover">
|
||||
<field name="month"/>
|
||||
<field name="price_total"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_turnover_by_month_graph" model="ir.ui.view">
|
||||
<field name="name">turnover.by.month.graph</field>
|
||||
<field name="model">account.invoice.report</field>
|
||||
<field name="priority" eval="32"/>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Monthly Turnover">
|
||||
<field name="month"/>
|
||||
<field name="price_total"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_turnover_by_month_graph" model="ir.ui.view">
|
||||
<field name="name">turnover.by.month.graph</field>
|
||||
<field name="model">account.invoice.report</field>
|
||||
<!-- Lower priority to avoid conflicting with default accounting views for reports -->
|
||||
<field name="priority" eval="32"/>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Monthly Turnover" type="bar">
|
||||
<field name="month"/>
|
||||
<field name="price_total" operator="+"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_turnover_by_month">
|
||||
<field name="name">Monthly Turnover</field>
|
||||
<field name="res_model">account.invoice.report</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">graph,tree</field>
|
||||
<field name="view_id" ref="view_turnover_by_month_graph"/>
|
||||
<field name="domain">[('year','ilike',time.strftime('%Y')),('user_id','=',uid)]</field>
|
||||
<field name="context">{'group_by_no_leaf':1,'group_by':['month']}</field>
|
||||
<field name="search_view_id" ref="account.view_account_invoice_report_search"/>
|
||||
<field name="priority" eval="32"/>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Monthly Turnover" type="bar">
|
||||
<field name="month"/>
|
||||
<field name="price_total" operator="+"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_turnover_by_month">
|
||||
<field name="name">Monthly Turnover</field>
|
||||
<field name="res_model">account.invoice.report</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">graph,tree</field>
|
||||
<field name="view_id" ref="view_turnover_by_month_graph"/>
|
||||
<field name="domain">[('year','ilike',time.strftime('%Y')),('user_id','=',uid)]</field>
|
||||
<field name="context">{'group_by_no_leaf':1,'group_by':['month']}</field>
|
||||
<field name="search_view_id" ref="account.view_account_invoice_report_search"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window.view" id="action_turnover_by_month_graph_view">
|
||||
<field name="act_window_id" ref="action_turnover_by_month"/>
|
||||
<field name="view_mode">graph</field>
|
||||
<field name="view_id" ref="view_turnover_by_month_graph"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window.view" id="action_turnover_by_month_graph_view">
|
||||
<field name="act_window_id" ref="action_turnover_by_month"/>
|
||||
<field name="view_mode">graph</field>
|
||||
<field name="view_id" ref="view_turnover_by_month_graph"/>
|
||||
|
||||
<record model="ir.actions.act_window.view" id="action_turnover_by_month_tree_view">
|
||||
<field name="act_window_id" ref="action_turnover_by_month"/>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="view_turnover_by_month_tree"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window.view" id="action_turnover_by_month_tree_view">
|
||||
<field name="act_window_id" ref="action_turnover_by_month"/>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="view_turnover_by_month_tree"/>
|
||||
</record>
|
||||
|
||||
<record id="board_sales_form" model="ir.ui.view">
|
||||
|
||||
<record id="board_sales_form" model="ir.ui.view">
|
||||
<field name="name">board.sales.form</field>
|
||||
<field name="model">board.board</field>
|
||||
<field name="type">form</field>
|
||||
|
@ -103,33 +103,31 @@
|
|||
<hpaned position="100">
|
||||
<child1>
|
||||
<action
|
||||
name="%(action_quotation_for_sale)d"
|
||||
string="My Quotations"
|
||||
height="150"
|
||||
width="510"
|
||||
groups="base.group_sale_salesman,base.group_sale_manager,account.group_account_user,stock.group_stock_user"/>
|
||||
name="%(action_quotation_for_sale)d"
|
||||
string="My Quotations"
|
||||
height="150"
|
||||
width="510"
|
||||
groups="base.group_sale_salesman,base.group_sale_manager,account.group_account_user,stock.group_stock_user"/>
|
||||
</child1>
|
||||
<child2>
|
||||
<action
|
||||
string="Monthly Turnover"
|
||||
name="%(action_turnover_by_month)d"
|
||||
groups="base.group_sale_salesman,account.group_account_manager"
|
||||
colspan="4"/>
|
||||
</child2>
|
||||
<child2>
|
||||
<action
|
||||
string="Monthly Turnover"
|
||||
name="%(action_turnover_by_month)d"
|
||||
groups="base.group_sale_salesman,account.group_account_manager"
|
||||
colspan="4"/>
|
||||
</child2>
|
||||
</hpaned>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="open_board_sales" model="ir.actions.act_window">
|
||||
|
||||
<record id="open_board_sales" model="ir.actions.act_window">
|
||||
<field name="name">Sales Dashboard</field>
|
||||
<field name="res_model">board.board</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="board_sales_form"/>
|
||||
</record>
|
||||
|
||||
<menuitem action="open_board_sales" icon="terp-graph" id="menu_board_sales" parent="board.menu_dasboard" sequence="0" groups="base.group_sale_manager"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -110,7 +110,7 @@ class sale_order(osv.osv):
|
|||
for item in cr.dictfetchall():
|
||||
if item['move_state'] == 'cancel':
|
||||
continue
|
||||
|
||||
|
||||
if item['picking_type'] == 'in':#this is a returned picking
|
||||
tmp[item['sale_order_id']]['total'] -= item['nbr'] or 0.0 # Deducting the return picking qty
|
||||
if item['procurement_state'] == 'done' or item['move_state'] == 'done':
|
||||
|
@ -125,7 +125,7 @@ class sale_order(osv.osv):
|
|||
res[order.id] = 100.0
|
||||
else:
|
||||
res[order.id] = tmp[order.id]['total'] and (100.0 * tmp[order.id]['picked'] / tmp[order.id]['total']) or 0.0
|
||||
return res
|
||||
return res
|
||||
|
||||
def _invoiced_rate(self, cursor, user, ids, name, arg, context=None):
|
||||
res = {}
|
||||
|
@ -726,6 +726,7 @@ class sale_order(osv.osv):
|
|||
return {
|
||||
'name': pick_name,
|
||||
'origin': order.name,
|
||||
'date': order.date_order,
|
||||
'type': 'out',
|
||||
'state': 'auto',
|
||||
'move_type': order.picking_policy,
|
||||
|
@ -898,7 +899,7 @@ class sale_order_line(osv.osv):
|
|||
return result[1]
|
||||
except Exception, ex:
|
||||
return False
|
||||
|
||||
|
||||
_name = 'sale.order.line'
|
||||
_description = 'Sales Order Line'
|
||||
_columns = {
|
||||
|
@ -1266,7 +1267,7 @@ sale_order_line()
|
|||
class sale_config_picking_policy(osv.osv_memory):
|
||||
_name = 'sale.config.picking_policy'
|
||||
_inherit = 'res.config'
|
||||
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Name', size=64),
|
||||
'sale_orders': fields.boolean('Based on Sales Orders',),
|
||||
|
@ -1307,7 +1308,7 @@ class sale_config_picking_policy(osv.osv_memory):
|
|||
|
||||
if wizard.sale_orders:
|
||||
menu_id = data_obj.get_object(cr, uid, 'sale', 'menu_invoicing_sales_order_lines').id
|
||||
menu_obj.write(cr, uid, menu_id, {'groups_id':[(4,group_id)]})
|
||||
menu_obj.write(cr, uid, menu_id, {'groups_id':[(4,group_id)]})
|
||||
|
||||
if wizard.deli_orders:
|
||||
menu_id = data_obj.get_object(cr, uid, 'sale', 'menu_action_picking_list_to_invoice').id
|
||||
|
@ -1345,7 +1346,7 @@ class sale_config_picking_policy(osv.osv_memory):
|
|||
product_obj = self.pool.get('product.product')
|
||||
product_obj.write(cr, uid, prod_id, {'uom_id':wizard.time_unit.id, 'uom_po_id': wizard.time_unit.id})
|
||||
|
||||
ir_values_obj.set(cr, uid, 'default', False, 'order_policy', ['sale.order'], wizard.order_policy)
|
||||
ir_values_obj.set(cr, uid, 'default', False, 'order_policy', ['sale.order'], wizard.order_policy)
|
||||
if wizard.task_work and wizard.time_unit:
|
||||
company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id
|
||||
self.pool.get('res.company').write(cr, uid, [company_id], {
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
<openerp>
|
||||
<data>
|
||||
<menuitem icon="terp-partner" id="base.menu_base_partner" name="Sales" sequence="0" groups="base.group_sale_salesman,base.group_sale_manager"/>
|
||||
<menuitem icon="terp-partner"
|
||||
id="base.menu_base_partner" name="Sales" action="open_board_sales"
|
||||
sequence="0" groups="base.group_sale_salesman,base.group_sale_manager"/>
|
||||
|
||||
<menuitem id="base.menu_sales" name="Sales" parent="base.menu_base_partner" sequence="1"/>
|
||||
<menuitem id="base.menu_sales" name="Sales"
|
||||
parent="base.menu_base_partner" sequence="1"
|
||||
/>
|
||||
|
||||
<menuitem id="base.menu_product" name="Products" parent="base.menu_base_partner" sequence="9"/>
|
||||
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record model="ir.ui.view" id="board_crm_form_inherit_replace1">
|
||||
<record model="ir.ui.view" id="board_crm_form_inherit_replace1">
|
||||
<field name="name">board.crm.form.inherit.replace1</field>
|
||||
<field name="model">board.board</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="sale.board_sales_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/form/hpaned/child1/action[@string='My Quotations']" position="before">
|
||||
<action
|
||||
<xpath expr="/form/hpaned/child1/action[@string='My Quotations']" position="before">
|
||||
<action
|
||||
string="My Open Opportunities"
|
||||
name="%(crm.act_my_oppor)d"
|
||||
colspan="4"
|
||||
height="150"
|
||||
groups="base.group_sale_salesman,base.group_sale_manager"
|
||||
width="510"/>
|
||||
</xpath>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
@ -25,13 +25,13 @@
|
|||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="sale.board_sales_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/form/hpaned/child1/action[@string='My Quotations']" position="after">
|
||||
<action
|
||||
<xpath expr="/form/hpaned/child1/action[@string='My Quotations']" position="after">
|
||||
<action
|
||||
string="My Meetings"
|
||||
name="%(crm.act_my_meetings)d"
|
||||
height="150"
|
||||
colspan="4"/>
|
||||
</xpath>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
@ -41,30 +41,16 @@
|
|||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="sale.board_sales_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/form/hpaned/child2/action[@string='Monthly Turnover']" position="before">
|
||||
<action
|
||||
<xpath expr="/form/hpaned/child2/action[@string='Monthly Turnover']" position="before">
|
||||
<action
|
||||
string="My Planned Revenues by Stage"
|
||||
name="%(crm.act_my_oppor_stage)d"
|
||||
groups="base.group_sale_salesman,base.group_sale_manager"
|
||||
colspan="4"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="board_crm_form_inherit_replace4">
|
||||
<field name="name">board.crm.form.inherit.replace1</field>
|
||||
<field name="model">board.board</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="sale.board_sales_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/form/hpaned/child2/action[@string='Monthly Turnover']" position="after">
|
||||
<action
|
||||
string="My Win/Lost Ratio for the Last Year"
|
||||
name="%(crm.act_sales_pipeline)d"
|
||||
groups="base.group_sale_salesman,base.group_sale_manager"
|
||||
colspan="4"/>
|
||||
</xpath>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<menuitem icon="terp-partner"
|
||||
id="base.menu_base_partner" action="sale.open_board_sales"/>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -49,7 +49,10 @@ Thanks to the double entry management, the inventory controlling is powerful and
|
|||
"depends" : ["product", "account"],
|
||||
"category" : "Warehouse Management",
|
||||
"init_xml" : [],
|
||||
"demo_xml" : ["stock_demo.xml"],
|
||||
"demo_xml" : [
|
||||
"stock_demo.xml",
|
||||
"stock_demo_picking.yml",
|
||||
],
|
||||
"update_xml" : [
|
||||
"security/stock_security.xml",
|
||||
"security/ir.model.access.csv",
|
||||
|
|
|
@ -266,13 +266,5 @@
|
|||
<field eval="'account.account,'+str(ref('account.a_recv'))" model="account.account" name="value"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
<record id="stock_picking_1" model="stock.picking">
|
||||
<field name="name">PACKO1</field>
|
||||
<field name="type">out</field>
|
||||
<field name="move_type">direct</field>
|
||||
<field name="invoice_state">2binvoiced</field>
|
||||
<field name="address_id" ref="res_partner_address_fabien0"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
-
|
||||
!record {model: stock.picking, id: stock_picking_1}:
|
||||
type: out
|
||||
company_id: base.main_company
|
||||
address_id: res_partner_address_fabien0
|
||||
move_lines:
|
||||
- product_id: product.product_product_cpu1
|
||||
product_uom: product.product_uom_unit
|
||||
product_uos_qty: 5.0
|
||||
product_qty: 5.0
|
||||
location_dest_id: stock.stock_location_customers
|
||||
location_id: stock.stock_location_stock
|
||||
name: CPU1, Processor AMD Athlon XP 1800
|
||||
- product_id: product.product_product_cpu3
|
||||
product_uom: product.product_uom_unit
|
||||
product_uos_qty: 5.0
|
||||
product_qty: 5.0
|
||||
location_dest_id: stock.stock_location_customers
|
||||
location_id: stock.stock_location_stock
|
||||
name: CPU3, Processor AMD Athlon XP 1800
|
||||
|
|
@ -147,7 +147,7 @@
|
|||
id = self.create(cr, uid, {'survey_id': ref("survey_partner_0")})
|
||||
self.action_next(cr, uid, [id], context)
|
||||
-
|
||||
Give answer of the first and second page in "Partner Feedback" suvey.
|
||||
Give answer of the first and second page in "Partner Feedback" survey.
|
||||
-
|
||||
!python {model: survey.question.wiz}: |
|
||||
ids = self.create(cr, uid, {str(ref("survey_p_question_0")) +"_single" :'Tiny' , str(ref("survey_p_question_1")) + "_selection" :int(ref("survey_p_1_1"))}, context)
|
||||
|
|
|
@ -42,7 +42,8 @@ class survey_question_wiz(osv.osv_memory):
|
|||
"""
|
||||
Fields View Get method :- generate the new view and display the survey pages of selected survey.
|
||||
"""
|
||||
|
||||
if context is None:
|
||||
context = {}
|
||||
result = super(survey_question_wiz, self).fields_view_get(cr, uid, view_id, \
|
||||
view_type, context, toolbar,submenu)
|
||||
|
||||
|
@ -55,8 +56,7 @@ class survey_question_wiz(osv.osv_memory):
|
|||
que_col_head = self.pool.get('survey.question.column.heading')
|
||||
user_obj = self.pool.get('res.users')
|
||||
mail_message = self.pool.get('mail.message')
|
||||
if context is None:
|
||||
context = {}
|
||||
|
||||
if view_type in ['form']:
|
||||
wiz_id = 0
|
||||
sur_name_rec = None
|
||||
|
@ -407,21 +407,13 @@ class survey_question_wiz(osv.osv_memory):
|
|||
attachments[survey_data.title + ".pdf"] = file_data
|
||||
file.close()
|
||||
os.remove(addons.get_module_resource('survey', 'report') + survey_data.title + ".pdf")
|
||||
user_email = False
|
||||
resp_email = False
|
||||
|
||||
user_email = user_obj.browse(cr, uid, uid, context).user_email
|
||||
resp_email = survey_data.responsible_id and survey_data.responsible_id.user_email or False
|
||||
|
||||
address_id = user_obj.browse(cr, uid, uid).address_id.id
|
||||
if address_id:
|
||||
cr.execute("select email from res_partner_address where id =%s", (address_id,))
|
||||
user_email = cr.fetchone()[0]
|
||||
resp_id = survey_data.responsible_id.address_id
|
||||
|
||||
if resp_id:
|
||||
cr.execute("select email from res_partner_address where id =%s", (resp_id.id,))
|
||||
resp_email = cr.fetchone()[0]
|
||||
if user_email and resp_email:
|
||||
user_name = user_obj.browse(cr, uid, uid, context=context).name
|
||||
mail = "Hello " + survey_data.responsible_id.name + ",\n\n " + str(user_name) + " Give Response Of " + survey_data.title + " Survey.\n\n Thanks,"
|
||||
mail = "Hello " + survey_data.responsible_id.name + ",\n\n " + str(user_name) + " has given the Response Of " + survey_data.title + " Survey.\nThe Response has been attached herewith.\n\n Thanks."
|
||||
mail_message.schedule_with_attach(cr, uid, user_email, [resp_email], "Survey Answer Of " + str(user_name) , mail, attachments=attachments, context=context)
|
||||
|
||||
xml_form = etree.Element('form', {'string': _('Complete Survey Answer')})
|
||||
|
@ -520,9 +512,10 @@ class survey_question_wiz(osv.osv_memory):
|
|||
return value
|
||||
if context.has_key('active') and context.get('active',False):
|
||||
return value
|
||||
|
||||
|
||||
sur_name_read = surv_name_wiz.read(cr, uid, context.get('sur_name_id',False))
|
||||
ans_list = []
|
||||
|
||||
for key,val in safe_eval(sur_name_read.get('store_ans',"{}")).items():
|
||||
for field in fields_list:
|
||||
if field in list(val):
|
||||
|
@ -535,8 +528,10 @@ class survey_question_wiz(osv.osv_memory):
|
|||
Create the Answer of survey and store in survey.response object, and if set validation of question then check the value of question if value is wrong then raise the exception.
|
||||
"""
|
||||
if context is None: context = {}
|
||||
|
||||
survey_question_wiz_id = super(survey_question_wiz,self).create(cr, uid, vals, context=context)
|
||||
if context.has_key('active') and context.get('active',False):
|
||||
return True
|
||||
return survey_question_wiz_id
|
||||
|
||||
for key,val in vals.items():
|
||||
if key.split('_')[0] == "progress":
|
||||
|
@ -982,7 +977,7 @@ class survey_question_wiz(osv.osv_memory):
|
|||
if que_rec['type'] in ['multiple_choice_only_one_ans','single_textbox','comment'] and que_rec['is_require_answer'] and select_count <= 0:
|
||||
raise osv.except_osv(_('Warning !'), "'" + que_rec['question'] + "' " + tools.ustr(que_rec['req_error_msg']))
|
||||
|
||||
return True
|
||||
return survey_question_wiz_id
|
||||
|
||||
def action_new_question(self,cr, uid, ids, context=None):
|
||||
"""
|
||||
|
|
|
@ -41,6 +41,7 @@ class survey_name_wiz(osv.osv_memory):
|
|||
'transfer': 1,
|
||||
'response': 0,
|
||||
'survey_id': lambda self,cr,uid,context:context.get('survey_id',False),
|
||||
'store_ans': '{}' #Setting the default pattern as '{}' as the field is of type text. The field always gets the value in dict format
|
||||
}
|
||||
|
||||
def action_next(self, cr, uid, ids, context=None):
|
||||
|
@ -68,7 +69,6 @@ class survey_name_wiz(osv.osv_memory):
|
|||
raise osv.except_osv(_('Warning !'),_("You can not give more response. Please contact the author of this survey for further assistance."))
|
||||
|
||||
search_id = search_obj.search(cr,uid,[('model','=','survey.question.wiz'),('name','=','Survey Search')])
|
||||
|
||||
return {
|
||||
'view_type': 'form',
|
||||
"view_mode": 'form',
|
||||
|
|
Loading…
Reference in New Issue