[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',
|
||||
|
||||
],
|
||||
|
|
|
@ -138,7 +138,7 @@
|
|||
groups="base.group_sale_salesman,base.group_sale_manager"
|
||||
colspan="4"/>
|
||||
<action
|
||||
string="My Win/Lost Ratio for the Last Year"
|
||||
string="My Win/Lost Ratio"
|
||||
name="%(act_sales_pipeline)d"
|
||||
groups="base.group_sale_salesman,base.group_sale_manager"
|
||||
colspan="4"/>
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<data>
|
||||
<menuitem
|
||||
id="menu_hr_reporting_holidays"
|
||||
name="Holidays"
|
||||
name="Leaves"
|
||||
parent="hr.menu_hr_reporting"
|
||||
sequence="6"/>
|
||||
</data>
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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'],
|
||||
|
|
|
@ -129,7 +129,5 @@
|
|||
<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>
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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"/>
|
||||
|
||||
|
|
|
@ -50,21 +50,7 @@
|
|||
</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>
|
||||
</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
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
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')})
|
||||
|
@ -523,6 +515,7 @@ class survey_question_wiz(osv.osv_memory):
|
|||
|
||||
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