bzr revid: uco@tinyerp.co.in-20100210100259-hanlc22b7plvb974
This commit is contained in:
uco (OpenERP)
2010-02-10 15:32:59 +05:30
10 changed files with 59 additions and 45 deletions
+11 -11
View File
@@ -9,9 +9,9 @@
<field name="name">Helpdesk Categories</field>
<field name="res_model">crm.case.categ</field>
<field name="view_type">form</field>
<field name="view_id" ref="crm.crm_case_categ_tree-view"/>
<field name="domain">[('object_id.model', '=', 'crm.helpdesk')]</field>
<field name="context">{'object_id':'crm.helpdesk'}</field>
<field name="view_id" ref="crm.crm_case_categ_tree-view"/>
<field name="domain">[('object_id.model', '=', 'crm.helpdesk')]</field>
<field name="context">{'object_id':'crm.helpdesk'}</field>
</record>
<menuitem action="crm_helpdesk_categ_action" id="menu_crm_case_helpdesk-act" parent="crm.menu_crm_case_categ"/>
# ------------------------------------------------------
@@ -26,9 +26,9 @@
<field name="arch" type="xml">
<form string="Helpdesk Support">
<group colspan="4" col="4">
<field colspan="4" name="name" select="1"/>
<field colspan="4" name="name" select="1"/>
<field name="date" select="1"/>
<field name="date_deadline" select="2"/>
<field name="date_deadline" select="2"/>
</group>
<notebook colspan="4">
<page string="General">
@@ -36,10 +36,10 @@
<group col="7" colspan="4">
<field name="partner_id" on_change="onchange_partner_id(partner_id, email_from)" select="1"/>
<field name="partner_address_id" on_change="onchange_partner_address_id(partner_address_id, email_from)" select="2"/>
<field name="email_from" select="2"/>
<button name="remind_partner" states="open,pending" string="Send Reminder" type="object" icon="gtk-go-forward"/>
</group>
<separator colspan="4" string="Categarization"/>
<group col="7" colspan="4">
@@ -156,7 +156,7 @@
</calendar>
</field>
</record>
<record id="view_crm_case_helpdesk_filter" model="ir.ui.view">
<field name="name">CRM - Helpdesk Search</field>
<field name="model">crm.helpdesk</field>
@@ -184,11 +184,11 @@
<field name="state" select="1">
<filter icon="gtk-index" domain="[('state','in',('open','draft' ))]" help="Current " default="1"/>
</field>
<field name="section_id" select="1" widget="selection" string="Section">
<field name="section_id" default="context.get('section_id', False)" select="1" widget="selection" string="Section">
<filter icon="terp-crm"
domain="[('section_id','=',context.get('section_id',False))]"
help="My section"/>
</field>
help="My section"/>
</field>
</group>
</search>
</field>
+17 -17
View File
@@ -43,11 +43,11 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<!-- <menuitem
<menuitem
name="Storage Media"
action="action_document_storage_form"
id="menu_document_storage_media"
parent="menu_document_configuration"/>-->
parent="menu_document_management_configuration"/>
<record model="ir.ui.view" id="view_document_directory_form">
<field name="name">document.directory</field>
@@ -173,14 +173,13 @@
<field name="priority" eval="1"/>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Files">
<form string="Documents">
<group colspan="4" col="6">
<field name="name" select="1" />
<field name="title" select="1"/>
<field name="partner_id"/>
<field name="user_id"/>
<field name="create_uid" select="2"/>
<field name="create_date" select="2"/>
<field name="parent_id" select="2"/>
</group>
<notebook colspan="4">
<page string="Attachment">
@@ -208,17 +207,18 @@
<field name="index_content" nolabel="1" colspan="4" select="1"/>
</page><page string="Security">
<field name="group_ids" colspan="4" nolabel="1"/>
</page><page string="Others Info">
<group colspan="2" col="2">
<separator string="History" colspan="2"/>
<field name="write_date"/>
</page><page string="Others Info">
<group colspan="4" col="4">
<separator string="File Information" colspan="4"/>
<field name="file_size" readonly="1"/>
<newline/>
<separator string="History" colspan="4"/>
<field name="create_uid"/>
<field name="create_date"/>
<field name="write_uid"/>
</group>
<group colspan="2" col="2">
<separator string="File Information" colspan="2"/>
<field name="file_size" readonly="1"/>
<field name="parent_id" select="2"/>
</group>
<field name="write_date"/>
</group>
</page><page string="Notes">
<field colspan="4" name="description" nolabel="1"/>
</page>
@@ -232,7 +232,7 @@
<field name="type">tree</field>
<field name="priority" eval="1"/>
<field name="arch" type="xml">
<tree string="Files">
<tree string="Documents">
<field name="name"/>
<field name="title" />
<field name="partner_id"/>
@@ -251,7 +251,7 @@
</record>
<menuitem name="Documents" id="menu_document_doc" parent="base.menu_document" sequence="5"/>
<menuitem
name="Search a File"
name="Documents"
action="action_document_file_form"
id="menu_document_files"
parent="menu_document_doc"/>
+10 -1
View File
@@ -598,7 +598,8 @@ class node_file(node_class):
if fil.parent_id:
self.storage_id = fil.parent_id.storage_id.id
else:
self.storage_id = None
self.storage_id = None
def get_data(self, cr, fil_obj = None):
""" Retrieve the data for some file.
@@ -607,12 +608,20 @@ class node_file(node_class):
the browse object. """
# this is where storage kicks in..
stor = self.storage_id
if not stor:
data_obj = self.context._dirobj.pool.get('ir.model.data')
data_id = data_obj._get_id(cr, self.context.uid, 'document', 'storage_db')
if data_id:
stor = data_obj.browse(cr, self.context.uid, data_id, context=self.context.context).res_id
assert stor
stobj = self.context._dirobj.pool.get('document.storage')
return stobj.get_data(cr,self.context.uid,stor, self,self.context.context, fil_obj)
def get_data_len(self, cr, fil_obj = None):
# TODO: verify with the storage object!
bin_size = self.context.context.get('bin_size', False)
if bin_size and not self.content_length:
self.content_length = fil_obj.db_datas
return self.content_length
def set_data(self, cr, data, fil_obj = None):
+1 -1
View File
@@ -167,7 +167,7 @@
</record>
<menuitem name="Point of Sale" id="menu_point_root" sequence="10"/>
<menuitem name="Point of Sale" id="menu_point_of_sale" parent="menu_point_root" sequence="1" />
<menuitem name="New Sale" parent="menu_point_of_sale" id="menu_point_ofsale" action="action_pos_pos_form" sequence="1"/>
<menuitem name="Sales Order" parent="menu_point_of_sale" id="menu_point_ofsale" action="action_pos_pos_form" sequence="1"/>
<menuitem action="product.product_normal_action" id="menu_pos_products" parent="menu_point_of_sale" sequence="2" name="Products"/>
<!-- POS Order view (date_payment) -->
@@ -34,11 +34,11 @@
<field eval="&quot;&quot;&quot;Trigger Invoice&quot;&quot;&quot;" name="name"/>
<field name="subflow_id" ref="account.process_process_invoiceprocess0"/>
<field eval="&quot;&quot;&quot;Trigger invoices from sale order lines&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_tasksprocess0"/>
<field name="process_id" ref="project.process_process_tasksprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='paid'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<!--
Process Transition
@@ -70,8 +70,8 @@
<field model="process.node" name="target_node_id" ref="process_node_triggerinvoice0"/>
<field model="process.node" name="source_node_id" ref="project.process_node_donetask0"/>
</record>
</data>
</openerp>
@@ -68,7 +68,7 @@
<field name="view_mode">tree</field>
<field name="search_view_id" ref="view_task_project_user_search"/>
</record>
<menuitem action="action_project_task_user_tree" id="menu_project_task_user_tree" parent="report_task.next_id_57"/>
<menuitem action="action_project_task_user_tree" id="menu_project_task_user_tree" parent="base.menu_project_report"/>
<!-- Tasks by projects -->
@@ -133,7 +133,7 @@
<field name="view_mode">tree</field>
<field name="search_view_id" ref="view_task_project_search"/>
</record>
<menuitem action="action_project_task_tree" id="menu_project_task_tree" parent="report_task.next_id_57"/>
<menuitem action="action_project_task_tree" id="menu_project_task_tree" parent="base.menu_project_report"/>
</data>
</openerp>
@@ -218,16 +218,16 @@ class survey_browse_response(report_rml):
</blockTable>"""
if survey.note:
rml += """<blockTable colWidths='""" + _tbl_widths + """' style="note_table">
<tr><td><para style="descriptive_text">""" + to_xml(tools.ustr(survey.note)) + """</para><para style="P2"><font></font></para></td></tr>
<tr><td><para style="response">""" + to_xml(tools.ustr(survey.note or '')) + """</para><para style="P2"><font></font></para></td></tr>
</blockTable>"""
for page in survey.page_ids:
rml += """<blockTable colWidths='""" + str(_tbl_widths) + """' style="page_tbl">
<tr><td><para style="page">Page :- """ + to_xml(tools.ustr(page.title)) + """</para></td></tr>
<tr><td><para style="page">Page :- """ + to_xml(tools.ustr(page.title or '')) + """</para></td></tr>
</blockTable>"""
if page.note:
rml += """<para style="P2"></para>
<blockTable colWidths='""" + str(_tbl_widths) + """' style="note_table">
<tr><td><para style="response">""" + to_xml(tools.ustr(page.note)) + """</para></td></tr>
<tr><td><para style="response">""" + to_xml(tools.ustr(page.note or '')) + """</para></td></tr>
</blockTable>"""
for que in page.question_ids:
rml += """<para style="P2"></para>
+5 -2
View File
@@ -31,6 +31,7 @@ from tools import to_xml
import tools
from mx.DateTime import *
import netsvc
import os
class survey_type(osv.osv):
_name = 'survey.type'
@@ -902,7 +903,7 @@ class survey_question_wiz(osv.osv_memory):
context.update({'response_id':response_id})
report = self.create_report(cr, uid, [int(survey_id)], 'report.survey.browse.response', survey_data.title,context)
attachments = []
file = open("/tmp/" + survey_data.title + ".pdf")
file = open(tools.config['addons_path'] + '/survey/report/' + survey_data.title + ".pdf")
file_data = ""
while 1:
line = file.readline()
@@ -910,6 +911,8 @@ class survey_question_wiz(osv.osv_memory):
if not line:
break
attachments.append((survey_data.title + ".pdf",file_data))
file.close()
os.remove(tools.config['addons_path'] + '/survey/report/' + survey_data.title + ".pdf")
user_email = False
resp_email = False
if user_obj.browse(cr, uid, uid).address_id.id:
@@ -938,7 +941,7 @@ class survey_question_wiz(osv.osv_memory):
if not report_name or not res_ids:
return (False, Exception('Report name and Resources ids are required !!!'))
try:
ret_file_name = '/tmp/'+file_name+'.pdf'
ret_file_name = tools.config['addons_path'] + '/survey/report/' + file_name + '.pdf'
service = netsvc.LocalService(report_name);
(result, format) = service.create(cr, uid, res_ids, {}, context)
fp = open(ret_file_name, 'wb+');
+1 -1
View File
@@ -3,7 +3,7 @@
<data>
<!-- <menuitem name="Survey Management" id="main_menu_survey" icon="terp-crm" sequence="1" groups="group_survey_manager,group_survey_user"/>-->
<menuitem icon="STOCK_PREFERENCES" id="base.menu_tools" name="Tools"/>
<menuitem icon="STOCK_PREFERENCES" id="base.menu_tools" name="Tools" sequence="15"/>
<menuitem name="Survey" id="main_menu_survey"
sequence="3" groups="group_survey_manager,group_survey_user"
parent="base.menu_tools" />
+4 -2
View File
@@ -114,7 +114,7 @@ def send_mail(self, cr, uid, data, context):
attachments = []
for id in survey_ref.browse(cr, uid, data['ids']):
report = create_report(cr, uid, [id.id], 'report.survey.form', id.title)
file = open("/tmp/" + id.title +".pdf")
file = open(tools.config['addons_path'] + '/survey/report/' + id.title +".pdf")
file_data = ""
while 1:
line = file.readline()
@@ -122,6 +122,8 @@ def send_mail(self, cr, uid, data, context):
if not line:
break
attachments.append((id.title +".pdf",file_data))
file.close()
os.remove(tools.config['addons_path'] + '/survey/report/' + id.title + ".pdf")
for partner in pool.get('res.partner').browse(cr, uid, partner_ids):
for addr in partner.address:
@@ -191,7 +193,7 @@ def create_report(cr, uid, res_ids, report_name=False, file_name=False):
if not report_name or not res_ids:
return (False, Exception('Report name and Resources ids are required !!!'))
try:
ret_file_name = '/tmp/'+file_name+'.pdf'
ret_file_name = tools.config['addons_path'] + '/survey/report/' + file_name + '.pdf'
service = netsvc.LocalService(report_name);
(result, format) = service.create(cr, uid, res_ids, {}, {})
fp = open(ret_file_name, 'wb+');