[MERGE] merge with main branch changes from dev2 team from trunk addons => Remove conflicts on idea
bzr revid: mra@tinyerp.com-20100601084216-0yihd6bc3knvskdp
This commit is contained in:
commit
59a5344427
|
@ -951,23 +951,8 @@ class account_invoice(osv.osv):
|
|||
return taxes.values()
|
||||
|
||||
def _log_event(self, cr, uid, ids, factor=1.0, name='Open Invoice'):
|
||||
invs = self.read(cr, uid, ids, ['type','partner_id','amount_untaxed'])
|
||||
for inv in invs:
|
||||
part=inv['partner_id'] and inv['partner_id'][0]
|
||||
pc = pr = 0.0
|
||||
cr.execute('select sum(quantity*price_unit) from account_invoice_line where invoice_id=%s', (inv['id'],))
|
||||
total = inv['amount_untaxed']
|
||||
if inv['type'] in ('in_invoice','in_refund'):
|
||||
partnertype='supplier'
|
||||
eventtype = 'purchase'
|
||||
pc = total*factor
|
||||
else:
|
||||
partnertype = 'customer'
|
||||
eventtype = 'sale'
|
||||
pr = total*factor
|
||||
if self.pool.get('res.partner.event.type').check(cr, uid, 'invoice_open'):
|
||||
self.pool.get('res.partner.event').create(cr, uid, {'name':'Invoice: '+name, 'som':False, 'description':name+' '+str(inv['id']), 'document':name, 'partner_id':part, 'date':time.strftime('%Y-%m-%d %H:%M:%S'), 'canal_id':False, 'user_id':uid, 'partner_type':partnertype, 'probability':1.0, 'planned_revenue':pr, 'planned_cost':pc, 'type':eventtype})
|
||||
return len(invs)
|
||||
#TODO: implement messages system
|
||||
return True
|
||||
|
||||
def name_get(self, cr, uid, ids, context=None):
|
||||
if not len(ids):
|
||||
|
|
|
@ -74,13 +74,13 @@
|
|||
<page string="Accounting" position="inside">
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Customer Accounting Properties" colspan="2"/>
|
||||
<field name="property_account_receivable" />
|
||||
<field name="property_account_receivable" groups="account.group_account_user" />
|
||||
<field name="property_account_position" widget="selection"/>
|
||||
<field name="property_payment_term" widget="selection"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Supplier Accounting Properties" colspan="2"/>
|
||||
<field name="property_account_payable"/>
|
||||
<field name="property_account_payable" groups="account.group_account_user"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Customer Credit" colspan="2"/>
|
||||
|
@ -132,11 +132,13 @@
|
|||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="base.view_partner_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<notebook position="inside">
|
||||
<page string="Project">
|
||||
<field name="contract_ids" colspan="4" nolabel="1" />
|
||||
</page>
|
||||
</notebook>
|
||||
<xpath expr="//notebook[last()]" position="after">
|
||||
<notebook colspan="4">
|
||||
<page string="Project">
|
||||
<field name="contract_ids" colspan="4" nolabel="1" />
|
||||
</page>
|
||||
</notebook>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
|
|
@ -56,15 +56,15 @@
|
|||
<field name="server_action_id"/>
|
||||
<field name="filter_id"/>
|
||||
</page>
|
||||
<page string="E-Mail Actions">
|
||||
<page string="Email Actions">
|
||||
<!-- <group col="4" colspan="2">-->
|
||||
<separator colspan="4" string="Template of Email to Send"/>
|
||||
<separator colspan="4" string="Email Information"/>
|
||||
<field name="act_mail_to_watchers"/>
|
||||
<field name="act_mail_to_user"/>
|
||||
<field colspan="4" name="act_mail_to_email"/>
|
||||
<!-- </group>-->
|
||||
<!-- <group col="4" colspan="2">-->
|
||||
<separator colspan="4" string="E-Mail Reminders (includes the content of the object)"/>
|
||||
<separator colspan="4" string="Email Reminders"/>
|
||||
<field name="act_remind_partner"/>
|
||||
<field name="act_remind_attach"/>
|
||||
<field name="act_remind_user"/>
|
||||
|
@ -73,7 +73,7 @@
|
|||
</group>
|
||||
<field colspan="4" name="act_email_cc"/>
|
||||
<!-- </group>-->
|
||||
<separator colspan="4" string="Mail Body"/>
|
||||
<separator colspan="4" string="Email Body"/>
|
||||
<field colspan="4" name="act_mail_body" height="250"
|
||||
nolabel="1" attrs="{'required':[('act_remind_user','=',True)]}" />
|
||||
<separator colspan="4" string="Special Keywords to Be Used in The Body"/>
|
||||
|
@ -82,9 +82,9 @@
|
|||
<label align="0.0" string="%%(object_description)s = Object description" colspan="2"/>
|
||||
<label align="0.0" string="%%(object_date)s = Creation date" colspan="2"/>
|
||||
<label align="0.0" string="%%(partner)s = Partner name" colspan="2"/>
|
||||
<label align="0.0" string="%%(partner_email)s = Partner email" colspan="2"/>
|
||||
<label align="0.0" string="%%(partner_email)s = Partner Email" colspan="2"/>
|
||||
<label align="0.0" string="%%(object_user)s = Responsible name" colspan="2"/>
|
||||
<label align="0.0" string="%%(object_user_email)s = Responsible email" colspan="2"/>
|
||||
<label align="0.0" string="%%(object_user_email)s = Responsible Email" colspan="2"/>
|
||||
<label align="0.0" string="%%(object_user_phone)s = Responsible phone" colspan="2"/>
|
||||
</page>
|
||||
</notebook>
|
||||
|
|
|
@ -410,7 +410,10 @@ property or property parameter."),
|
|||
event.add('location').value = event_obj.location
|
||||
if event_obj.rrule:
|
||||
event.add('rrule').value = event_obj.rrule
|
||||
|
||||
if event_obj.user_id:
|
||||
event_org = event.add('organizer')
|
||||
event_org.params['CN'] = [event_obj.user_id.name]
|
||||
event_org.value = 'MAILTO:' + (event_obj.user_id.user_email or event_obj.user_id.name)
|
||||
if event_obj.alarm_id:
|
||||
# computes alarm data
|
||||
valarm = event.add('valarm')
|
||||
|
@ -440,7 +443,7 @@ property or property parameter."),
|
|||
attendee_add.params['CUTYPE'] = [str(attendee.cutype)]
|
||||
attendee_add.params['ROLE'] = [str(attendee.role)]
|
||||
attendee_add.params['RSVP'] = [str(attendee.rsvp)]
|
||||
attendee_add.value = 'MAILTO:' + attendee.email
|
||||
attendee_add.value = 'MAILTO:' + (attendee.email or '')
|
||||
res = cal.serialize()
|
||||
return res
|
||||
|
||||
|
@ -480,8 +483,8 @@ property or property parameter."),
|
|||
'company': company
|
||||
}
|
||||
body = html_invitation % body_vals
|
||||
attach = self.get_ics_file(cr, uid, res_obj, context=context)
|
||||
if mail_to and email_from:
|
||||
attach = self.get_ics_file(cr, uid, res_obj, context=context)
|
||||
tools.email_send(
|
||||
email_from,
|
||||
mail_to,
|
||||
|
|
|
@ -10,3 +10,4 @@
|
|||
"access_calendar_event_export","calendar.event.export","model_calendar_event_export","base.group_user",1,1,1,1
|
||||
"access_calendar_event_import","calendar.event.import","model_calendar_event_import","base.group_user",1,1,1,1
|
||||
"access_calendar_event_subscribe","calendar.event.subscribe","model_calendar_event_subscribe","base.group_user",1,1,1,1
|
||||
"access_basic_calendar","basic.calendar","model_basic_calendar","base.group_user",1,1,1,1
|
||||
|
|
|
|
@ -108,13 +108,13 @@ between mails and Open ERP.""",
|
|||
'crm_phonecall_demo.xml'
|
||||
],
|
||||
'test': [
|
||||
# 'test/test_crm_lead.yml',
|
||||
# 'test/test_crm_meeting.yml',
|
||||
# 'test/test_crm_opportunity.yml',
|
||||
# 'test/test_crm_phonecall.yml',
|
||||
],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'test/test_crm_lead.yml',
|
||||
'test/test_crm_meeting.yml',
|
||||
'test/test_crm_opportunity.yml',
|
||||
'test/test_crm_phonecall.yml',
|
||||
],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '0079056041421',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -203,9 +203,13 @@ class crm_case(object):
|
|||
address = self.pool.get('res.partner.address').browse(cr, uid, add)
|
||||
return {'value': {'email_from': address.email}}
|
||||
|
||||
def _history(self, cr, uid, cases, keyword, history=False, email=False, details=None, email_from=False, message_id=False, context={}):
|
||||
def _history(self, cr, uid, cases, keyword, history=False, subject=None, email=False, details=None, email_from=False, message_id=False, attach=[], context={}):
|
||||
mailgate_pool = self.pool.get('mailgate.thread')
|
||||
return mailgate_pool._history(cr, uid, cases, keyword, history=history, email=email, details=details, email_from=email_from, message_id=message_id, context=context)
|
||||
return mailgate_pool._history(cr, uid, cases, keyword, history=history,\
|
||||
subject=subject, email=email, \
|
||||
details=details, email_from=email_from,\
|
||||
message_id=message_id, attach=attach, \
|
||||
context=context)
|
||||
|
||||
def case_open(self, cr, uid, ids, *args):
|
||||
"""Opens Case
|
||||
|
@ -438,6 +442,7 @@ class crm_case_section(osv.osv):
|
|||
'child_ids': fields.one2many('crm.case.section', 'parent_id', 'Child Teams'),
|
||||
'resource_calendar_id': fields.many2one('resource.calendar', "Resource's Calendar"),
|
||||
'note': fields.text('Description'),
|
||||
'working_hours': fields.float('Working Hours', digits=(16,2 )),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
|
|
|
@ -82,23 +82,9 @@ this if you want the rule to send an email to the partner."),
|
|||
if hasattr(obj, 'categ_id'):
|
||||
ok = ok and (not action.trg_categ_id or action.trg_categ_id.id==obj.categ_id.id)
|
||||
|
||||
# TODO: history_line is removed
|
||||
# if hasattr(obj, 'history_line'):
|
||||
# ok = ok and (not action.trg_max_history or action.trg_max_history<=(len(obj.history_line)+1))
|
||||
# reg_history = action.regex_history
|
||||
# result_history = True
|
||||
# if reg_history:
|
||||
# ptrn = re.compile(str(reg_history))
|
||||
# if obj.history_line:
|
||||
# _result = ptrn.search(str(obj.history_line[0].description))
|
||||
# if not _result:
|
||||
# result_history = False
|
||||
regex_h = not reg_history or result_history
|
||||
ok = ok and regex_h
|
||||
return ok
|
||||
|
||||
def do_action(self, cr, uid, action, model_obj, obj, context={}):
|
||||
|
||||
""" @param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
|
@ -118,7 +104,7 @@ this if you want the rule to send an email to the partner."),
|
|||
write['email_cc'] = obj.email_cc+','+obj.act_email_cc
|
||||
else:
|
||||
write['email_cc'] = obj.act_email_cc
|
||||
|
||||
|
||||
model_obj.write(cr, uid, [obj.id], write, context)
|
||||
emails = []
|
||||
|
||||
|
|
|
@ -1,59 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="event_type_case_create" model="res.partner.event.type">
|
||||
<field name="name">CRM: Create Case</field>
|
||||
<field name="key">crm_case_draft</field>
|
||||
</record>
|
||||
|
||||
<record id="event_type_case_open" model="res.partner.event.type">
|
||||
<field name="name">CRM: Open Case</field>
|
||||
<field name="key">crm_case_open</field>
|
||||
</record>
|
||||
|
||||
<record id="event_type_case_pending" model="res.partner.event.type">
|
||||
<field name="name">CRM: Pending Case</field>
|
||||
<field name="key">crm_case_pending</field>
|
||||
</record>
|
||||
|
||||
<record id="event_type_case_cancel" model="res.partner.event.type">
|
||||
<field name="name">CRM: Cancel Case</field>
|
||||
<field name="key">crm_case_cancel</field>
|
||||
</record>
|
||||
|
||||
<record id="event_type_case_close" model="res.partner.event.type">
|
||||
<field name="name">CRM: Close Case</field>
|
||||
<field name="key">crm_case_done</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
|
||||
<data noupdate="1">
|
||||
<record model="crm.case.section" id="section_sales_department">
|
||||
<field name="name">Sales Department</field>
|
||||
<field name="code">Sales</field>
|
||||
</record>
|
||||
|
||||
<record id="event_type_case_create" model="res.partner.event.type">
|
||||
<field eval="False" name="active"/>
|
||||
</record>
|
||||
|
||||
<record id="event_type_case_open" model="res.partner.event.type">
|
||||
<field eval="True" name="active"/>
|
||||
</record>
|
||||
|
||||
<record id="event_type_case_pending" model="res.partner.event.type">
|
||||
<field eval="False" name="active"/>
|
||||
</record>
|
||||
|
||||
<record id="event_type_case_close" model="res.partner.event.type">
|
||||
<field eval="True" name="active"/>
|
||||
</record>
|
||||
|
||||
<record id="event_type_case_cancel" model="res.partner.event.type">
|
||||
<field eval="False" name="active"/>
|
||||
</record>
|
||||
|
||||
<record id="ir_cron_crm_action" model="ir.cron">
|
||||
<field name="name">Check cases rules</field>
|
||||
|
|
|
@ -39,7 +39,8 @@ class crm_installer(osv.osv_memory):
|
|||
'crm_caldav': fields.boolean('Calendar Synchronizing', help="Help you to synchronize the meetings with other calender clients(e.g.: Sunbird)."),
|
||||
'sale_crm': fields.boolean('Create Quotation from Opportunity', help="This module relates sale to opportunity cases in the CRM."),
|
||||
'fetchmail': fields.boolean('Fetch Emails', help="Fetchmail Server."),
|
||||
'thunderbird': fields.boolean('Thunderbird', help="Thunderbird Interface."),
|
||||
'thunderbird': fields.boolean('Thunderbird', help="Thunderbird Interface."),
|
||||
'wiki_sale_faq': fields.boolean('Sale FAQ', help="Sale FAQ."),
|
||||
}
|
||||
|
||||
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
|
||||
|
|
|
@ -35,7 +35,8 @@
|
|||
<field name="crm_claim" />
|
||||
<field name="crm_helpdesk" />
|
||||
<field name="crm_fundraising" />
|
||||
<field name="sale_crm" invisible="1"/>
|
||||
<field name="wiki_sale_faq"/>
|
||||
<field name="sale_crm" invisible="1"/>
|
||||
</group>
|
||||
</group>
|
||||
</data>
|
||||
|
|
|
@ -108,8 +108,8 @@ class crm_lead(osv.osv, crm_case):
|
|||
'email_cc': fields.text('Watchers Emails', size=252 , help="These \
|
||||
people will receive a copy of the future communication between partner \
|
||||
and users by email"),
|
||||
'description': fields.text('Description'),
|
||||
'write_date': fields.datetime('Update Date' , readonly=True),
|
||||
'description': fields.text('Notes'),
|
||||
'write_date': fields.datetime('Update Date' , readonly=True),
|
||||
|
||||
# Lead fields
|
||||
'thread_id': fields.many2one('mailgate.thread', 'Thread', required=False),
|
||||
|
@ -137,7 +137,6 @@ and users by email"),
|
|||
method=True, multi='day_open', type="float", store=True),
|
||||
'day_close': fields.function(_compute_day, string='Days to Close', \
|
||||
method=True, multi='day_close', type="float", store=True),
|
||||
'function_name': fields.char('Function', size=64),
|
||||
'state': fields.selection(crm.AVAILABLE_STATES, 'State', size=16, readonly=True,
|
||||
help='The state is set to \'Draft\', when a case is created.\
|
||||
\nIf the case is in progress the state is set to \'Open\'.\
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
name="convert_opportunity"
|
||||
string="Convert"
|
||||
help="Convert to Opportunity"
|
||||
icon="gtk-index"
|
||||
icon="gtk-index"
|
||||
type="object"/>
|
||||
<newline />
|
||||
<field name="section_id" colspan="1"
|
||||
|
@ -71,7 +71,7 @@
|
|||
<field name="partner_name" string="Partner Name" colspan="4"/>
|
||||
<newline/>
|
||||
<field domain="[('domain', '=', 'contact')]" name="title"/>
|
||||
<field name="function_name" />
|
||||
<field name="function" />
|
||||
<field name="street" colspan="4"/>
|
||||
<field name="street2" colspan="4"/>
|
||||
<field name="zip"/>
|
||||
|
@ -160,16 +160,21 @@
|
|||
<field name="email_to"/>
|
||||
<field name="email_from"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<field name="description" colspan="4" nolabel="1"/>
|
||||
<notebook colspan="4">
|
||||
<page string="Details">
|
||||
<field name="description" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Attachments">
|
||||
<field name="attachment_ids" colspan="4" readonly="1" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
<button colspan="4"
|
||||
string="Reply to Last Email"
|
||||
name="%(action_crm_send_mail)d"
|
||||
context="{'mail':'reply', 'model': 'crm.lead', 'include_original' : True}"
|
||||
icon="gtk-undo" type="action" />
|
||||
string="Reply to Last Email"
|
||||
name="%(crm.action_crm_send_mail)d"
|
||||
context="{'mail':'reply', 'model': 'crm.lead', 'include_original' : True}"
|
||||
icon="gtk-undo" type="action" />
|
||||
</form>
|
||||
<tree string="Communication history">
|
||||
<field name="name" />
|
||||
<field name="date"/>
|
||||
<field name="email_from" />
|
||||
<field name="email_to"/>
|
||||
|
@ -177,7 +182,7 @@
|
|||
</tree>
|
||||
</field>
|
||||
<button colspan="2" string="Send New Email"
|
||||
name="%(action_crm_send_mail)d"
|
||||
name="%(crm.action_crm_send_mail)d"
|
||||
context="{'mail':'new', 'model': 'crm.lead'}"
|
||||
icon="gtk-go-forward" type="action" />
|
||||
<button colspan="2" string="Forward to Partner"
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<data>
|
||||
|
||||
<!-- Opportunity Categories Form View -->
|
||||
<!-- Opportunity Categories Form View -->
|
||||
|
||||
<record id="crm_opportunity_categ_action" model="ir.actions.act_window">
|
||||
<field name="name">Opportunity 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.lead')]</field>
|
||||
<field name="context">{'object_id':'crm.lead'}</field>
|
||||
</record>
|
||||
<record id="crm_opportunity_categ_action" model="ir.actions.act_window">
|
||||
<field name="name">Opportunity 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.lead')]</field>
|
||||
<field name="context">{'object_id':'crm.lead'}</field>
|
||||
</record>
|
||||
|
||||
<menuitem action="crm_opportunity_categ_action"
|
||||
id="menu_crm_case_opportunity-act"
|
||||
parent="crm.menu_crm_case_categ" />
|
||||
<menuitem action="crm_opportunity_categ_action"
|
||||
id="menu_crm_case_opportunity-act"
|
||||
parent="crm.menu_crm_case_categ" />
|
||||
|
||||
<!-- Opportunity Stages Form View-->
|
||||
<!-- Opportunity Stages Form View-->
|
||||
|
||||
<record id="crm_opportunity_stage_act" model="ir.actions.act_window">
|
||||
<field name="name">Opportunity Stages</field>
|
||||
|
@ -47,285 +47,304 @@
|
|||
id="menu_crm_opportunity_resource_act"
|
||||
parent="crm.menu_crm_case_resource_type" />
|
||||
|
||||
<!-- Opportunities Form View -->
|
||||
<!-- Opportunities Form View -->
|
||||
|
||||
<record model="ir.ui.view" id="crm_case_form_view_oppor">
|
||||
<field name="name">Opportunities</field>
|
||||
<field name="model">crm.lead</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Opportunities">
|
||||
<group colspan="4" col="7">
|
||||
<field name="name" required="1" string="Opportunity"/>
|
||||
<label string="Stage:" align="1.0"/>
|
||||
<group colspan="1" col="4">
|
||||
<field name="stage_id" nolabel="1"
|
||||
on_change="onchange_stage_id(stage_id)"
|
||||
widget="selection"
|
||||
domain="[('object_id.model', '=', 'crm.lead')]" />
|
||||
<button name="stage_previous"
|
||||
<record model="ir.ui.view" id="crm_case_form_view_oppor">
|
||||
<field name="name">Opportunities</field>
|
||||
<field name="model">crm.lead</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Opportunities">
|
||||
<group colspan="4" col="7">
|
||||
<field name="name" required="1" string="Opportunity"/>
|
||||
<label string="Stage:" align="1.0"/>
|
||||
<group colspan="1" col="4">
|
||||
<field name="stage_id" nolabel="1"
|
||||
on_change="onchange_stage_id(stage_id)"
|
||||
widget="selection"
|
||||
domain="[('object_id.model', '=', 'crm.lead')]" />
|
||||
<button name="stage_previous"
|
||||
states="open,pending" type="object"
|
||||
icon="gtk-go-back" string="" />
|
||||
<button name="stage_next" states="open,pending"
|
||||
type="object" icon="gtk-go-forward" string="" />
|
||||
</group>
|
||||
<field name="user_id"/>
|
||||
|
||||
<button name="action_makeMeeting" type="object"
|
||||
string="Schedule Meeting" icon="gtk-redo" />
|
||||
|
||||
<field name="planned_revenue"/>
|
||||
<field name="probability"/>
|
||||
<field name="date_deadline" string="Expected Closing"/>
|
||||
<button string="Schedule Call"
|
||||
name="%(opportunity2phonecall_act)d" icon="gtk-redo" type="action" />
|
||||
<newline/>
|
||||
<field name="date_action"/>
|
||||
<field name="priority" string="Priority"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Opportunity">
|
||||
<group col="4" colspan="2">
|
||||
<separator colspan="4" string="Contacts"/>
|
||||
<field name="partner_id" select="1"
|
||||
on_change="onchange_partner_id(partner_id, email_from)"
|
||||
colspan="2" />
|
||||
<field name="partner_address_id"
|
||||
string="Contact"
|
||||
on_change="onchange_partner_address_id(partner_address_id, email_from)"
|
||||
colspan="1" />
|
||||
<field name="email_from" string="Email" />
|
||||
<field name="phone"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="2" string="Categorization"/>
|
||||
<field name="section_id" colspan="1" widget="selection"/>
|
||||
<field name="categ_id" select="1" groups="base.group_extended"
|
||||
string="Category" widget="selection"
|
||||
domain="[('object_id.model', '=', 'crm.lead')]" />
|
||||
</group>
|
||||
|
||||
<separator colspan="4" string="Details"/>
|
||||
<field name="description" nolabel="1" colspan="4"/>
|
||||
|
||||
<separator colspan="4"/>
|
||||
<group col="8" colspan="4">
|
||||
<field name="state"/>
|
||||
<button name="case_open" string="Open"
|
||||
states="draft,pending" type="object"
|
||||
icon="gtk-go-forward" />
|
||||
<button name="case_pending" string="Pending"
|
||||
states="draft,open" type="object"
|
||||
icon="gtk-media-pause" />
|
||||
<button name="case_escalate" string="Escalate"
|
||||
states="open,draft,pending" type="object"
|
||||
groups="base.group_extended"
|
||||
icon="gtk-go-up" />
|
||||
<button name="case_cancel" string="Mark Lost"
|
||||
states="draft,open,pending" type="object"
|
||||
icon="gtk-close" />
|
||||
<button name="case_close" string="Mark Won"
|
||||
states="open,draft,pending" type="object"
|
||||
icon="gtk-apply" />
|
||||
<button name="case_reset" string="Reset to New"
|
||||
states="done,cancel" type="object"
|
||||
icon="gtk-convert" />
|
||||
</group>
|
||||
</page>
|
||||
|
||||
<page string="Emails" groups="base.group_extended">
|
||||
<group colspan="4">
|
||||
<field colspan="4" name="email_cc" string="CC"/>
|
||||
</group>
|
||||
<field name="message_ids" colspan="4" nolabel="1" mode="form,tree" height="280">
|
||||
<form string="Communication history">
|
||||
<group col="6" colspan="4">
|
||||
<field name="date"/>
|
||||
<field name="email_to"/>
|
||||
<field name="email_from"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Details">
|
||||
<field name="description" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Attachments">
|
||||
<field name="attachment_ids" colspan="4" readonly="1" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
<button colspan="4"
|
||||
string="Reply to Last Email"
|
||||
name="%(crm.action_crm_send_mail)d"
|
||||
context="{'mail':'reply', 'model': 'crm.lead', 'include_original' : True}"
|
||||
icon="gtk-undo" type="action" />
|
||||
</form>
|
||||
<tree string="Communication history">
|
||||
<field name="date"/>
|
||||
<field name="email_from" />
|
||||
<field name="email_to"/>
|
||||
<field name="description"/>
|
||||
</tree>
|
||||
</field>
|
||||
<button colspan="2" string="Send New Email"
|
||||
name="%(crm.action_crm_send_mail)d"
|
||||
context="{'mail':'new', 'model': 'crm.lead'}"
|
||||
icon="gtk-go-forward" type="action" />
|
||||
<button colspan="2" string="Forward to Partner"
|
||||
name="%(crm_lead_forward_to_partner_act)d"
|
||||
icon="gtk-go-forward" type="action" />
|
||||
</page>
|
||||
<page string="History" groups="base.group_extended">
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Dates" colspan="2"/>
|
||||
<field name="create_date"/>
|
||||
<field name="write_date"/>
|
||||
<field name="date_closed"/>
|
||||
<field name="date_open"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Misc" colspan="2"/>
|
||||
<field name="active"/>
|
||||
<field name="day_open"/>
|
||||
<field name="day_close"/>
|
||||
<field name="referred"/>
|
||||
</group>
|
||||
<separator colspan="4" string="References"/>
|
||||
<field name="ref"/>
|
||||
<field name="ref2"/>
|
||||
<field name="log_ids" nolabel="1" colspan="4">
|
||||
<tree string="Logs">
|
||||
<field name="name" colspan="4"/>
|
||||
<field name="date"/>
|
||||
<field name="user_id"/>
|
||||
</tree>
|
||||
<form string="Logs">
|
||||
<separator string="Action Information" colspan="4"/>
|
||||
<field name="name" colspan="4"/>
|
||||
<field name="date"/>
|
||||
<field name="user_id"/>
|
||||
</form>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Opportunities Tree View -->
|
||||
|
||||
<record model="ir.ui.view" id="crm_case_tree_view_oppor">
|
||||
<field name="name">Opportunities Tree</field>
|
||||
<field name="model">crm.lead</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Opportunities" colors="blue:state=='pending';grey:state in ('cancel', 'done');red:date_deadline < current_date">
|
||||
<field name="date_deadline" invisible="1"/>
|
||||
<field name="create_date"/>
|
||||
<field name="name" string="Opportunity"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="stage_id"/>
|
||||
<field name="categ_id" invisible="1" groups="base.group_extended"/>
|
||||
<button name="stage_previous" string="Previous"
|
||||
states="open,pending" type="object" icon="gtk-go-back" />
|
||||
<button name="stage_next" string="Next"
|
||||
states="open,pending" type="object"
|
||||
icon="gtk-go-back" string="" />
|
||||
<button name="stage_next" states="open,pending"
|
||||
type="object" icon="gtk-go-forward" string="" />
|
||||
</group>
|
||||
<field name="user_id"/>
|
||||
|
||||
<button name="action_makeMeeting" type="object"
|
||||
string="Schedule Meeting" icon="gtk-redo" />
|
||||
|
||||
<field name="planned_revenue"/>
|
||||
<field name="probability"/>
|
||||
<field name="date_deadline" string="Expected Closing"/>
|
||||
<button string="Schedule Call"
|
||||
name="%(opportunity2phonecall_act)d" icon="gtk-redo" type="action" />
|
||||
|
||||
<newline/>
|
||||
<field name="date_action"/>
|
||||
<field name="priority" string="Priority"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Opportunity">
|
||||
<group col="4" colspan="2">
|
||||
<separator colspan="4" string="Contacts"/>
|
||||
<field name="partner_id" select="1"
|
||||
on_change="onchange_partner_id(partner_id, email_from)"
|
||||
colspan="2" />
|
||||
<field name="partner_address_id"
|
||||
string="Contact"
|
||||
on_change="onchange_partner_address_id(partner_address_id, email_from)"
|
||||
colspan="1" />
|
||||
<field name="email_from" string="Email" />
|
||||
<field name="phone"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="2" string="Categorization"/>
|
||||
<field name="section_id" colspan="1" widget="selection"/>
|
||||
<field name="categ_id" select="1" groups="base.group_extended"
|
||||
string="Category" widget="selection"
|
||||
domain="[('object_id.model', '=', 'crm.lead')]" />
|
||||
</group>
|
||||
|
||||
<separator colspan="4" string="Details"/>
|
||||
<field name="description" nolabel="1" colspan="4"/>
|
||||
|
||||
<separator colspan="4"/>
|
||||
<group col="8" colspan="4">
|
||||
icon="gtk-go-forward" />
|
||||
<field name="planned_revenue" sum="Total of Planned Revenue"/>
|
||||
<field name="probability" widget="progressbar" avg="Avg. of Probability"/>
|
||||
<field name="date_action"/>
|
||||
<field name="section_id" groups="base.group_extended"/>
|
||||
<field name="user_id"/>
|
||||
<field name="priority"/>
|
||||
<field name="state"/>
|
||||
<button name="case_open" string="Open"
|
||||
states="draft,pending" type="object"
|
||||
icon="gtk-go-forward" />
|
||||
<button name="case_pending" string="Pending"
|
||||
states="draft,open" type="object"
|
||||
icon="gtk-media-pause" />
|
||||
<button name="case_escalate" string="Escalate"
|
||||
states="open,draft,pending" type="object"
|
||||
groups="base.group_extended"
|
||||
icon="gtk-go-up" />
|
||||
<button name="case_cancel" string="Mark Lost"
|
||||
states="draft,open,pending" type="object"
|
||||
icon="gtk-close" />
|
||||
<button name="case_close" string="Mark Won"
|
||||
<button name="case_close" string="Won"
|
||||
states="open,draft,pending" type="object"
|
||||
icon="gtk-apply" />
|
||||
<button name="case_reset" string="Reset to New"
|
||||
states="done,cancel" type="object"
|
||||
icon="gtk-convert" />
|
||||
</group>
|
||||
</page>
|
||||
|
||||
<page string="Emails" groups="base.group_extended">
|
||||
<group colspan="4">
|
||||
<field colspan="4" name="email_cc" string="CC"/>
|
||||
</group>
|
||||
<field name="message_ids" colspan="4" nolabel="1" mode="form,tree">
|
||||
<form string="Communication history">
|
||||
<group col="6" colspan="4">
|
||||
<field name="date"/>
|
||||
<field name="email_to"/>
|
||||
<field name="email_from"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<field name="description" colspan="4" nolabel="1"/>
|
||||
<button colspan="4"
|
||||
string="Reply to Last Email"
|
||||
name="%(action_crm_send_mail)d"
|
||||
context="{'mail':'reply', 'model': 'crm.lead'}"
|
||||
icon="gtk-undo" type="action" />
|
||||
</form>
|
||||
<tree string="Communication history">
|
||||
<field name="description"/>
|
||||
<field name="email_to"/>
|
||||
<field name="date"/>
|
||||
</tree>
|
||||
</field>
|
||||
<button colspan="2" string="Send New Email"
|
||||
name="%(action_crm_send_mail)d"
|
||||
context="{'mail':'new', 'model': 'crm.lead'}"
|
||||
icon="gtk-go-forward" type="action" />
|
||||
<button colspan="2" string="Forward to Partner"
|
||||
name="%(crm_lead_forward_to_partner_act)d"
|
||||
icon="gtk-go-forward" type="action" />
|
||||
</page>
|
||||
<page string="History" groups="base.group_extended">
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Dates" colspan="2"/>
|
||||
<field name="create_date"/>
|
||||
<field name="write_date"/>
|
||||
<field name="date_closed"/>
|
||||
<field name="date_open"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Misc" colspan="2"/>
|
||||
<field name="active"/>
|
||||
<field name="day_open"/>
|
||||
<field name="day_close"/>
|
||||
<field name="referred"/>
|
||||
</group>
|
||||
<separator colspan="4" string="References"/>
|
||||
<field name="ref"/>
|
||||
<field name="ref2"/>
|
||||
<field name="log_ids" nolabel="1" colspan="4">
|
||||
<tree string="Logs">
|
||||
<field name="name" colspan="4"/>
|
||||
<field name="date"/>
|
||||
<field name="user_id"/>
|
||||
</tree>
|
||||
<form string="Logs">
|
||||
<separator string="Action Information" colspan="4"/>
|
||||
<field name="name" colspan="4"/>
|
||||
<field name="date"/>
|
||||
<field name="user_id"/>
|
||||
</form>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Opportunities Tree View -->
|
||||
|
||||
<record model="ir.ui.view" id="crm_case_tree_view_oppor">
|
||||
<field name="name">Opportunities Tree</field>
|
||||
<field name="model">crm.lead</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Opportunities" colors="blue:state=='pending';grey:state in ('cancel', 'done');red:date_deadline < current_date">
|
||||
<field name="date_deadline" invisible="1"/>
|
||||
<field name="create_date"/>
|
||||
<field name="name" string="Opportunity"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="stage_id"/>
|
||||
<field name="categ_id" invisible="1" groups="base.group_extended"/>
|
||||
<button name="stage_previous" string="Previous"
|
||||
states="open,pending" type="object" icon="gtk-go-back" />
|
||||
<button name="stage_next" string="Next"
|
||||
states="open,pending" type="object"
|
||||
icon="gtk-go-forward" />
|
||||
<field name="planned_revenue" sum="Total of Planned Revenue"/>
|
||||
<field name="probability" widget="progressbar" avg="Avg. of Probability"/>
|
||||
<field name="date_action"/>
|
||||
<field name="section_id" groups="base.group_extended"/>
|
||||
<field name="user_id"/>
|
||||
<field name="priority"/>
|
||||
<field name="state"/>
|
||||
<button name="case_open" string="Open"
|
||||
states="draft,pending" type="object"
|
||||
icon="gtk-go-forward" />
|
||||
<button name="case_close" string="Won"
|
||||
states="open,draft,pending" type="object"
|
||||
icon="gtk-apply" />
|
||||
<button name="case_pending" string="Pending"
|
||||
states="open,draft" type="object"
|
||||
icon="gtk-media-pause" />
|
||||
<button name="case_cancel" string="Lost"
|
||||
states="draft,open,pending" type="object"
|
||||
icon="gtk-cancel" />
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Opportunities Graph View -->
|
||||
|
||||
<record model="ir.ui.view" id="crm_case_graph_view_opportunity">
|
||||
<field name="name">CRM - Opportunity Graph</field>
|
||||
<field name="model">crm.lead</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Opportunity by Categories" type="bar" orientation="horizontal">
|
||||
<field name="categ_id"/>
|
||||
<field name="planned_revenue" operator="+"/>
|
||||
<field name="state" group="True"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Opportunities Search View -->
|
||||
|
||||
<record id="view_crm_case_opportunities_filter" model="ir.ui.view">
|
||||
<field name="name">CRM - Opportunities Search</field>
|
||||
<field name="model">crm.lead</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Opportunities">
|
||||
<filter icon="terp-project"
|
||||
string="Current"
|
||||
name="current"
|
||||
domain="[('state','in',('draft','open'))]"/>
|
||||
<filter icon="terp-project"
|
||||
string="Open"
|
||||
domain="[('state','=','open')]"/>
|
||||
<filter icon="terp-project"
|
||||
string="Pending"
|
||||
domain="[('state','=','pending')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="gtk-home" string="Today"
|
||||
domain="[('create_date','<', time.strftime('%%Y-%%m-%%d 23:59:59')), ('create_date','>=', time.strftime('%%Y-%%m-%%d 23:59:59'))]"
|
||||
help="Todays' Opportunities" />
|
||||
<filter icon="gtk-media-rewind" string="7 Days"
|
||||
help="Opportunities during last 7 days"
|
||||
domain="[('create_date','<', time.strftime('%%Y-%%m-%%d')),\
|
||||
('create_date','>=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
|
||||
/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name" string="Opportunity"/>
|
||||
<field name="user_id" widget="selection">
|
||||
<filter icon="terp-partner"
|
||||
domain="[('user_id','=',uid)]"
|
||||
help="My Opportunities" default="1"/>
|
||||
<filter icon="terp-partner"
|
||||
domain="[('user_id','=', uid)]"
|
||||
help="Unassigned Opportunities"/>
|
||||
<button name="case_pending" string="Pending"
|
||||
states="open,draft" type="object"
|
||||
icon="gtk-media-pause" />
|
||||
<button name="case_cancel" string="Lost"
|
||||
states="draft,open,pending" type="object"
|
||||
icon="gtk-cancel" />
|
||||
</tree>
|
||||
</field>
|
||||
<field name="section_id"
|
||||
default="context.get('section_id', False)" select="1"
|
||||
widget="selection">
|
||||
<filter icon="terp-crm"
|
||||
domain="[('section_id','=',context.get('section_id',False))]"
|
||||
help="My Sale Team" />
|
||||
</field>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By...">
|
||||
<filter string="Stage" icon="terp-crm" domain="[]"
|
||||
context="{'group_by':'stage_id'}"/>
|
||||
<filter string="Priority" icon="terp-crm" domain="[]"
|
||||
context="{'group_by':'priority'}"/>
|
||||
<filter string="Category" icon="terp-crm"
|
||||
domain="[]" context="{'group_by':'categ_id'}"/>
|
||||
</record>
|
||||
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Salesman" icon="terp-crm"
|
||||
domain="[('user_id','=',uid)]" context="{'group_by':'user_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Creation" icon="terp-project"
|
||||
domain="[]" context="{'group_by':'create_date'}"/>
|
||||
<filter string="Exp.Closing" icon="terp-project"
|
||||
domain="[]" context="{'group_by':'date_deadline'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<!-- Opportunities Graph View -->
|
||||
|
||||
<record model="ir.ui.view" id="crm_case_graph_view_opportunity">
|
||||
<field name="name">CRM - Opportunity Graph</field>
|
||||
<field name="model">crm.lead</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Opportunity by Categories" type="bar" orientation="horizontal">
|
||||
<field name="categ_id"/>
|
||||
<field name="planned_revenue" operator="+"/>
|
||||
<field name="state" group="True"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Opportunities Search View -->
|
||||
|
||||
<record id="view_crm_case_opportunities_filter" model="ir.ui.view">
|
||||
<field name="name">CRM - Opportunities Search</field>
|
||||
<field name="model">crm.lead</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Opportunities">
|
||||
<filter icon="terp-project"
|
||||
string="Current"
|
||||
name="current"
|
||||
domain="[('state','in',('draft','open'))]"/>
|
||||
<filter icon="terp-project"
|
||||
string="Open"
|
||||
domain="[('state','=','open')]"/>
|
||||
<filter icon="terp-project"
|
||||
string="Pending"
|
||||
domain="[('state','=','pending')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="gtk-home" string="Today"
|
||||
domain="[('create_date','<', time.strftime('%%Y-%%m-%%d 23:59:59')), ('create_date','>=', time.strftime('%%Y-%%m-%%d 23:59:59'))]"
|
||||
help="Todays' Opportunities" />
|
||||
<filter icon="gtk-media-rewind" string="7 Days"
|
||||
help="Opportunities during last 7 days"
|
||||
domain="[('create_date','<', time.strftime('%%Y-%%m-%%d')),\
|
||||
('create_date','>=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
|
||||
/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name" string="Opportunity"/>
|
||||
<field name="user_id" widget="selection">
|
||||
<filter icon="terp-partner"
|
||||
domain="[('user_id','=', False)]"
|
||||
help="Unassigned Opportunities" />
|
||||
</field>
|
||||
<field name="section_id"
|
||||
default="context.get('section_id', False)" select="1"
|
||||
widget="selection">
|
||||
<filter icon="terp-crm"
|
||||
domain="[('section_id','=',context.get('section_id',False))]"
|
||||
help="My Sale Team" />
|
||||
</field>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="16">
|
||||
<filter string="Stage" icon="terp-crm" domain="[]"
|
||||
context="{'group_by':'stage_id'}" />
|
||||
<filter string="Priority" icon="terp-crm" domain="[]"
|
||||
context="{'group_by':'priority'}" />
|
||||
<filter string="Category" icon="terp-crm"
|
||||
domain="[]" context="{'group_by':'categ_id'}" />
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter string="Salesman" icon="terp-crm"
|
||||
domain="[('user_id','=',uid)]" context="{'group_by':'user_id'}" />
|
||||
<separator orientation="vertical" />
|
||||
<filter string="Creation" icon="terp-project"
|
||||
domain="[]" context="{'group_by':'create_date'}" />
|
||||
<filter string="Exp.Closing" icon="terp-project"
|
||||
domain="[]" context="{'group_by':'date_deadline'}" />
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Opportunities Graph View -->
|
||||
|
||||
<record model="ir.ui.view" id="crm_case_graph_view_opportunity">
|
||||
<field name="name">CRM - Opportunity Graph</field>
|
||||
<field name="model">crm.lead</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Opportunity by Categories" type="bar" orientation="horizontal">
|
||||
<field name="categ_id"/>
|
||||
<field name="planned_revenue" operator="+"/>
|
||||
<field name="state" group="True"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -38,6 +38,9 @@ class crm_phonecall(osv.osv, crm_case):
|
|||
'name': fields.char('Name', size=64),
|
||||
'active': fields.boolean('Active', required=False),
|
||||
'thread_id': fields.many2one('mailgate.thread', 'Thread', required=False),
|
||||
'date_action_last': fields.datetime('Last Action', readonly=1),
|
||||
'date_action_next': fields.datetime('Next Action', readonly=1),
|
||||
'create_date': fields.datetime('Creation Date' , readonly=True),
|
||||
'section_id': fields.many2one('crm.case.section', 'Sales Team', \
|
||||
select=True, help='Sales team to which Case belongs to.\
|
||||
Define Responsible user and Email account for mail gateway.'),
|
||||
|
|
|
@ -27,10 +27,12 @@ class res_partner(osv.osv):
|
|||
|
||||
_columns = {
|
||||
'opportunity_ids': fields.one2many('crm.lead', 'partner_id',\
|
||||
'Opportunities', domain=[('type', '=', 'opportunity')]),
|
||||
'Opportunities', readonly=True, \
|
||||
domain=[('type', '=', 'opportunity')]),
|
||||
'meeting_ids': fields.one2many('crm.meeting', 'partner_id',\
|
||||
'Meetings'),
|
||||
'phonecall_ids': fields.one2many('crm.phonecall', 'partner_id', 'Phonecalls'),
|
||||
'Meetings', readonly=True),
|
||||
'phonecall_ids': fields.one2many('crm.phonecall', 'partner_id',\
|
||||
'Phonecalls', readonly=True),
|
||||
}
|
||||
|
||||
res_partner()
|
||||
|
|
|
@ -10,52 +10,54 @@
|
|||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="base.view_partner_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<notebook position="inside">
|
||||
<page string="CRM">
|
||||
<field name="meeting_ids" colspan="4" nolabel="1" />
|
||||
<field name="phonecall_ids" colspan="4" nolabel="1" />
|
||||
<field name="opportunity_ids" colspan="4" nolabel="1" domain="[('type', '=', 'opportunity')]">
|
||||
<tree string="Opportunities" colors="blue:state=='pending';grey:state in ('cancel', 'done')">
|
||||
<field name="create_date"/>
|
||||
<field name="partner_name"/>
|
||||
<field name="name"/>
|
||||
<field name="email_from"/>
|
||||
<field name="phone"/>
|
||||
|
||||
<field name="categ_id" invisible="1"/>
|
||||
<field name="type_id" invisible="1"/>
|
||||
<field name="referred" invisible="1"/>
|
||||
|
||||
<field name="stage_id"/>
|
||||
<button name="stage_previous" string="Previous"
|
||||
states="open,pending" type="object" icon="gtk-go-back" />
|
||||
<button name="stage_next" string="Next"
|
||||
states="open,pending" type="object"
|
||||
icon="gtk-go-forward" />
|
||||
<field name="section_id"
|
||||
invisible="context.get('invisible_section', True)" />
|
||||
<field name="user_id" />
|
||||
<field name="state" />
|
||||
<button name="case_open" string="Open"
|
||||
states="draft,pending" type="object"
|
||||
icon="gtk-go-forward" />
|
||||
<button name="case_close" string="Close"
|
||||
states="open,draft,pending" type="object"
|
||||
icon="gtk-close" />
|
||||
<button string="Convert to Opportunity"
|
||||
name="convert_opportunity"
|
||||
states="draft,open,pending" icon="gtk-index"
|
||||
type="object" />
|
||||
<button name="case_escalate" string="Escalate"
|
||||
states="open,draft,pending" type="object"
|
||||
icon="gtk-go-up" />
|
||||
<button name="case_cancel" string="Cancel"
|
||||
states="draft,open,pending" type="object"
|
||||
icon="gtk-cancel" />
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
<xpath expr="//notebook[last()]" position="after">
|
||||
<notebook colspan="4">
|
||||
<page string="CRM">
|
||||
<field name="meeting_ids" colspan="4" nolabel="1" />
|
||||
<field name="phonecall_ids" colspan="4" nolabel="1" />
|
||||
<field name="opportunity_ids" colspan="4" nolabel="1" domain="[('type', '=', 'opportunity')]">
|
||||
<tree string="Opportunities" colors="blue:state=='pending';grey:state in ('cancel', 'done')">
|
||||
<field name="create_date"/>
|
||||
<field name="partner_name"/>
|
||||
<field name="name"/>
|
||||
<field name="email_from"/>
|
||||
<field name="phone"/>
|
||||
|
||||
<field name="categ_id" invisible="1"/>
|
||||
<field name="type_id" invisible="1"/>
|
||||
<field name="referred" invisible="1"/>
|
||||
|
||||
<field name="stage_id"/>
|
||||
<button name="stage_previous" string="Previous"
|
||||
states="open,pending" type="object" icon="gtk-go-back" />
|
||||
<button name="stage_next" string="Next"
|
||||
states="open,pending" type="object"
|
||||
icon="gtk-go-forward" />
|
||||
<field name="section_id"
|
||||
invisible="context.get('invisible_section', True)" />
|
||||
<field name="user_id" />
|
||||
<field name="state" />
|
||||
<button name="case_open" string="Open"
|
||||
states="draft,pending" type="object"
|
||||
icon="gtk-go-forward" />
|
||||
<button name="case_close" string="Close"
|
||||
states="open,draft,pending" type="object"
|
||||
icon="gtk-close" />
|
||||
<button string="Convert to Opportunity"
|
||||
name="convert_opportunity"
|
||||
states="draft,open,pending" icon="gtk-index"
|
||||
type="object" />
|
||||
<button name="case_escalate" string="Escalate"
|
||||
states="open,draft,pending" type="object"
|
||||
icon="gtk-go-up" />
|
||||
<button name="case_cancel" string="Cancel"
|
||||
states="draft,open,pending" type="object"
|
||||
icon="gtk-cancel" />
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
|
|
@ -117,7 +117,7 @@ class Contact
|
|||
"email_from" => new xmlrpcval($post['email'], "string"),
|
||||
"phone" => new xmlrpcval($post['phone'], "string"),
|
||||
"partner_name" => new xmlrpcval($post['name'], "string"),
|
||||
"function_name" => new xmlrpcval($post["jobtitle"], "string"),
|
||||
"function" => new xmlrpcval($post["jobtitle"], "string"),
|
||||
"zip" => new xmlrpcval($post['zip'], "string"),
|
||||
"stage_id" => new xmlrpcval(6, "int"),
|
||||
"city" => new xmlrpcval($post['city'], "string"),
|
||||
|
|
|
@ -26,3 +26,4 @@
|
|||
"access_crm_lead2opportunity_partner","crm.lead2opportunity.partner","model_crm_lead2opportunity_partner","crm.group_crm_user",1,1,1,1
|
||||
"access_crm_installer","crm.installer.rule","model_crm_installer","crm.group_crm_user",1,1,1,1
|
||||
"access_crm_lead_forward_to_partner","crm.lead.forward.to.partner","model_crm_lead_forward_to_partner","crm.group_crm_user",2,2,2,2
|
||||
"access_mailgate_thread","mailgate.thread","model_mailgate_thread","crm.group_crm_user",1,1,1,1
|
||||
|
|
|
|
@ -212,7 +212,7 @@ class crm_lead_forward_to_partner(osv.osv_memory):
|
|||
lead = lead_proxy.browse(cr, uid, lead_id, context=context)
|
||||
if lead.type == 'lead':
|
||||
field_names = [
|
||||
'partner_name', 'title', 'function_name', 'street', 'street2',
|
||||
'partner_name', 'title', 'function', 'street', 'street2',
|
||||
'zip', 'city', 'country_id', 'state_id', 'email_from',
|
||||
'phone', 'fax', 'mobile'
|
||||
]
|
||||
|
|
|
@ -155,7 +155,7 @@ class crm_lead2partner(osv.osv_memory):
|
|||
'email': lead.email_from,
|
||||
'fax': lead.fax,
|
||||
'title': lead.title,
|
||||
'function': lead.function_name,
|
||||
'function': lead.function,
|
||||
'street': lead.street,
|
||||
'street2': lead.street2,
|
||||
'zip': lead.zip,
|
||||
|
|
|
@ -99,7 +99,7 @@ class crm_send_new_email(osv.osv_memory):
|
|||
model = hist.model_id.model
|
||||
model_pool = self.pool.get(model)
|
||||
res_ids = model_pool.search(cr, uid, [('thread_id','=', hist.thread_id.id)])
|
||||
res_id = res_ids and res_ids[0] or False
|
||||
res_id = res_ids and res_ids[0] or False
|
||||
case = model_pool.browse(cr, uid, res_id)
|
||||
emails = [obj.email_to] + (obj.email_cc or '').split(',')
|
||||
emails = filter(None, emails)
|
||||
|
@ -107,7 +107,11 @@ class crm_send_new_email(osv.osv_memory):
|
|||
|
||||
body = case_pool.format_body(body)
|
||||
email_from = getattr(obj, 'email_from', False)
|
||||
case_pool._history(cr, uid, [case], _('Send'), history=True, email=obj.email_to, details=body, email_from=email_from, message_id=message_id)
|
||||
|
||||
case_pool._history(cr, uid, [case], _('Send'), history=True, \
|
||||
email=obj.email_to, details=body, \
|
||||
subject=obj.subject, email_from=email_from, \
|
||||
message_id=message_id, attach=attach)
|
||||
|
||||
x_headers = dict()
|
||||
#x_headers = {
|
||||
|
|
|
@ -174,31 +174,38 @@
|
|||
<group colspan="4">
|
||||
<field colspan="4" name="email_cc" string="CC"/>
|
||||
</group>
|
||||
<field name="message_ids" colspan="4" nolabel="1" mode="form,tree">
|
||||
<form string="Communication history">
|
||||
<group col="6" colspan="4">
|
||||
<field name="date"/>
|
||||
<field name="email_to"/>
|
||||
<field name="email_from"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<field name="description" colspan="4" nolabel="1"/>
|
||||
<button colspan="4"
|
||||
string="Reply to Last Email"
|
||||
name="%(crm.action_crm_send_mail)d"
|
||||
context="{'mail':'reply', 'model': 'crm.claim'}"
|
||||
icon="gtk-undo" type="action" />
|
||||
</form>
|
||||
<tree string="Communication history">
|
||||
<field name="description"/>
|
||||
<field name="email_to"/>
|
||||
<field name="date"/>
|
||||
</tree>
|
||||
</field>
|
||||
<button colspan="4" string="Send New Email"
|
||||
name="%(crm.action_crm_send_mail)d"
|
||||
context="{'mail':'new', 'model': 'crm.claim'}"
|
||||
icon="gtk-go-forward" type="action" />
|
||||
<field name="message_ids" colspan="4" nolabel="1" mode="form,tree" height="280">
|
||||
<form string="Communication history">
|
||||
<group col="6" colspan="4">
|
||||
<field name="date"/>
|
||||
<field name="email_to"/>
|
||||
<field name="email_from"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Details">
|
||||
<field name="description" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Attachments">
|
||||
<field name="attachment_ids" colspan="4" readonly="1" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
<button colspan="4"
|
||||
string="Reply to Last Email"
|
||||
name="%(crm.action_crm_send_mail)d"
|
||||
context="{'mail':'reply', 'model': 'crm.lead'}"
|
||||
icon="gtk-undo" type="action" />
|
||||
</form>
|
||||
<tree string="Communication history">
|
||||
<field name="date"/>
|
||||
<field name="email_from" />
|
||||
<field name="email_to"/>
|
||||
<field name="description"/>
|
||||
</tree>
|
||||
</field>
|
||||
<button colspan="4" string="Send New Email"
|
||||
name="%(crm.action_crm_send_mail)d"
|
||||
context="{'mail':'new', 'model': 'crm.claim'}"
|
||||
icon="gtk-go-forward" type="action" />
|
||||
</page>
|
||||
</notebook>
|
||||
|
||||
|
|
|
@ -195,18 +195,25 @@
|
|||
<field name="email_to"/>
|
||||
<field name="email_from"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<field name="description" colspan="4" nolabel="1"/>
|
||||
<notebook colspan="4">
|
||||
<page string="Details">
|
||||
<field name="description" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Attachments">
|
||||
<field name="attachment_ids" colspan="4" readonly="1" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
<button colspan="4"
|
||||
string="Reply to Last Email"
|
||||
name="%(crm.action_crm_send_mail)d"
|
||||
context="{'mail':'reply', 'model': 'crm.fundraising'}"
|
||||
icon="gtk-undo" type="action" />
|
||||
string="Reply to Last Email"
|
||||
name="%(crm.action_crm_send_mail)d"
|
||||
context="{'mail':'reply', 'model': 'crm.fundraising'}"
|
||||
icon="gtk-undo" type="action" />
|
||||
</form>
|
||||
<tree string="Communication history">
|
||||
<field name="description"/>
|
||||
<field name="email_to"/>
|
||||
<field name="date"/>
|
||||
<field name="email_from" />
|
||||
<field name="email_to"/>
|
||||
<field name="description"/>
|
||||
</tree>
|
||||
</field>
|
||||
<button colspan="4" string="Send New Email"
|
||||
|
|
|
@ -135,18 +135,25 @@
|
|||
<field name="email_to"/>
|
||||
<field name="email_from"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<field name="description" colspan="4" nolabel="1"/>
|
||||
<notebook colspan="4">
|
||||
<page string="Details">
|
||||
<field name="description" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Attachments">
|
||||
<field name="attachment_ids" colspan="4" readonly="1" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
<button colspan="4"
|
||||
string="Reply to Last Email"
|
||||
name="%(crm.action_crm_send_mail)d"
|
||||
context="{'mail':'reply', 'model': 'crm.helpdesk'}"
|
||||
icon="gtk-undo" type="action" />
|
||||
string="Reply to Last Email"
|
||||
name="%(crm.action_crm_send_mail)d"
|
||||
context="{'mail':'reply', 'model': 'crm.helpdesk'}"
|
||||
icon="gtk-undo" type="action" />
|
||||
</form>
|
||||
<tree string="Communication history">
|
||||
<field name="description"/>
|
||||
<field name="email_to"/>
|
||||
<field name="date"/>
|
||||
<field name="email_from" />
|
||||
<field name="email_to"/>
|
||||
<field name="description"/>
|
||||
</tree>
|
||||
</field>
|
||||
<button colspan="4" string="Send New Email"
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
'category': 'Generic Modules/Others',
|
||||
'description': """This is a complete document management system:
|
||||
* User Authentication
|
||||
* Document Indexation
|
||||
* Document Indexation :- .pptx and .docx files are not support in windows platform.
|
||||
|
||||
ATTENTION:
|
||||
- When you install this module in a running company that have already PDF files stored into the database,
|
||||
|
|
|
@ -75,7 +75,7 @@ class document_file(osv.osv):
|
|||
'user_id': fields.many2one('res.users', 'Owner', select=1),
|
||||
'group_ids': fields.many2many('res.groups', 'document_group_rel', 'item_id', 'group_id', 'Groups'),
|
||||
# the directory id now is mandatory. It can still be computed automatically.
|
||||
'parent_id': fields.many2one('document.directory', 'Directory', select=1, required=True),
|
||||
'parent_id': fields.many2one('document.directory', 'Directory', select=1),
|
||||
'file_size': fields.integer('File Size', required=True),
|
||||
'file_type': fields.char('Content Type', size=128),
|
||||
# If ir.attachment contained any data before document is installed, preserve
|
||||
|
@ -88,11 +88,16 @@ class document_file(osv.osv):
|
|||
'create_uid': fields.many2one('res.users', 'Creator', readonly=True),
|
||||
'store_method': fields.selection([('db', 'Database'), ('fs', 'Filesystem'), ('link', 'Link')], "Storing Method"),
|
||||
'datas': fields.function(_data_get, method=True, fnct_inv=_data_set, string='File Content', type="binary", nodrop=True),
|
||||
'url': fields.char('File URL',size=64),
|
||||
'store_fname': fields.char('Stored Filename', size=200),
|
||||
'res_model': fields.char('Attached Model', size=64), #res_model
|
||||
'res_id': fields.integer('Attached ID'), #res_id
|
||||
'partner_id':fields.many2one('res.partner', 'Partner', select=1),
|
||||
'title': fields.char('Resource Title', size=64),
|
||||
'type':fields.selection([
|
||||
('url','URL'),
|
||||
('binary','Binary'),
|
||||
|
||||
],'Type', help="Type is used to separate URL and binary File"),
|
||||
}
|
||||
|
||||
def __get_def_directory(self, cr, uid, context=None):
|
||||
|
@ -103,6 +108,7 @@ class document_file(osv.osv):
|
|||
'user_id': lambda self, cr, uid, ctx:uid,
|
||||
'file_size': lambda self, cr, uid, ctx:0,
|
||||
'store_method': lambda *args: 'db',
|
||||
'type': 'binary',
|
||||
'parent_id': __get_def_directory
|
||||
}
|
||||
_sql_constraints = [
|
||||
|
@ -155,7 +161,6 @@ class document_file(osv.osv):
|
|||
def create(self, cr, uid, vals, context=None):
|
||||
if not context:
|
||||
context = {}
|
||||
vals['title'] = vals['name']
|
||||
vals['parent_id'] = context.get('parent_id', False) or vals.get('parent_id', False)
|
||||
if not vals['parent_id']:
|
||||
vals['parent_id'] = self.pool.get('document.directory')._get_root_directory(cr,uid, context)
|
||||
|
@ -168,8 +173,6 @@ class document_file(osv.osv):
|
|||
result = obj_model.read(cr, uid, [vals['res_id']], ['name', 'partner_id', 'address_id'], context=context)
|
||||
if len(result):
|
||||
obj = result[0]
|
||||
if obj.get('name', False):
|
||||
vals['title'] = (obj.get('name', ''))[:60]
|
||||
if obj_model._name == 'res.partner':
|
||||
vals['partner_id'] = obj['id']
|
||||
elif obj.get('address_id', False):
|
||||
|
|
|
@ -104,11 +104,9 @@ class document_directory(osv.osv):
|
|||
]
|
||||
def name_get(self, cr, uid, ids, context={}):
|
||||
res = []
|
||||
all_ids = self.search(cr,uid,[])
|
||||
if not self.search(cr,uid,[('id','in',ids)]):
|
||||
ids = []
|
||||
for d in self.browse(cr, uid, ids, context=context):
|
||||
if d.id not in all_ids:
|
||||
continue
|
||||
|
||||
s = ''
|
||||
d2 = d
|
||||
while d2 and d2.parent_id:
|
||||
|
|
|
@ -118,7 +118,7 @@
|
|||
<record model="ir.ui.view" id="view_document_directory_tree">
|
||||
<field name="name">document.directory</field>
|
||||
<field name="model">document.directory</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Directories" toolbar="1">
|
||||
<field name="name"/>
|
||||
|
@ -179,71 +179,96 @@
|
|||
<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="parent_id"/>
|
||||
<field name="type"/>
|
||||
<field name="parent_id"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Attachment">
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Data" colspan="2"/>
|
||||
<group col="2" colspan="2" attrs="{'invisible':[('type','=','url')]}">
|
||||
<field name="datas" filename="datas_fname"/>
|
||||
<field name="datas_fname" select="1"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Attached To" colspan="2"/>
|
||||
<field name="res_model" readonly="1"/>
|
||||
<field name="res_id" readonly="1"/>
|
||||
</group>
|
||||
<separator string="Preview" colspan="4"/>
|
||||
<field
|
||||
name="preview"
|
||||
widget="image"
|
||||
readonly="1"
|
||||
nolabel="1"
|
||||
colspan="4"
|
||||
img_height="400"
|
||||
img_width="800"/>
|
||||
</group>
|
||||
<group col="2" colspan="2" attrs="{'invisible':[('type','=','binary')]}">
|
||||
<field name="url" widget="url"/>
|
||||
</group>
|
||||
|
||||
</page><page string="Indexed Content">
|
||||
<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="4" col="4">
|
||||
<separator string="File Information" colspan="4"/>
|
||||
<field name="file_size" readonly="1"/>
|
||||
<newline/>
|
||||
</group>
|
||||
|
||||
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Relation" colspan="2"/>
|
||||
<field name="res_name" readonly="1"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="user_id"/>
|
||||
</group>
|
||||
<group col="4" colspan="4">
|
||||
<separator string="History" colspan="4"/>
|
||||
<group col="4" colspan="4">
|
||||
<field name="create_uid"/>
|
||||
<field name="create_date"/>
|
||||
</group>
|
||||
<group col="4" colspan="4">
|
||||
<field name="write_uid"/>
|
||||
<field name="write_date"/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
</page><page string="Notes">
|
||||
</page>
|
||||
<page string="Security">
|
||||
<field name="group_ids" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
|
||||
<page string="Notes">
|
||||
<field colspan="4" name="description" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_attach_filter" model="ir.ui.view">
|
||||
<field name="name">IR Attachment</field>
|
||||
<field name="model">ir.attachment</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="IR Attachment">
|
||||
<filter icon="gtk-media-rewind" string="Recent"
|
||||
help="less 1 month modified/created attachments"
|
||||
domain="[('create_date','<=', time.strftime('%%Y-%%m-%%d')),('create_date','>',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
|
||||
/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="user_id" widget="selection">
|
||||
<filter icon="terp-partner"
|
||||
domain="[('user_id','=', False)]"
|
||||
help="Filter on my Attachment" />
|
||||
</field>
|
||||
<field name="partner_id" widget="selection"/>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By...">
|
||||
<filter string="Partner" icon="terp-partner" domain="[]"
|
||||
context="{'group_by':'partner_id'}" />
|
||||
<filter string="Directory" icon="gtk-open" domain="[]" context="{'group_by':'parent_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_document_file_tree">
|
||||
<field name="name">ir.attachment</field>
|
||||
<field name="model">ir.attachment</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="priority" eval="1"/>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Documents">
|
||||
<tree colors="blue:type in ('url')" string="Documents">
|
||||
<field name="name"/>
|
||||
<field name="title" />
|
||||
<field name="partner_id"/>
|
||||
<field name="type"/>
|
||||
<field name="datas_fname"/>
|
||||
<field name="user_id"/>
|
||||
<field name="create_date"/>
|
||||
<field name="write_date"/>
|
||||
</tree>
|
||||
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
|
|
@ -44,7 +44,6 @@ class report_document_user(osv.osv):
|
|||
('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True),
|
||||
'user_id':fields.integer('Owner', readonly=True),
|
||||
'user':fields.char('User',size=64,readonly=True),
|
||||
'file_title': fields.char('File Name',size=64,readonly=True),
|
||||
'directory': fields.char('Directory',size=64,readonly=True),
|
||||
'create_date': fields.datetime('Date Created', readonly=True),
|
||||
'change_date': fields.datetime('Modified Date', readonly=True),
|
||||
|
@ -66,7 +65,6 @@ class report_document_user(osv.osv):
|
|||
d.name as directory,
|
||||
f.create_date as create_date,
|
||||
f.file_size as file_size,
|
||||
min(f.title) as file_title,
|
||||
min(d.type) as type,
|
||||
f.write_date as change_date
|
||||
from ir_attachment f
|
||||
|
@ -83,7 +81,6 @@ class report_files_partner(osv.osv):
|
|||
_auto = False
|
||||
_columns = {
|
||||
'name': fields.char('Year',size=64,required=False, readonly=True),
|
||||
'file_title': fields.char('File Name',size=64,readonly=True),
|
||||
'directory': fields.char('Directory',size=64,readonly=True),
|
||||
'create_date': fields.datetime('Date Created', readonly=True),
|
||||
'change_date': fields.datetime('Modified Date', readonly=True),
|
||||
|
@ -101,7 +98,6 @@ class report_files_partner(osv.osv):
|
|||
select min(f.id) as id,count(*) as nbr,
|
||||
to_char(f.create_date,'YYYY') as name,
|
||||
min(to_char(f.create_date,'MM')) as month,
|
||||
min(f.title) as file_title,
|
||||
p.name as partner
|
||||
from ir_attachment f
|
||||
inner join res_partner p
|
||||
|
@ -145,7 +141,6 @@ class report_document_wall(osv.osv):
|
|||
'user_id':fields.many2one('res.users', 'Owner',readonly=True),
|
||||
'user':fields.char('User',size=64,readonly=True),
|
||||
'month': fields.char('Month', size=24,readonly=True),
|
||||
'file_name':fields.char('Last Posted File Name',size=64,readonly=True),
|
||||
'last':fields.datetime('Last Posted Time', readonly=True),
|
||||
}
|
||||
|
||||
|
@ -153,7 +148,6 @@ class report_document_wall(osv.osv):
|
|||
cr.execute("""
|
||||
create or replace view report_document_wall as (
|
||||
select max(f.id) as id,
|
||||
min(title) as file_name,
|
||||
to_char(min(f.create_date),'YYYY-MM-DD HH24:MI:SS') as last,
|
||||
f.user_id as user_id, f.user_id as user,
|
||||
to_char(f.create_date,'Month') as month
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="Files">
|
||||
<field name="name" select="1"/>
|
||||
<field name="file_title" select="1"/>
|
||||
<field name="user" select="1"/>
|
||||
<field name="directory" select="1"/>
|
||||
<field name="file_size"/>
|
||||
|
@ -26,7 +25,6 @@
|
|||
<tree string="Files">
|
||||
<field name="name" select="1"/>
|
||||
<field name="month" select="1"/>
|
||||
<field name="file_title"/>
|
||||
<field name="user" select="1"/>
|
||||
<field name="directory" select="1"/>
|
||||
<field name="file_size"/>
|
||||
|
@ -48,7 +46,6 @@
|
|||
<separator orientation="vertical"/>
|
||||
<field name="name" select="1"/>
|
||||
<field name="month" select="1"/>
|
||||
<field name="file_title" select="1"/>
|
||||
<field name="user" select="1"/>
|
||||
<field name="directory" select="1"/>
|
||||
</group>
|
||||
|
@ -79,13 +76,11 @@
|
|||
<form string="Wall of Shame">
|
||||
<field name="user_id" select="1"/>
|
||||
<field name="month" select="1"/>
|
||||
<field name="file_name" select="1"/>
|
||||
<field name="last"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_document_wall_tree">
|
||||
<field name="name">report.document.wall.tree</field>
|
||||
<field name="model">report.document.wall</field>
|
||||
|
@ -94,7 +89,6 @@
|
|||
<tree string="Wall of Shame">
|
||||
<field name="user_id" select="1"/>
|
||||
<field name="month" select="1"/>
|
||||
<field name="file_name"/>
|
||||
<field name="last"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
|
|
@ -57,6 +57,7 @@ class PptxIndex(indexer):
|
|||
return ['.pptx']
|
||||
|
||||
def _doIndexFile(self,fname):
|
||||
# pptx2txt.pl package not support in windows platform.
|
||||
# Download pptx2txt package from http://sourceforge.net/projects/pptx2txt/" link.
|
||||
# To install this tool, just copy pptx2txt.pl to appropriate place (e.g. /usr/bin directory)
|
||||
fp = Popen(['pptx2txt.pl', fname], shell=False, stdout=PIPE).stdout
|
||||
|
@ -88,6 +89,7 @@ class DocxIndex(indexer):
|
|||
return ['.docx']
|
||||
|
||||
def _doIndexFile(self,fname):
|
||||
# docx2txt.pl package not support in windows platform.
|
||||
# Download docx2txt package from "http://sourceforge.net/projects/docx2txt/" link.
|
||||
# In case, you don't want to use Makefile for installation, you can follow these steps for manual installation.
|
||||
# Copy docx2txt.pl, docx2txt.sh and docx2txt.config to appropriate place (e.g. /usr/bin directory) . used following command.
|
||||
|
|
|
@ -558,8 +558,7 @@ class abstracted_fs:
|
|||
|
||||
if dst_obj2:
|
||||
ressource_type_id = pool.get('ir.model').search(cr, uid, [('model','=',dst_obj2._name)])[0]
|
||||
ressource_id = dst_obj2.id
|
||||
title = dst_obj2.name
|
||||
ressource_id = dst_obj2.id
|
||||
ressource_model = dst_obj2._name
|
||||
if dst_obj2._name == 'res.partner':
|
||||
partner_id = dst_obj2.id
|
||||
|
@ -569,8 +568,7 @@ class abstracted_fs:
|
|||
ressource_type_id = False
|
||||
ressource_id = False
|
||||
ressource_model = False
|
||||
partner_id = False
|
||||
title = False
|
||||
partner_id = False
|
||||
pool.get('document.directory').write(cr, uid, result['directory'], {
|
||||
'name' : dst_basename,
|
||||
'ressource_id': ressource_id,
|
||||
|
@ -579,8 +577,7 @@ class abstracted_fs:
|
|||
})
|
||||
val = {
|
||||
'res_id': ressource_id,
|
||||
'res_model': ressource_model,
|
||||
'title': title,
|
||||
'res_model': ressource_model,
|
||||
'partner_id': partner_id
|
||||
}
|
||||
pool.get('ir.attachment').write(cr, uid, result['attachment'], val)
|
||||
|
@ -603,7 +600,6 @@ class abstracted_fs:
|
|||
'res_model': False,
|
||||
'name': dst_basename,
|
||||
'datas_fname': dst_basename,
|
||||
'title': dst_basename,
|
||||
}
|
||||
|
||||
if (dst_obj and (dst_obj.type in ('directory','ressource'))) or not dst_obj2:
|
||||
|
@ -613,8 +609,7 @@ class abstracted_fs:
|
|||
|
||||
if dst_obj2:
|
||||
val['res_model'] = dst_obj2._name
|
||||
val['res_id'] = dst_obj2.id
|
||||
val['title'] = dst_obj2.name
|
||||
val['res_id'] = dst_obj2.id
|
||||
if dst_obj2._name == 'res.partner':
|
||||
val['partner_id'] = dst_obj2.id
|
||||
else:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
|
@ -15,7 +15,7 @@
|
|||
# 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/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
|
|
@ -223,25 +223,32 @@
|
|||
<page string="History">
|
||||
<field name="message_ids" colspan="4" nolabel="1" mode="tree,form">
|
||||
<form string="Communication history">
|
||||
<group col="6" colspan="4">
|
||||
<field name="date"/>
|
||||
<field name="email_to"/>
|
||||
<field name="email_from"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<field name="description" colspan="4" nolabel="1"/>
|
||||
<button colspan="4"
|
||||
string="Reply to Last Email"
|
||||
name="%(crm.action_crm_send_mail)d"
|
||||
context="{'mail':'reply', 'model': 'crm.lead'}"
|
||||
icon="gtk-undo" type="action" />
|
||||
</form>
|
||||
<tree string="Communication history">
|
||||
<field name="description"/>
|
||||
<field name="email_to"/>
|
||||
<field name="date"/>
|
||||
</tree>
|
||||
</field>
|
||||
<group col="6" colspan="4">
|
||||
<field name="date"/>
|
||||
<field name="email_to"/>
|
||||
<field name="email_from"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Details">
|
||||
<field name="description" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Attachments">
|
||||
<field name="attachment_ids" colspan="4" readonly="1" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
<button colspan="4"
|
||||
string="Reply to Last Email"
|
||||
name="%(crm.action_crm_send_mail)d"
|
||||
context="{'mail':'reply', 'model': 'event.registration'}"
|
||||
icon="gtk-undo" type="action" />
|
||||
</form>
|
||||
<tree string="Communication history">
|
||||
<field name="date"/>
|
||||
<field name="email_from" />
|
||||
<field name="email_to"/>
|
||||
<field name="description"/>
|
||||
</tree>
|
||||
</field>
|
||||
<field name="log_ids" nolabel="1" colspan="4" mode="tree,form" readonly="1">
|
||||
<tree string="Actions">
|
||||
<separator string="Action Information" colspan="4"/>
|
||||
|
|
|
@ -69,7 +69,7 @@ class event_make_invoice(osv.osv_memory):
|
|||
inv_rej_reason += "ID "+str(reg.id)+": Registration doesn't have any partner to invoice. \n"
|
||||
continue
|
||||
else:
|
||||
val_invoice = pool_obj.get('account.invoice').onchange_partner_id(cr, uid, [], 'out_invoice', reg.partner_invoice_id.id, False, False)
|
||||
val_invoice = inv_obj.onchange_partner_id(cr, uid, [], 'out_invoice', reg.partner_invoice_id.id, False, False)
|
||||
val_invoice['value'].update({'partner_id': reg.partner_invoice_id.id})
|
||||
partner_address_id = val_invoice['value']['address_invoice_id']
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
<field eval="[(6,0,[])]" name="users"/>
|
||||
<field name="type" ref="survey.survey_type1"/>
|
||||
<field name="responsible_id" ref="base.user_demo"/>
|
||||
<field name="response_user">5</field>
|
||||
</record>
|
||||
</data>
|
||||
<data>
|
||||
|
@ -16,6 +17,7 @@
|
|||
<field eval="[(6,0,[])]" name="users"/>
|
||||
<field name="type" ref="survey.survey_type1"/>
|
||||
<field name="responsible_id" ref="base.user_root"/>
|
||||
<field name="response_user">5</field>
|
||||
</record>
|
||||
</data>
|
||||
<data>
|
||||
|
|
|
@ -148,6 +148,7 @@
|
|||
<field eval="[(6,0,[])]" name="users"/>
|
||||
<field name="type" ref="survey.survey_type1"/>
|
||||
<field name="responsible_id" ref="base.user_root"/>
|
||||
<field name="response_user">5</field>
|
||||
</record>
|
||||
</data>
|
||||
<data>
|
||||
|
|
|
@ -152,26 +152,33 @@
|
|||
<field colspan="4" name="email_cc" string="CC"/>
|
||||
</group>
|
||||
<field name="message_ids" colspan="4" nolabel="1" mode="form,tree">
|
||||
<form string="Communication history">
|
||||
<group col="6" colspan="4">
|
||||
<field name="date"/>
|
||||
<field name="email_to"/>
|
||||
<field name="email_from"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<field name="description" colspan="4" nolabel="1"/>
|
||||
<button colspan="4"
|
||||
string="Reply to Last Email"
|
||||
name="%(crm.action_crm_send_mail)d"
|
||||
context="{'mail':'reply', 'model': 'hr.applicant'}"
|
||||
icon="gtk-undo" type="action" />
|
||||
</form>
|
||||
<tree string="Communication history">
|
||||
<field name="description"/>
|
||||
<field name="email_to"/>
|
||||
<field name="date"/>
|
||||
</tree>
|
||||
</field>
|
||||
<form string="Communication history">
|
||||
<group col="6" colspan="4">
|
||||
<field name="date"/>
|
||||
<field name="email_to"/>
|
||||
<field name="email_from"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Details">
|
||||
<field name="description" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Attachments">
|
||||
<field name="attachment_ids" colspan="4" readonly="1" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
<button colspan="4"
|
||||
string="Reply to Last Email"
|
||||
name="%(crm.action_crm_send_mail)d"
|
||||
context="{'mail':'reply', 'model': 'hr.applicant'}"
|
||||
icon="gtk-undo" type="action" />
|
||||
</form>
|
||||
<tree string="Communication history">
|
||||
<field name="date"/>
|
||||
<field name="email_from" />
|
||||
<field name="email_to"/>
|
||||
<field name="description"/>
|
||||
</tree>
|
||||
</field>
|
||||
<button colspan="4" string="Send New Email"
|
||||
name="%(crm.action_crm_send_mail)d"
|
||||
context="{'mail':'new', 'model': 'hr.applicant'}"
|
||||
|
|
|
@ -57,8 +57,7 @@ class hr_analytic_timesheet(osv.osv):
|
|||
|
||||
def on_change_unit_amount(self, cr, uid, id, prod_id, unit_amount, unit, context={}):
|
||||
res = {}
|
||||
# if prod_id and unit_amount:
|
||||
if prod_id:
|
||||
if prod_id and unit_amount:
|
||||
# find company
|
||||
company_id = self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', context=context)
|
||||
res = self.pool.get('account.analytic.line').on_change_unit_amount(cr, uid, id, prod_id, unit_amount, company_id, unit, context=context)
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
from osv import osv
|
||||
from osv import fields
|
||||
from tools.translate import _
|
||||
import time
|
||||
|
||||
VoteValues = [('-1', 'Not Voted'), ('0', 'Very Bad'), ('25', 'Bad'), \
|
||||
('50', 'Normal'), ('75', 'Good'), ('100', 'Very Good') ]
|
||||
|
@ -29,7 +30,7 @@ DefaultVoteValue = '50'
|
|||
|
||||
class idea_category(osv.osv):
|
||||
""" Category of Idea """
|
||||
|
||||
|
||||
_name = "idea.category"
|
||||
_description = "Idea Category"
|
||||
|
||||
|
@ -155,16 +156,16 @@ class idea_idea(osv.osv):
|
|||
'title': fields.char('Idea Summary', size=64, required=True, readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'description': fields.text('Description', help='Content of the idea', readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'comment_ids': fields.one2many('idea.comment', 'idea_id', 'Comments'),
|
||||
'create_date': fields.datetime('Creation date', readonly=True),
|
||||
'created_date': fields.datetime('Creation date', readonly=True),
|
||||
'vote_ids': fields.one2many('idea.vote', 'idea_id', 'Vote'),
|
||||
'my_vote': fields.function(_vote_read, fnct_inv = _vote_save, string="My Vote", method=True, type="selection", selection=VoteValues),
|
||||
'vote_avg': fields.function(_vote_avg_compute, method=True, string="Average Score", type="float"),
|
||||
'count_votes': fields.function(_vote_count, method=True, string="Count of votes", type="integer"),
|
||||
'count_comments': fields.function(_comment_count, method=True, string="Count of comments", type="integer"),
|
||||
'category_id': fields.many2one('idea.category', 'Category', required=True, readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'state': fields.selection([('draft', 'Draft'),
|
||||
'state': fields.selection([('draft', 'Draft'),
|
||||
('open', 'Opened'),
|
||||
('close', 'Accepted'),
|
||||
('close', 'Accepted'),
|
||||
('cancel', 'Cancelled')],
|
||||
'State', readonly=True,
|
||||
help='When the Idea is created the state is \'Draft\'.\n It is \
|
||||
|
@ -173,12 +174,16 @@ class idea_idea(osv.osv):
|
|||
),
|
||||
'visibility':fields.boolean('Open Idea?', required=False),
|
||||
'stat_vote_ids': fields.one2many('idea.vote.stat', 'idea_id', 'Statistics', readonly=True),
|
||||
'vote_limit': fields.integer('Maximum Vote per User',
|
||||
help="Set to one if you require only one Vote per user"),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'user_id': lambda self,cr,uid,context: uid,
|
||||
'my_vote': lambda *a: '-1',
|
||||
'state': lambda *a: 'draft',
|
||||
'vote_limit': lambda * a: 1,
|
||||
'created_date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
|
||||
'visibility': lambda *a: True,
|
||||
}
|
||||
_order = 'id desc'
|
||||
|
@ -190,11 +195,11 @@ class idea_idea(osv.osv):
|
|||
@param user: ID of the user currently logged in
|
||||
@param vals: provides data for new record
|
||||
@param context: context arguments, like lang, time zone
|
||||
|
||||
|
||||
@return: Returns an id of the new record
|
||||
"""
|
||||
visibility = False
|
||||
|
||||
|
||||
if vals.get('category_id', False):
|
||||
category_pool = self.pool.get('idea.category')
|
||||
category = category_pool.browse(cr, user, vals.get('category_id'), context)
|
||||
|
@ -215,41 +220,41 @@ class idea_idea(osv.osv):
|
|||
@param id: list of record ids on which copy method executes
|
||||
@param default: dict type contains the values to be overridden during copy of object
|
||||
@param context: context arguments, like lang, time zone
|
||||
|
||||
|
||||
@return: Returns the id of the new record
|
||||
"""
|
||||
|
||||
|
||||
default.update({
|
||||
'comment_ids':False,
|
||||
'vote_ids':False,
|
||||
'stat_vote_ids':False
|
||||
|
||||
|
||||
})
|
||||
res_id = super(idea_idea, self).copy(cr, uid, id, default, context)
|
||||
return res_id
|
||||
|
||||
|
||||
def write(self, cr, user, ids, vals, context=None):
|
||||
"""
|
||||
Update redord(s) exist in {ids}, with new value provided in {vals}
|
||||
|
||||
|
||||
@param cr: A database cursor
|
||||
@param user: ID of the user currently logged in
|
||||
@param ids: list of record ids to update
|
||||
@param vals: dict of new values to be set
|
||||
@param context: context arguments, like lang, time zone
|
||||
|
||||
|
||||
@return: Returns True on success, False otherwise
|
||||
"""
|
||||
|
||||
|
||||
state = self.browse(cr, user, ids[0]).state
|
||||
|
||||
|
||||
if vals.get('my_vote', False):
|
||||
if vals.get('state', state) != 'open':
|
||||
raise osv.except_osv(_("Warning !"), _("Draft/Accepted/Cancelled ideas Could not be voted"))
|
||||
|
||||
|
||||
res = super(idea_idea, self).write(cr, user, ids, vals, context)
|
||||
return res
|
||||
|
||||
|
||||
def idea_cancel(self, cr, uid, ids):
|
||||
self.write(cr, uid, ids, { 'state': 'cancel' })
|
||||
return True
|
||||
|
@ -261,7 +266,7 @@ class idea_idea(osv.osv):
|
|||
def idea_close(self, cr, uid, ids):
|
||||
self.write(cr, uid, ids, { 'state': 'close' })
|
||||
return True
|
||||
|
||||
|
||||
def idea_draft(self, cr, uid, ids):
|
||||
self.write(cr, uid, ids, { 'state': 'draft' })
|
||||
return True
|
||||
|
@ -299,12 +304,15 @@ class idea_vote(osv.osv):
|
|||
_rec_name = 'score'
|
||||
|
||||
_columns = {
|
||||
'user_id': fields.many2one('res.users', 'User'),
|
||||
'idea_id': fields.many2one('idea.idea', 'Idea', required=True, ondelete='cascade'),
|
||||
'score': fields.selection(VoteValues, 'Score', required=True)
|
||||
'user_id': fields.many2one('res.users', 'By user', readonly="True"),
|
||||
'idea_id': fields.many2one('idea.idea', 'Idea', readonly="True", ondelete='cascade'),
|
||||
'score': fields.selection(VoteValues, 'Vote Status', readonly="True"),
|
||||
'date': fields.datetime('Date', readonly="True"),
|
||||
'comment': fields.text('Comment', readonly="True"),
|
||||
}
|
||||
_defaults = {
|
||||
'score': lambda *a: DefaultVoteValue,
|
||||
'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
|
||||
}
|
||||
|
||||
idea_vote()
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
|
||||
<menuitem name="Categories" parent="menu_ideas" id="menu_idea_category" action="action_idea_category" />
|
||||
|
||||
|
||||
<!-- Idea Category Action -->
|
||||
|
||||
<record model="ir.actions.act_window" id="action_idea_category_tree">
|
||||
|
@ -60,8 +61,18 @@
|
|||
</record>
|
||||
|
||||
<menuitem name="Ideas" parent="base.menu_tools" id="menu_ideas1" sequence="4"/>
|
||||
|
||||
<menuitem
|
||||
name="Ideas by Categories" parent="menu_ideas1"
|
||||
id="menu_idea_category_tree"
|
||||
action="action_idea_category_tree"/>
|
||||
|
||||
<menuitem name="Give Vote" parent="menu_ideas1"
|
||||
id="menu_give_vote"
|
||||
action="action_idea_select"/>
|
||||
|
||||
<!-- Oepn Ideas Action -->
|
||||
|
||||
<!-- Open Ideas Action -->
|
||||
|
||||
<record model="ir.actions.act_window" id="action_idea_idea_categ_open">
|
||||
<field name="name">Open Ideas</field>
|
||||
|
@ -102,9 +113,9 @@
|
|||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Votes">
|
||||
<field name="idea_id"/>
|
||||
<field name="user_id"/>
|
||||
<field name="score" />
|
||||
<field name="user_id" />
|
||||
<field name="score"/>
|
||||
<field name="date"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -117,12 +128,39 @@
|
|||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Votes">
|
||||
<field name="idea_id" select="1" />
|
||||
<field name="user_id" select="1" />
|
||||
<field name="score"/>
|
||||
<group colspan="4">
|
||||
<field name="user_id" select="1" />
|
||||
<field name="date"/>
|
||||
<newline/>
|
||||
<field name="score"/>
|
||||
</group>
|
||||
<separator string="Comments:" colspan="4"/>
|
||||
<field name="comment" colspan="4" nolabel="1"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Search view for Idea vote -->
|
||||
|
||||
<record model="ir.ui.view" id="view_idea_vote_search">
|
||||
<field name="name">idea.vote.search</field>
|
||||
<field name="model">idea.vote</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Ideas vote">
|
||||
<group col="10" colspan="4">
|
||||
<field name="idea_id" widget="selection"/>
|
||||
<field name="user_id" widget="selection"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="14">
|
||||
<filter string="Vote date" icon="terp-crm" domain="[]" context="{'group_by':'date'}"/>
|
||||
<filter string="Idea" icon="terp-crm" domain="[]" context="{'group_by':'idea_id'}"/>
|
||||
<filter string="User" name="user" icon="terp-partner" domain="[]" context="{'group_by':'user_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- New Idea Form View -->
|
||||
|
||||
|
@ -180,7 +218,8 @@
|
|||
<field name="score"/>
|
||||
<field name="nbr"/>
|
||||
</tree>
|
||||
</field>
|
||||
</field>
|
||||
|
||||
</page>
|
||||
</notebook>
|
||||
<group colspan="4" col="6">
|
||||
|
@ -188,7 +227,6 @@
|
|||
<button name="idea_open" string="Open" states="draft" icon="gtk-go-forward"/>
|
||||
<button name="idea_close" string="Accept" states="open" icon="gtk-jump-to"/>
|
||||
<button name="idea_cancel" string="Refuse" states="open" icon="gtk-cancel"/>
|
||||
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
|
@ -201,15 +239,15 @@
|
|||
<field name="model">idea.idea</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="All Ideas">
|
||||
<tree string="Ideas">
|
||||
<field name="title"/>
|
||||
<field name="category_id" />
|
||||
<field name="create_date"/>
|
||||
<field name="created_date"/>
|
||||
<field name="vote_avg" widget="progressbar"/>
|
||||
<field name="count_comments" />
|
||||
<field name="count_votes" />
|
||||
<field name="state"/>
|
||||
<button name="%(action_idea_post_vote)d" icon="gtk-execute" type="action" states="draft,open" string="Vote"/>
|
||||
<button name="%(idea.action_idea_post_vote)d" icon="gtk-execute" type="action" states="open" string="Submit Vote"/>
|
||||
<button name="idea_close" string="Accept" states="open" icon="gtk-jump-to"/>
|
||||
<button name="idea_cancel" string="Refuse" states="open" icon="gtk-cancel"/>
|
||||
</tree>
|
||||
|
@ -244,23 +282,6 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Comments on Idea Tree View -->
|
||||
|
||||
<record model="ir.ui.view" id="view_idea_comment_tree">
|
||||
<field name="name">idea.comment.tree</field>
|
||||
<field name="model">idea.comment</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Comments">
|
||||
<field name="create_date" />
|
||||
<field name="user_id" />
|
||||
<field name="content" string="Comment" />
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Idea Action -->
|
||||
|
||||
<record model="ir.actions.act_window" id="action_idea_idea">
|
||||
<field name="name">Ideas</field>
|
||||
<field name="res_model">idea.idea</field>
|
||||
|
@ -348,9 +369,10 @@
|
|||
<field name="res_model">idea.vote</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="search_view_id" ref="view_idea_vote_search"/>
|
||||
</record>
|
||||
|
||||
<menuitem name="All Votes" parent="menu_ideas" id="menu_idea_vote" action="action_idea_vote"/>
|
||||
<menuitem name="Votes" parent="menu_ideas" id="menu_idea_vote" action="action_idea_vote"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_idea_category","idea.category","model_idea_category","base.group_user",1,0,0,0
|
||||
"access_idea_idea","idea.idea","model_idea_idea","base.group_user",1,1,1,1
|
||||
"access_idea_comment","idea.comment","model_idea_comment","base.group_user",1,1,1,1
|
||||
"access_idea_vote","idea.vote","model_idea_vote","base.group_user",1,1,1,1
|
||||
"access_idea_vote_stat","idea.vote.stat","model_idea_vote_stat","base.group_user",1,0,0,0
|
||||
"access_idea_category_system","idea.category system","model_idea_category","base.group_system",1,1,1,1
|
||||
"idea_post_vote","idea.post.vote","model_idea_post_vote","base.group_user",1,1,1,1
|
||||
"access_idea_select","idea.select","model_idea_select","base.group_user",1,1,1,1
|
||||
"access_idea_comment","idea.comment","model_idea_comment","base.group_system",1,1,1,1
|
||||
|
|
|
|
@ -8,10 +8,10 @@
|
|||
name: Technical
|
||||
- |
|
||||
I create a New Idea of "Technical presentation for 1 hours in every day" and specify category "Technical".
|
||||
|
||||
-
|
||||
!record {model: idea.idea, id: idea_idea_0}:
|
||||
category_id: idea_category_technical0
|
||||
created_date: '05/13/2010 19:16:26'
|
||||
description: I want that Technical presentation are arranged for 1 hours in every
|
||||
day.\nso, on that presentation, we can know all things what improvement and development
|
||||
are done in our company.\n\n\n\n\n
|
||||
|
@ -44,52 +44,50 @@
|
|||
!record {model: res.users, id: res_users_user1}:
|
||||
company_id: base.main_company
|
||||
context_lang: en_US
|
||||
groups_id:
|
||||
- base.group_system
|
||||
- base.group_user
|
||||
login: user2
|
||||
name: user2
|
||||
password: user2
|
||||
|
||||
- |
|
||||
In order to post vote I connect as user1 and open the idea page
|
||||
I click on "Vote" wizard and vote the idea as "Normal"
|
||||
I click on "Submit Vote" wizard button and vote the idea as "Normal"
|
||||
-
|
||||
!record {model: idea.post.vote, id: idea_post_vote_0}:
|
||||
vote: 50
|
||||
|
||||
- |
|
||||
Now I click on "Post Vote" button of wizard.
|
||||
Now I click on "Post" button of this wizard.
|
||||
-
|
||||
!python {model: idea.post.vote}: |
|
||||
uid = ref('res_users_user0')
|
||||
self.do_vote(cr, uid, [ref("idea_post_vote_0")], {'active_id': ref('idea_idea_0')})
|
||||
self.do_vote(cr, uid, [ref("idea_post_vote_0")], {'active_ids': [ref('idea_idea_0')]})
|
||||
|
||||
- |
|
||||
To add other vote I connect as user2 and open the idea page
|
||||
I click on "Vote" wizard and vote the idea as "Very Good"
|
||||
To add other vote I connect as user2 and open the idea page.
|
||||
|
||||
I click on "Submit Vote" wizard button and vote the idea as "Very Good".
|
||||
|
||||
and put comment "We can learn many things from technical presentation".
|
||||
|
||||
-
|
||||
!record {model: idea.post.vote, id: idea_post_vote_1}:
|
||||
vote: 100
|
||||
|
||||
note: 'We can learn many things from technical presentation'
|
||||
- |
|
||||
I click on "Post Vote" button of this wizard.
|
||||
I click on "Post" button of this wizard.
|
||||
-
|
||||
!python {model: idea.post.vote}: |
|
||||
uid = ref('res_users_user1')
|
||||
self.do_vote(cr, uid, [ref("idea_post_vote_1")], {'active_id': ref('idea_idea_0')})
|
||||
self.do_vote(cr, uid, [ref("idea_post_vote_1")], {'active_ids': [ref('idea_idea_0')]})
|
||||
|
||||
- |
|
||||
I can see that the Average score changed in "Average score" field with value 75
|
||||
-
|
||||
!record {model: idea.idea, id: idea_idea_0}:
|
||||
vote_avg: 75
|
||||
|
||||
- |
|
||||
I put one comment "We can learn many things from technical presentation" for the idea.
|
||||
-
|
||||
!record {model: idea.idea, id: idea.idea_idea_0}:
|
||||
comment_ids:
|
||||
- content: "We can learn many things from technical presentation"
|
||||
idea_id: idea.idea_idea_0
|
||||
user_id: res_users_user1
|
||||
|
||||
- |
|
||||
I connect as Manager and close this idea by click on "Close" button.
|
||||
|
|
|
@ -34,11 +34,11 @@ class idea_post_vote(osv.osv_memory):
|
|||
('25', 'Bad'),
|
||||
('50', 'Normal'),
|
||||
('75', 'Good'),
|
||||
('100', 'Very Good') ],
|
||||
('100', 'Very Good') ],
|
||||
'Post Vote', required=True),
|
||||
'note': fields.text('Description'),
|
||||
}
|
||||
|
||||
|
||||
def get_default(self, cr, uid, context={}):
|
||||
"""
|
||||
This function checks for precondition before wizard executes
|
||||
|
@ -49,17 +49,17 @@ class idea_post_vote(osv.osv_memory):
|
|||
@param context: A standard dictionary for contextual values
|
||||
"""
|
||||
idea_obj = self.pool.get('idea.idea')
|
||||
|
||||
|
||||
if context.get('active_id'):
|
||||
idea = idea_obj.browse(cr, uid, context.get('active_id'))
|
||||
return idea.my_vote
|
||||
else:
|
||||
return 75
|
||||
|
||||
|
||||
_defaults = {
|
||||
'vote': get_default,
|
||||
}
|
||||
|
||||
|
||||
def view_init(self, cr, uid, fields, context=None):
|
||||
"""
|
||||
This function checks for precondition before wizard executes
|
||||
|
@ -70,15 +70,28 @@ class idea_post_vote(osv.osv_memory):
|
|||
@param context: A standard dictionary for contextual values
|
||||
"""
|
||||
idea_obj = self.pool.get('idea.idea')
|
||||
vote_obj = self.pool.get('idea.vote')
|
||||
|
||||
for idea in idea_obj.browse(cr, uid, context.get('active_ids', [])):
|
||||
if idea.state in ['draft', 'close', 'cancel']:
|
||||
raise osv.except_osv(_("Warning !"), _("Draft/Accepted/Cancelled ideas Could not be voted"))
|
||||
|
||||
for active_id in context.get('active_ids'):
|
||||
|
||||
vote_ids = vote_obj.search(cr, uid, [('user_id', '=', uid), ('idea_id', '=', active_id)])
|
||||
vote_obj_id = vote_obj.browse(cr, uid, vote_ids)
|
||||
count = 0
|
||||
for vote in vote_obj_id:
|
||||
count += 1
|
||||
|
||||
user_limit = idea.vote_limit
|
||||
if count >= user_limit:
|
||||
raise osv.except_osv(_('Warning !'),_("You can not give Vote for this idea more than %s times") % (user_limit))
|
||||
|
||||
if idea.state != 'open':
|
||||
raise osv.except_osv(_('Warning !'), _('idea should be in \'Open\' state before vote for that idea.'))
|
||||
raise osv.except_osv(_('Warning !'), _('Idea should be in \
|
||||
\'Open\' state before vote for that idea.'))
|
||||
return False
|
||||
|
||||
def do_vote(self, cr, uid, ids, context):
|
||||
def do_vote(self, cr, uid, ids, context=None):
|
||||
"""
|
||||
Create idea vote.
|
||||
@param cr: the current row, from the database cursor,
|
||||
|
@ -86,8 +99,8 @@ class idea_post_vote(osv.osv_memory):
|
|||
@param ids: List of Idea Post vote’s IDs.
|
||||
@return: Dictionary {}
|
||||
"""
|
||||
|
||||
vote_id = context and context.get('active_id', False) or False
|
||||
|
||||
vote_ids = context and context.get('active_ids', []) or []
|
||||
vote_pool = self.pool.get('idea.vote')
|
||||
idea_pool = self.pool.get('idea.idea')
|
||||
comment_pool = self.pool.get('idea.comment')
|
||||
|
@ -96,8 +109,8 @@ class idea_post_vote(osv.osv_memory):
|
|||
score = str(do_vote_obj['vote'])
|
||||
comment = do_vote_obj.get('note', False)
|
||||
vote = {
|
||||
'idea_id': vote_id,
|
||||
'user_id': uid,
|
||||
'idea_id': vote_id,
|
||||
'user_id': uid,
|
||||
'score': score
|
||||
}
|
||||
if comment:
|
||||
|
@ -114,5 +127,44 @@ class idea_post_vote(osv.osv_memory):
|
|||
|
||||
idea_post_vote()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
class idea_select(osv.osv_memory):
|
||||
|
||||
""" Select idea for vote."""
|
||||
|
||||
_name = "idea.select"
|
||||
_description = "select idea"
|
||||
|
||||
_columns = {
|
||||
'idea_id': fields.many2one('idea.idea', 'Idea', required=True),
|
||||
}
|
||||
|
||||
def open_vote(self, cr, uid, ids, context=None):
|
||||
"""
|
||||
This function load column.
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current users ID for security checks,
|
||||
@param ids: List of load column,
|
||||
@return: dictionary of query logs clear message window
|
||||
"""
|
||||
idea_obj = self.browse(cr, uid, ids)
|
||||
for idea in idea_obj:
|
||||
idea_id = idea.idea_id.id
|
||||
|
||||
data_obj = self.pool.get('ir.model.data')
|
||||
id2 = data_obj._get_id(cr, uid, 'idea', 'view_idea_post_vote')
|
||||
if id2:
|
||||
id2 = data_obj.browse(cr, uid, id2, context=context).res_id
|
||||
value = {
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'idea.post.vote',
|
||||
'views': [(id2, 'form'), (False, 'tree'), (False, 'calendar'), (False, 'graph')],
|
||||
'type': 'ir.actions.act_window',
|
||||
'target': 'new',
|
||||
'context': {'active_ids': [idea_id]}
|
||||
}
|
||||
return value
|
||||
|
||||
idea_select()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<!-- Post Idea for vote Form View -->
|
||||
|
||||
<record id="view_idea_post_vote" model="ir.ui.view">
|
||||
|
@ -9,7 +8,7 @@
|
|||
<field name="model">idea.post.vote</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Create Tasks">
|
||||
<form string="Give Vote">
|
||||
<group colspan="4" >
|
||||
<field name="vote" colspan="4"/>
|
||||
<separator string="Comment" colspan="4"/>
|
||||
|
@ -18,12 +17,33 @@
|
|||
<separator string="" colspan="4" />
|
||||
<group colspan="4" col="6">
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
<button icon="gtk-ok" name="do_vote" string="Post Vote" type="object"/>
|
||||
<button icon="gtk-ok" name="do_vote" string="Post" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="view_idea_select" model="ir.ui.view">
|
||||
<field name="name">idea.select.form</field>
|
||||
<field name="model">idea.select</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Select Idea for Vote">
|
||||
<group colspan="4" >
|
||||
<separator string="Select Idea for Vote" colspan="4"/>
|
||||
<field name="idea_id"/>
|
||||
</group>
|
||||
<separator string="" colspan="4"/>
|
||||
<group colspan="4" col="6">
|
||||
<label string="" colspan="2"/>
|
||||
<button icon="gtk-cancel" special="cancel" string="Close"/>
|
||||
<button icon="gtk-go-forward" name="open_vote" string="Next" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Post Idea for vote Action -->
|
||||
|
||||
<record id="action_idea_post_vote" model="ir.actions.act_window">
|
||||
|
@ -33,7 +53,17 @@
|
|||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_idea_post_vote"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
</record>
|
||||
|
||||
<record id="action_idea_select" model="ir.actions.act_window">
|
||||
<field name="name">Idea select</field>
|
||||
<field name="res_model">idea.select</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_idea_select"/>
|
||||
<field name="target">new</field>
|
||||
<field name="context">{'model': 'idea.idea'}</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -24,18 +24,15 @@
|
|||
'version': '1.0',
|
||||
'category': 'Generic Modules/Mail Service',
|
||||
'description': """The generic email gateway system allows to send and receive emails
|
||||
* IMAP / IMAP with SSL
|
||||
* POP / POP with SSL
|
||||
* SMTP / SMTP with TLS
|
||||
* ACL based access policy
|
||||
* Queueing and History for Emails
|
||||
* History for Emails
|
||||
* Easy Integration with any Module""",
|
||||
'author': 'Tiny',
|
||||
'website': 'http://www.openerp.com',
|
||||
'depends': ['base'],
|
||||
'init_xml': [],
|
||||
'update_xml': [
|
||||
"mail_gateway_view.xml"
|
||||
"mail_gateway_view.xml",
|
||||
'security/ir.model.access.csv'
|
||||
],
|
||||
'demo_xml': [],
|
||||
'installable': True,
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
from osv import osv, fields
|
||||
import time
|
||||
import base64
|
||||
|
||||
class one2many_domain(fields.one2many):
|
||||
def set(self, cr, obj, id, field, values, user=None, context=None):
|
||||
|
@ -49,12 +50,12 @@ class mailgate_thread(osv.osv):
|
|||
_rec_name = 'thread'
|
||||
|
||||
_columns = {
|
||||
'thread': fields.char('Thread', size=32, required=False),
|
||||
'thread': fields.char('Thread', size=32, required=False),
|
||||
'message_ids': one2many_domain('mailgate.message', 'thread_id', 'Messages', domain=[('history', '=', True)], required=False),
|
||||
'log_ids': one2many_domain('mailgate.message', 'thread_id', 'Logs', domain=[('history', '=', False)], required=False),
|
||||
'log_ids': one2many_domain('mailgate.message', 'thread_id', 'Logs', domain=[('history', '=', False)], required=False),
|
||||
}
|
||||
|
||||
def __history(self, cr, uid, cases, keyword, history=False, email=False, details=None, email_from=False, message_id=False, context={}):
|
||||
def __history(self, cr, uid, cases, keyword, history=False, subject=None, email=False, details=None, email_from=False, message_id=False, attach=[], context={}):
|
||||
"""
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
|
@ -64,6 +65,7 @@ class mailgate_thread(osv.osv):
|
|||
@param history: Value True/False, If True it makes entry in case History otherwise in Case Log
|
||||
@param email: Email address if any
|
||||
@param details: Details of case history if any
|
||||
@param atach: Attachment sent in email
|
||||
@param context: A standard dictionary for contextual values"""
|
||||
if context is None:
|
||||
context = {}
|
||||
|
@ -72,28 +74,43 @@ class mailgate_thread(osv.osv):
|
|||
cases = self.pool.get(context['model']).browse(cr, uid, cases, context=context)
|
||||
|
||||
model_obj = self.pool.get('ir.model')
|
||||
|
||||
att_obj = self.pool.get('ir.attachment')
|
||||
obj = self.pool.get('mailgate.message')
|
||||
|
||||
for case in cases:
|
||||
model_ids = model_obj.search(cr, uid, [('model', '=', case._name)])
|
||||
data = {
|
||||
'name': keyword,
|
||||
'user_id': uid,
|
||||
'model_id' : model_ids and model_ids[0] or False,
|
||||
'date': time.strftime('%Y-%m-%d %H:%M:%S'),
|
||||
'thread_id': case.thread_id.id,
|
||||
'message_id': message_id
|
||||
'name': keyword,
|
||||
'user_id': uid,
|
||||
'model_id' : model_ids and model_ids[0] or False,
|
||||
'date': time.strftime('%Y-%m-%d %H:%M:%S'),
|
||||
'thread_id': case.thread_id.id,
|
||||
'message_id': message_id,
|
||||
}
|
||||
|
||||
attachments = []
|
||||
if history:
|
||||
data['history'] = True
|
||||
data['description'] = details or case.description
|
||||
data['email_to'] = email or \
|
||||
(case.user_id and case.user_id.address_id and \
|
||||
case.user_id.address_id.email) or tools.config.get('email_from', False)
|
||||
data['email_from'] = email_from or \
|
||||
(case.user_id and case.user_id.address_id and \
|
||||
case.user_id.address_id.email) or tools.config.get('email_from', False)
|
||||
for att in attach:
|
||||
attachments.append(att_obj.create(cr, uid, {'name': att[0], 'datas': base64.encodestring(att[1])}))
|
||||
|
||||
data = {
|
||||
'name': subject or 'History',
|
||||
'history': True,
|
||||
'user_id': uid,
|
||||
'model_id' : model_ids and model_ids[0] or False,
|
||||
'res_id': case.id,
|
||||
'date': time.strftime('%Y-%m-%d %H:%M:%S'),
|
||||
'description': details or (hasattr(case, 'description') and case.description or False),
|
||||
'email_to': email or \
|
||||
(hasattr(case, 'user_id') and case.user_id and case.user_id.address_id and \
|
||||
case.user_id.address_id.email) or tools.config.get('email_from', False),
|
||||
'email_from': email_from or \
|
||||
(hasattr(case, 'user_id') and case.user_id and case.user_id.address_id and \
|
||||
case.user_id.address_id.email) or tools.config.get('email_from', False),
|
||||
'partner_id': hasattr(case, 'partner_id') and (case.partner_id and case.partner_id.id or False) or False,
|
||||
'thread_id': case.thread_id.id,
|
||||
'message_id': message_id,
|
||||
'attachment_ids': [(6, 0, attachments)]
|
||||
}
|
||||
res = obj.create(cr, uid, data, context)
|
||||
return True
|
||||
|
||||
|
@ -112,20 +129,22 @@ class mailgate_message(osv.osv):
|
|||
_order = 'date desc'
|
||||
|
||||
_columns = {
|
||||
'name':fields.char('Message', size=64),
|
||||
'model_id': fields.many2one('ir.model', 'Model'),
|
||||
'thread_id':fields.many2one('mailgate.thread', 'Thread'),
|
||||
'date': fields.datetime('Date'),
|
||||
'name':fields.char('Message', size=64),
|
||||
'model_id': fields.many2one('ir.model', 'Model'),
|
||||
'res_id': fields.integer('Resource ID'),
|
||||
'thread_id':fields.many2one('mailgate.thread', 'Thread'),
|
||||
'date': fields.datetime('Date'),
|
||||
'history': fields.boolean('Is History?', required=False),
|
||||
'user_id': fields.many2one('res.users', 'User Responsible', readonly=True),
|
||||
'message': fields.text('Description'),
|
||||
'email_from': fields.char('Email From', size=84),
|
||||
'email_to': fields.char('Email To', size=84),
|
||||
'email_cc': fields.char('Email From', size=84),
|
||||
'email_bcc': fields.char('Email From', size=84),
|
||||
'message_id': fields.char('Message Id', size=1024, readonly=True, help="Message Id on Email Server.", select=True),
|
||||
'user_id': fields.many2one('res.users', 'User Responsible', readonly=True),
|
||||
'message': fields.text('Description'),
|
||||
'email_from': fields.char('Email From', size=84),
|
||||
'email_to': fields.char('Email To', size=84),
|
||||
'email_cc': fields.char('Email CC', size=84),
|
||||
'email_bcc': fields.char('Email BCC', size=84),
|
||||
'message_id': fields.char('Message Id', size=1024, readonly=True, help="Message Id on Email Server.", select=True),
|
||||
'description': fields.text('Description'),
|
||||
'attachment_ids': fields.many2many('ir.attachment', 'message_attachment_rel', 'message_id', 'attachment_id', 'Attachments'),
|
||||
'partner_id': fields.many2one('res.partner', 'Partner', required=False),
|
||||
'attachment_ids': fields.many2many('ir.attachment', 'message_attachment_rel', 'message_id', 'attachment_id', 'Attachments'),
|
||||
}
|
||||
|
||||
mailgate_message()
|
||||
|
|
|
@ -1,30 +1,33 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record model="ir.ui.view" id="view_maligate_message_form">
|
||||
<field name="name">maligate.message.form</field>
|
||||
<field name="model">maligate.message</field>
|
||||
<record model="ir.ui.view" id="view_mailgate_message_form">
|
||||
<field name="name">mailgate.message.form</field>
|
||||
<field name="model">mailgate.message</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="maligate message">
|
||||
<field name="name" />
|
||||
<field name="date" />
|
||||
<field name="user_id" />
|
||||
<field name="history" />
|
||||
<field name="message_id" />
|
||||
<form string="mailgate message">
|
||||
<group colspan="4" col="6">
|
||||
<field name="name" required="1" select="1"/>
|
||||
<field name="date" required="1" select="1"/>
|
||||
<field name="user_id" string="Responsible" select="1"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page>
|
||||
<page string="Details">
|
||||
<group col="4" colspan="4">
|
||||
<separator string="Email Details" colspan="4"/>
|
||||
<field name="email_from" />
|
||||
<field name="email_to" />
|
||||
<field name="email_cc" />
|
||||
<field name="email_bcc" />
|
||||
<field name="message_id" />
|
||||
</group>
|
||||
<separator string="Description" colspan="4"/>
|
||||
<field name="description" nolabel="1" colspan="4" />
|
||||
</page>
|
||||
<page>
|
||||
<page string="Attachments">
|
||||
<separator string="Attachments" colspan="4"/>
|
||||
<field name="attachment_ids" nolabel="1" colspan="4" />
|
||||
<field name="attachment_ids" nolabel="1" colspan="4" readonly="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
|
@ -32,18 +35,33 @@
|
|||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_mailgate_message_tree">
|
||||
<field name="name">maligate.message.tree</field>
|
||||
<field name="model">maligate.message</field>
|
||||
<field name="name">mailgate.message.tree</field>
|
||||
<field name="model">mailgate.message</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Mailgateway Message">
|
||||
<field name="name" select="1" />
|
||||
<field name="date" />
|
||||
<field name="email_from" />
|
||||
<field name="user_id" />
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_mailgate_message_search">
|
||||
<field name="name">mailgate.message.search</field>
|
||||
<field name="model">mailgate.message</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Mailgateway Message Search">
|
||||
<field name="name" />
|
||||
<field name="date" />
|
||||
<field name="user_id" />
|
||||
<field name="message_id" />
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_mailgate_thread_form">
|
||||
<field name="name">mailgate.thread.form</field>
|
||||
<field name="model">mailgate.thread</field>
|
||||
|
@ -57,12 +75,11 @@
|
|||
<field name="name" select="1" />
|
||||
<field name="date" />
|
||||
</tree>
|
||||
<form string="Maligate Logs">
|
||||
<form string="Mailgate Logs">
|
||||
<field name="name" />
|
||||
<field name="date" />
|
||||
<field name="user_id" />
|
||||
<field name="message_id" />
|
||||
<field name="history" />
|
||||
<field name="message_id" />
|
||||
<notebook colspan="4">
|
||||
<page string="Email Details">
|
||||
<group col="4" colspan="4">
|
||||
|
@ -72,6 +89,8 @@
|
|||
<field name="email_cc" />
|
||||
<field name="email_bcc" />
|
||||
</group>
|
||||
<separator string="Description" colspan="4"/>
|
||||
<field name="description" nolabel="1" colspan="4" />
|
||||
</page>
|
||||
<page string="Attachments">
|
||||
<separator string="Attachments" colspan="4"/>
|
||||
|
@ -86,7 +105,7 @@
|
|||
<field name="name" select="1" />
|
||||
<field name="date" />
|
||||
</tree>
|
||||
<form string="Maligate Histories">
|
||||
<form string="Mailgate Histories">
|
||||
<field name="name" />
|
||||
<field name="date" />
|
||||
<field name="user_id" />
|
||||
|
@ -153,6 +172,12 @@
|
|||
<menuitem id="menu_mailgate_thread" name="Mailgateway Threads" action="action_view_mailgate_thread"
|
||||
parent="base.menu_crm_configuration" sequence="20"/>
|
||||
-->
|
||||
|
||||
<act_window domain="[('partner_id', '=', active_id), ('history', '=', True)]"
|
||||
id="act_res_partner_emails" name="Emails"
|
||||
res_model="mailgate.message"
|
||||
src_model="res.partner"
|
||||
view_id="view_mailgate_message_tree"
|
||||
/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -43,7 +43,6 @@
|
|||
<tree string="All Accounts">
|
||||
<field name="name"/>
|
||||
<field name="username" />
|
||||
<field name="password"/>
|
||||
<field name="data_center"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
|
@ -59,9 +58,9 @@
|
|||
<field name="name" select="1"/>
|
||||
<newline/>
|
||||
<field name="username" select="1"/>
|
||||
<field name="password" select="1"/>
|
||||
<field name="password" select="1" password="True"/>
|
||||
<field name="apikey" />
|
||||
<field name="data_center"/>
|
||||
<field name="data_center" required="1"/>
|
||||
<separator string="Status" colspan="4"/>
|
||||
<group col="13" colspan="4">
|
||||
<field name="state" nolabel="1"/>
|
||||
|
|
|
@ -446,9 +446,9 @@ class product_product(osv.osv):
|
|||
'outgoing_qty': fields.function(_product_outgoing_qty, method=True, type='float', string='Outgoing'),
|
||||
'price': fields.function(_product_price, method=True, type='float', string='Pricelist', digits_compute=dp.get_precision('Sale Price')),
|
||||
'lst_price' : fields.function(_product_lst_price, method=True, type='float', string='List Price', digits_compute=dp.get_precision('Sale Price')),
|
||||
'code': fields.function(_product_code, method=True, type='char', string='Code'),
|
||||
'code': fields.function(_product_code, method=True, type='char', string='Reference'),
|
||||
'partner_ref' : fields.function(_product_partner_ref, method=True, type='char', string='Customer ref'),
|
||||
'default_code' : fields.char('Code', size=64),
|
||||
'default_code' : fields.char('Reference', size=64),
|
||||
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the product without removing it."),
|
||||
'variants': fields.char('Variants', size=64),
|
||||
'product_tmpl_id': fields.many2one('product.template', 'Product Template', required=False),
|
||||
|
@ -676,7 +676,20 @@ class pricelist_partnerinfo(osv.osv):
|
|||
_order = 'min_quantity asc'
|
||||
pricelist_partnerinfo()
|
||||
|
||||
class res_users(osv.osv):
|
||||
_name = 'res.users'
|
||||
_inherit = 'res.users'
|
||||
|
||||
def create(self, cr, uid, data, context={}):
|
||||
user_id = super(res_users, self).create(cr, uid, data, context)
|
||||
data_obj = self.pool.get('ir.model.data')
|
||||
data_id = data_obj._get_id(cr, uid, 'product', 'ir_ui_view_sc_product0')
|
||||
view_id = data_obj.browse(cr, uid, data_id, context=context).res_id
|
||||
copy_id = self.pool.get('ir.ui.view_sc').copy(cr, uid, view_id, default = {
|
||||
'user_id': user_id}, context=context)
|
||||
return user_id
|
||||
|
||||
res_users()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -21,32 +21,27 @@
|
|||
<field name="category_id" ref="product_uom_categ_unit"/>
|
||||
<field name="name">PCE</field>
|
||||
<field name="factor">1.0</field>
|
||||
<field name="factor_inv_data">1.0</field>
|
||||
<field name="rounding">1.0</field>
|
||||
</record>
|
||||
<record id="product_uom_kgm" model="product.uom">
|
||||
<field name="category_id" ref="product_uom_categ_kgm"/>
|
||||
<field name="name">KGM</field>
|
||||
<field name="factor">1000.0</field>
|
||||
<field name="factor_inv_data">1.0</field>
|
||||
</record>
|
||||
<record id="uom_hour" model="product.uom">
|
||||
<field name="name">Hour</field>
|
||||
<field eval="uom_categ_wtime" name="category_id"/>
|
||||
<field name="factor">8.0</field>
|
||||
<field name="factor_inv_data">1.0</field>
|
||||
</record>
|
||||
<record id="uom_day" model="product.uom">
|
||||
<field name="name">Day</field>
|
||||
<field eval="uom_categ_wtime" name="category_id"/>
|
||||
<field name="factor">1.0</field>
|
||||
<field name="factor_inv_data">1.0</field>
|
||||
</record>
|
||||
<record id="product_uom_ton" model="product.uom">
|
||||
<field name="category_id" ref="product_uom_categ_kgm"/>
|
||||
<field name="name">TON</field>
|
||||
<field name="factor">1.0</field>
|
||||
<field name="factor_inv_data">1.0</field>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
|
|
|
@ -98,7 +98,7 @@
|
|||
|
||||
<group colspan="2" col="2" name="status">
|
||||
<separator string="Status" colspan="2"/>
|
||||
<field name="categ_id"/>
|
||||
<field name="categ_id" select="1" groups="base.group_extended"/>
|
||||
<field name="state"/>
|
||||
<field groups="base.group_extended" name="product_manager"/>
|
||||
</group>
|
||||
|
|
|
@ -114,20 +114,27 @@
|
|||
<field name="date"/>
|
||||
<field name="email_to"/>
|
||||
<field name="email_from"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<field name="description" colspan="4" nolabel="1"/>
|
||||
<button colspan="4"
|
||||
string="Reply to Last Email"
|
||||
name="%(crm.action_crm_send_mail)d"
|
||||
context="{'mail':'reply', 'model': 'project.issue'}"
|
||||
icon="gtk-undo" type="action" />
|
||||
</form>
|
||||
<tree string="Communication history">
|
||||
<field name="description"/>
|
||||
<field name="email_to"/>
|
||||
<field name="date"/>
|
||||
</tree>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Details">
|
||||
<field name="description" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Attachments">
|
||||
<field name="attachment_ids" colspan="4" readonly="1" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
<button colspan="4"
|
||||
string="Reply to Last Email"
|
||||
name="%(crm.action_crm_send_mail)d"
|
||||
context="{'mail':'reply', 'model': 'project.issue'}"
|
||||
icon="gtk-undo" type="action" />
|
||||
</form>
|
||||
<tree string="Communication history">
|
||||
<field name="date"/>
|
||||
<field name="email_from" />
|
||||
<field name="email_to"/>
|
||||
<field name="description"/>
|
||||
</tree>
|
||||
</field>
|
||||
<button colspan="4" string="Send New Email"
|
||||
name="%(crm.action_crm_send_mail)d"
|
||||
|
|
|
@ -261,12 +261,10 @@ class purchase_order(osv.osv):
|
|||
self.write(cr, uid, ids, {'state': 'approved', 'date_approve': time.strftime('%Y-%m-%d')})
|
||||
return True
|
||||
|
||||
#TODO: implement messages system
|
||||
def wkf_confirm_order(self, cr, uid, ids, context={}):
|
||||
todo = []
|
||||
for po in self.browse(cr, uid, ids):
|
||||
|
||||
if self.pool.get('res.partner.event.type').check(cr, uid, 'purchase_open'):
|
||||
self.pool.get('res.partner.event').create(cr, uid, {'name':'Purchase Order: '+po.name, 'partner_id':po.partner_id.id, 'date':time.strftime('%Y-%m-%d %H:%M:%S'), 'user_id':uid, 'partner_type':'retailer', 'probability': 1.0, 'planned_cost':po.amount_untaxed})
|
||||
for po in self.browse(cr, uid, ids):
|
||||
if not po.order_line:
|
||||
raise osv.except_osv(_('Error !'),_('You can not confirm purchase order without Purchase Order Lines.'))
|
||||
for line in po.order_line:
|
||||
|
|
|
@ -7,11 +7,6 @@
|
|||
<field name="object">purchase.order</field>
|
||||
</record>
|
||||
|
||||
<record id="event_type_purchase_open" model="res.partner.event.type">
|
||||
<field name="name">Purchase: Purchase Confirmation</field>
|
||||
<field name="key">purchase_open</field>
|
||||
</record>
|
||||
|
||||
<record id="pricelist_type_purchase" model="product.pricelist.type">
|
||||
<field name="name">Purchase Pricelist</field>
|
||||
<field name="key">purchase</field>
|
||||
|
|
|
@ -49,7 +49,6 @@ def _incoterm_get(self, cr, uid, context=None):
|
|||
cr.execute('select code, code||\', \'||name from stock_incoterms where active')
|
||||
return cr.fetchall()
|
||||
|
||||
|
||||
class sale_order(osv.osv):
|
||||
_name = "sale.order"
|
||||
_log_create = True
|
||||
|
|
|
@ -9,16 +9,6 @@
|
|||
<field name="object">sale.order</field>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
Partner event type
|
||||
-->
|
||||
<record id="event_type_sale_open" model="res.partner.event.type">
|
||||
<field name="name">SALE: Sale Confirmation</field>
|
||||
<field name="key">sale_open</field>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
<!--
|
||||
Resource: sale.shop
|
||||
-->
|
||||
|
|
|
@ -192,6 +192,7 @@
|
|||
<field name="amount_tax"/>
|
||||
<field name="amount_total"/>
|
||||
<button name="button_dummy" states="draft" string="Compute" type="object" icon="gtk-execute"/>
|
||||
<button name="%(action_view_sale_advance_payment_inv)d" string="Advance Invoice" type="action" icon="gtk-execute"/>
|
||||
</group>
|
||||
<group col="13" colspan="4">
|
||||
<field name="state"/>
|
||||
|
@ -384,6 +385,11 @@
|
|||
<field colspan="4" name="tax_id" domain="[('parent_id','=',False),('type_tax_use','<>','purchase')]" nolabel="1"/>
|
||||
<separator colspan="4" string="States"/>
|
||||
<field name="state"/>
|
||||
<button colspan="1"
|
||||
name="%(action_view_sale_order_line_make_invoice)d"
|
||||
string="Make Invoice"
|
||||
type="action"
|
||||
icon="gtk-print" />
|
||||
<group col="2" colspan="2">
|
||||
<button name="button_done"
|
||||
states="confirmed,exception"
|
||||
|
|
|
@ -14,13 +14,14 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<act_window name="Make Invoices"
|
||||
res_model="sale.order.line.make.invoice"
|
||||
src_model="sale.order.line"
|
||||
view_mode="form"
|
||||
target="new"
|
||||
key2="client_action_multi"
|
||||
id="action_view_sale_order_line_make_invoice"/>
|
||||
<record id="action_view_sale_order_line_make_invoice" model="ir.actions.act_window">
|
||||
<field name="name">Make Invoices</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sale.order.line.make.invoice</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<field name="inherit_id" ref="crm.crm_case_form_view_oppor"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="priority" position="after">
|
||||
<button string="Convert to Quote" icon="terp-sale" name="%(sale_crm_wizard)d" type="action"/>
|
||||
<button string="Create a Sale Order" icon="terp-sale" name="%(sale_crm_wizard)d" type="action"/>
|
||||
<label colspan="2" string=""/>
|
||||
</field>
|
||||
</field>
|
||||
|
|
|
@ -28,7 +28,7 @@ import pooler
|
|||
from tools.translate import _
|
||||
|
||||
sale_form = """<?xml version="1.0"?>
|
||||
<form string="Convert to Quote">
|
||||
<form string="Create a Sale Order">
|
||||
<field name="partner_id" required="True"/>
|
||||
<field name="shop_id" required="True"/>
|
||||
<field name="analytic_account"/>
|
||||
|
@ -135,10 +135,10 @@ class make_sale(wizard.interface):
|
|||
|
||||
if data['form']['close']:
|
||||
case_obj.case_close(cr, uid, data['ids'])
|
||||
|
||||
|
||||
if not new_ids:
|
||||
return {}
|
||||
|
||||
|
||||
if len(new_ids)<=1:
|
||||
value = {
|
||||
'domain': str([('id', 'in', new_ids)]),
|
||||
|
@ -159,7 +159,7 @@ class make_sale(wizard.interface):
|
|||
'type': 'ir.actions.act_window',
|
||||
'res_id':new_ids
|
||||
}
|
||||
|
||||
|
||||
return value
|
||||
|
||||
states = {
|
||||
|
|
|
@ -18,10 +18,8 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import sale_journal
|
||||
import sale_journal_inherit
|
||||
import sale_journal_report
|
||||
import sale_journal_picking_report
|
||||
import report
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
The sale journal modules allows you to categorise your
|
||||
sales and deliveries (picking lists) between different journals.
|
||||
This module is very helpful for bigger companies that
|
||||
work by departments.
|
||||
works by departments.
|
||||
|
||||
You can use journal for different purposes, some examples:
|
||||
* isolate sales of different departments
|
||||
|
@ -54,8 +54,7 @@
|
|||
'update_xml': [
|
||||
'security/ir.model.access.csv',
|
||||
'sale_journal_view.xml',
|
||||
'picking_journal_view.xml',
|
||||
'picking_journal_view_report.xml'
|
||||
'report/sale_journal_report_view.xml',
|
||||
],
|
||||
'demo_xml': ['sale_journal_demo.xml'],
|
||||
'installable': True,
|
||||
|
|
|
@ -1,110 +0,0 @@
|
|||
<openerp>
|
||||
<data>
|
||||
|
||||
<record model="ir.ui.view" id="view_picking_journal_form">
|
||||
<field name="name">sale_journal.picking.journal.form</field>
|
||||
<field name="model">sale_journal.picking.journal</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Picking Journal">
|
||||
<notebook>
|
||||
<page string="Journal">
|
||||
<separator string="Journal Information" colspan="4"/>
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="user_id"/>
|
||||
<field name="date"/>
|
||||
<field name="date_created"/>
|
||||
<field name="date_validation"/>
|
||||
<separator string="States" colspan="4"/>
|
||||
<field name="state"/>
|
||||
<group col="3" colspan="2">
|
||||
<button name="button_open" string="Open Journal" states="draft" type="object" icon="gtk-open"/>
|
||||
<button name="button_close" string="Close Journal" states="open" type="object" icon="gtk-close"/>
|
||||
<button name="button_draft" string="Set to Draft" states="close,open" type="object" icon="gtk-convert"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Picking">
|
||||
<button string="Cancel Picking" name="button_picking_cancel" states="draft,open" type="object" icon="gtk-cancel"/>
|
||||
<newline/>
|
||||
<field name="picking_stats_ids" colspan="4" nolabel="1"/>
|
||||
</page><page string="Notes">
|
||||
<field name="note" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_picking_journal_tree">
|
||||
<field name="name">sale_journal.picking.journal.tree</field>
|
||||
<field name="model">sale_journal.picking.journal</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Picking Journal">
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="user_id"/>
|
||||
<field name="date"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_picking_journal_search">
|
||||
<field name="name">sale_journal.picking.journal.search</field>
|
||||
<field name="model">sale_journal.picking.journal</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Picking Journal">
|
||||
<group col="8" colspan="4">
|
||||
<filter icon="terp-hr" string="Open" domain="[('state','=','open')]" help="Open Picking Journals"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="user_id" widget="selection"/>
|
||||
<field name="date"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.actions.act_window" id="action_definition_picking_journal">
|
||||
<field name="name">Picking journals</field>
|
||||
<field name="res_model">sale_journal.picking.journal</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="context">{"search_default_user_id":uid}</field>
|
||||
<field name="search_view_id" ref="view_picking_journal_search"/>
|
||||
</record>
|
||||
|
||||
<menuitem name="Picking Journals" id="menu_definition_journal_picking" parent="stock.menu_stock_configuration" action="action_definition_picking_journal"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_invoice_type_tree">
|
||||
<field name="name">Picking by invoice_method</field>
|
||||
<field name="name">sale_journal.invoice.type.tree</field>
|
||||
<field name="res_model">sale_journal.invoice.type</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="view_type">tree</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!--<menuitem name="Picking to Invoice" id="menu_definition_journal_picking_invoice" parent="stock.menu_action_picking_tree"/>-->
|
||||
<!--<menuitem name="Picking by Invoice Method" id="menu_definition_journal_picking_invoice_method" parent="menu_definition_journal_picking_invoice" action="action_invoice_type_tree"/>-->
|
||||
|
||||
<record model="ir.actions.act_window" id="action_invoice_type_picking_open">
|
||||
<field name="name">Picking to invoice</field>
|
||||
<field name="res_model">stock.picking</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">[('state','=','done'),('invoice_state','=','2binvoiced'),('invoice_type_id','=',active_id)]</field>
|
||||
</record>
|
||||
<record model="ir.values" id="ir_open_invoice_type">
|
||||
<field name="key2">tree_but_open</field>
|
||||
<field name="model">sale_journal.invoice.type</field>
|
||||
<field name="name">Picking to invoice</field>
|
||||
<field name="value" eval="'ir.actions.act_window,%d'%action_invoice_type_picking_open"/>
|
||||
<field name="object" eval="True"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
|
@ -1,151 +0,0 @@
|
|||
<openerp>
|
||||
<data>
|
||||
|
||||
#
|
||||
# Pickings by invoice type
|
||||
#
|
||||
|
||||
<record model="ir.ui.view" id="view_picking_invoice_type_stats_form">
|
||||
<field name="name">sale_journal.invoice.type.stats.form</field>
|
||||
<field name="model">sale_journal.invoice.type.stats</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Picking by invoice method">
|
||||
<field name="name"/>
|
||||
<field name="month"/>
|
||||
<field name="invoice_state"/>
|
||||
<field name="state"/>
|
||||
<field name="invoice_type_id"/>
|
||||
<field name="quantity"/>
|
||||
<field name="count"/>
|
||||
<field name="price_total"/>
|
||||
<field name="price_average"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_picking_invoice_type_stats_tree">
|
||||
<field name="name">sale_journal.invoice.type.stats.tree</field>
|
||||
<field name="model">sale_journal.invoice.type.stats</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Picking by invoice method">
|
||||
<field name="name"/>
|
||||
<field name="month"/>
|
||||
<field name="invoice_state"/>
|
||||
<field name="state"/>
|
||||
<field name="invoice_type_id"/>
|
||||
<field name="quantity"/>
|
||||
<field name="count"/>
|
||||
<field name="price_total"/>
|
||||
<field name="price_average"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_picking_invoice_type_stats_search">
|
||||
<field name="name">sale_journal.invoice.type.stats.search</field>
|
||||
<field name="model">sale_journal.invoice.type.stats</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Picking by invoice method">
|
||||
<group col="8" colspan="4">
|
||||
<filter icon="terp-sale" string="This Year" domain="[('name','=',time.strftime('%%Y'))]" help="Picking by invoice method in this year"/>
|
||||
<filter icon="terp-sale" string="This Month" domain="[('month','=',time.strftime('%%m'))]" help="Picking by invoice method in this month"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name"/>
|
||||
<field name="month"/>
|
||||
<field name="invoice_state"/>
|
||||
<field name="state"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.actions.act_window" id="action_invoice_type_picking_stats_open">
|
||||
<field name="name">Statistics on picking to invoice</field>
|
||||
<field name="res_model">sale_journal.invoice.type.stats</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">[('invoice_state','=','2binvoiced'),('invoice_type_id','=',active_id)]</field>
|
||||
</record>
|
||||
|
||||
<menuitem name="Picking Journal" id="menu_definition_journal_reporting" parent="stock.next_id_61"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_invoice_type_picking_stats_open_menu_all">
|
||||
<field name="name">Picking by invoice method</field>
|
||||
<field name="res_model">sale_journal.invoice.type.stats</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="search_view_id" ref="view_picking_invoice_type_stats_search"/>
|
||||
</record>
|
||||
|
||||
<menuitem name="Picking by Invoice Method" id="menu_invoice_type_picking_stats_open_all" parent="menu_definition_journal_reporting" action="action_invoice_type_picking_stats_open_menu_all"/>
|
||||
|
||||
#
|
||||
# Packing by journal
|
||||
#
|
||||
|
||||
<record model="ir.ui.view" id="view_picking_journal_stats_form">
|
||||
<field name="name">sale_journal.picking.stats.form</field>
|
||||
<field name="model">sale_journal.picking.stats</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Picking by journals">
|
||||
<field name="name"/>
|
||||
<field name="month"/>
|
||||
<field name="state"/>
|
||||
<field name="journal_id"/>
|
||||
<field name="quantity"/>
|
||||
<field name="count"/>
|
||||
<field name="price_total"/>
|
||||
<field name="price_average"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_picking_journal_stats_tree">
|
||||
<field name="name">sale_journal.picking.stats.tree</field>
|
||||
<field name="model">sale_journal.picking.stats</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Picking by journals">
|
||||
<field name="name"/>
|
||||
<field name="state"/>
|
||||
<field name="journal_id"/>
|
||||
<field name="quantity"/>
|
||||
<field name="count"/>
|
||||
<field name="price_total"/>
|
||||
<field name="price_average"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_picking_journal_stats_search">
|
||||
<field name="name">sale_journal.picking.stats.search</field>
|
||||
<field name="model">sale_journal.picking.stats</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Picking by journals">
|
||||
<group col="8" colspan="4">
|
||||
<filter icon="terp-sale" string="This Year" domain="[('name','=',time.strftime('%%Y'))]" help="Picking by journals in this year"/>
|
||||
<filter icon="terp-sale" string="This Month" domain="[('month','=',time.strftime('%%m'))]" help="Picking by journals in this month"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name"/>
|
||||
<field name="month"/>
|
||||
<field name="state"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_picking_picking_stats_open_menu_all">
|
||||
<field name="name">Picking by journal</field>
|
||||
<field name="res_model">sale_journal.picking.stats</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="search_view_id" ref="view_picking_journal_stats_search"/>
|
||||
</record>
|
||||
|
||||
<menuitem name="Picking by Journal" id="menu_picking_picking_stats_open_all" parent="menu_definition_journal_reporting" action="action_picking_picking_stats_open_menu_all"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
|
@ -0,0 +1,24 @@
|
|||
# -*- 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import sale_journal_report
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -0,0 +1,141 @@
|
|||
# -*- 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
|
||||
import tools
|
||||
|
||||
class sale_journal_report(osv.osv):
|
||||
_name = "sale.journal.report"
|
||||
_description = "Sales Orders by Journal"
|
||||
_auto = False
|
||||
_columns = {
|
||||
'name': fields.char('Year', size=64, required=False, readonly=True),
|
||||
'month':fields.selection([('01', 'January'), ('02', 'February'), ('03', 'March'), ('04', 'April'),
|
||||
('05', 'May'), ('06', 'June'), ('07', 'July'), ('08', 'August'), ('09', 'September'),
|
||||
('10', 'October'), ('11', 'November'), ('12', 'December')], 'Month', readonly=True),
|
||||
'state': fields.selection([
|
||||
('draft', 'Quotation'),
|
||||
('waiting_date', 'Waiting Schedule'),
|
||||
('manual', 'Manual in progress'),
|
||||
('progress', 'In progress'),
|
||||
('shipping_except', 'Shipping Exception'),
|
||||
('invoice_except', 'Invoice Exception'),
|
||||
('done', 'Done'),
|
||||
('cancel', 'Cancel')
|
||||
], 'Order State', readonly=True),
|
||||
'journal_id':fields.many2one('sale_journal.sale.journal', 'Journal', readonly=True),
|
||||
'quantity': fields.float('Quantities', readonly=True),
|
||||
'price_total': fields.float('Total Price', readonly=True),
|
||||
'price_average': fields.float('Average Price', readonly=True),
|
||||
'count': fields.integer('# of Lines', readonly=True),
|
||||
}
|
||||
|
||||
_order = 'journal_id, name desc,price_total desc'
|
||||
|
||||
def init(self, cr):
|
||||
tools.drop_view_if_exists(cr, 'sale_journal_report')
|
||||
cr.execute("""
|
||||
create or replace view sale_journal_report as (
|
||||
select
|
||||
min(l.id) as id,
|
||||
to_char(s.date_order, 'YYYY') as name,
|
||||
to_char(s.date_order,'MM') as month,
|
||||
s.state,
|
||||
s.journal_id,
|
||||
sum(l.product_uom_qty) as quantity,
|
||||
count(*),
|
||||
sum(l.product_uom_qty*l.price_unit) as price_total,
|
||||
(sum(l.product_uom_qty*l.price_unit)/sum(l.product_uom_qty))::decimal(16,2) as price_average
|
||||
from sale_order s
|
||||
right join sale_order_line l on (s.id=l.order_id)
|
||||
group by s.journal_id , to_char(s.date_order, 'YYYY'),to_char(s.date_order, 'MM'), s.state
|
||||
)
|
||||
""")
|
||||
|
||||
sale_journal_report()
|
||||
|
||||
#==========================================
|
||||
#picking report
|
||||
#==========================================
|
||||
|
||||
|
||||
class sale_journal_picking_report(osv.osv):
|
||||
"""
|
||||
Picking list by journal and by invoice
|
||||
"""
|
||||
_name = "sale.journal.picking.report"
|
||||
_description = "Picking lists"
|
||||
_auto = False
|
||||
_columns = {
|
||||
'name': fields.char('Year', size=64, required=False, readonly=True),
|
||||
'month':fields.selection([('01', 'January'), ('02', 'February'), ('03', 'March'), ('04', 'April'), ('05', 'May'), ('06', 'June'),
|
||||
('07', 'July'), ('08', 'August'), ('09', 'September'), ('10', 'October'), ('11', 'November'), ('12', 'December')], 'Month', readonly=True),
|
||||
|
||||
'invoice_state':fields.selection([
|
||||
("invoiced", "invoiced"),
|
||||
("2binvoiced", "to be invoiced"),
|
||||
("none", "None")
|
||||
], "Invoice state", readonly=True),
|
||||
'state': fields.selection([
|
||||
('draft', 'draft'),
|
||||
('auto', 'waiting'),
|
||||
('confirmed', 'confirmed'),
|
||||
('assigned', 'assigned'),
|
||||
('done', 'done'),
|
||||
('cancel', 'cancel'),
|
||||
], 'State', readonly=True),
|
||||
'invoice_type_id': fields.many2one('sale_journal.invoice.type', 'Invoicing method', readonly=True),
|
||||
'journal_id':fields.many2one('sale_journal.picking.journal', 'Journal', readonly=True),
|
||||
'quantity': fields.float('Quantities', readonly=True),
|
||||
'price_total': fields.float('Total Price', readonly=True),
|
||||
'price_average': fields.float('Average Price', readonly=True),
|
||||
'count': fields.integer('# of Lines', readonly=True),
|
||||
}
|
||||
_order = 'journal_id, name desc, price_total desc'
|
||||
|
||||
def init(self, cr):
|
||||
tools.drop_view_if_exists(cr, 'sale_journal_picking_report')
|
||||
|
||||
cr.execute("""
|
||||
create or replace view sale_journal_picking_report as (
|
||||
select
|
||||
min(l.id) as id,
|
||||
to_char(s.date, 'YYYY') as name,
|
||||
to_char(s.date, 'MM') as month,
|
||||
s.state,
|
||||
s.invoice_state,
|
||||
s.invoice_type_id,
|
||||
s.journal_id,
|
||||
sum(l.product_qty) as quantity,
|
||||
count(*) as count,
|
||||
sum(l.product_qty*ol.price_unit*(1.0-ol.discount/100.0)) as price_total,
|
||||
(sum(l.product_qty*ol.price_unit*(1.0-ol.discount/100.0))/sum(l.product_qty))::decimal(16,2) as price_average
|
||||
from stock_picking s
|
||||
right join stock_move l on (s.id=l.picking_id)
|
||||
left join sale_order_line ol on (l.sale_line_id=ol.id)
|
||||
group by s.journal_id, s.invoice_type_id, to_char(s.date, 'YYYY'),to_char(s.date, 'MM'),s.state, s.invoice_state
|
||||
order by s.invoice_type_id, s.invoice_state, s.state
|
||||
)
|
||||
""")
|
||||
|
||||
sale_journal_picking_report()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -0,0 +1,187 @@
|
|||
<openerp>
|
||||
<data>
|
||||
|
||||
<!-- Sales by journal's view -->
|
||||
|
||||
<record model="ir.ui.view" id="view_sale_journal_report_tree">
|
||||
<field name="name">sale.journal.report.tree</field>
|
||||
<field name="model">sale.journal.report</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Sales by Journal">
|
||||
<field name="name" invisible="1"/>
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="journal_id" invisible="1"/>
|
||||
<field name="quantity"/>
|
||||
<field name="count"/>
|
||||
<field name="price_average"/>
|
||||
<field name="price_total"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- sales journal graph view -->
|
||||
|
||||
<record id="view_sale_journal_graph" model="ir.ui.view">
|
||||
<field name="name">sale.journal.report.graph</field>
|
||||
<field name="model">sale.journal.report</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Sales journal Statistics" type="bar">
|
||||
<field name="journal_id"/>
|
||||
<field name="price_total"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- sales by journal search view -->
|
||||
|
||||
<record model="ir.ui.view" id="view_sale_journal_report_search">
|
||||
<field name="name">sale.journal.report.search</field>
|
||||
<field name="model">sale.journal.report</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Sales by Journal">
|
||||
<group col="8" colspan="4">
|
||||
<filter icon="terp-sale" string="This Year" domain="[('name','!=','')]" help="Sale journal in this year"/>
|
||||
<filter icon="terp-sale" string="This Month" domain="[('name','=',time.strftime('%%Y-%%m-01'))]" help="Sale journal in this month"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-sale"
|
||||
string="Quotations"
|
||||
domain="[('state','=','draft')]"/>
|
||||
<filter icon="terp-sale"
|
||||
string="Waiting Schedule"
|
||||
domain="[('state','=','waiting_date')]"/>
|
||||
<filter icon="terp-sale"
|
||||
string="In progress"
|
||||
domain="[('state','=','progress')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name" select="1"/>
|
||||
<field name="state" select="1"/>
|
||||
<field name="journal_id" widget="selection"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="4" col="12">
|
||||
<filter string="journal" name="journal" icon="terp-sale" context="{'group_by':'journal_id'}"/>
|
||||
<filter string="State" icon="terp-sale" context="{'group_by':'state'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Action of sales by journal view-->
|
||||
|
||||
<record model="ir.actions.act_window" id="action_sale_journal_report_open_menu_all">
|
||||
<field name="name">Sales by Journal</field>
|
||||
<field name="res_model">sale.journal.report</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,graph</field>
|
||||
<field name="search_view_id" ref="view_sale_journal_report_search"/>
|
||||
<field name="context">{'search_default_journal': 1,'group_by_no_leaf':1,'group_by':[]}</field>
|
||||
</record>
|
||||
|
||||
<menuitem name="Sales by Journal" id="menu_sale_journal_report_open_all" parent="base.next_id_64" action="action_sale_journal_report_open_menu_all"/>
|
||||
|
||||
<!-- picking by journal and invoice's tree view-->
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_sale_journal_picking_report_tree">
|
||||
<field name="name">sale.journal.picking.report.tree</field>
|
||||
<field name="model">sale.journal.picking.report</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Picking Journal">
|
||||
<field name="name" invisible="1"/>
|
||||
<field name="month" invisible="1"/>
|
||||
<field name="invoice_state" invisible="1"/>
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="invoice_type_id" invisible="1"/>
|
||||
<field name="journal_id" invisible="1"/>
|
||||
<field name="quantity" />
|
||||
<field name="count" />
|
||||
<field name="price_average"/>
|
||||
<field name="price_total"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- picking journal's graph view -->
|
||||
|
||||
<record id="view_sale_journal_picking_graph" model="ir.ui.view">
|
||||
<field name="name">sale.journal.picking.report.graph</field>
|
||||
<field name="model">sale.journal.picking.report</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Picking journal Statistics" type="bar">
|
||||
<field name="journal_id"/>
|
||||
<field name="invoice_type_id"/>
|
||||
<field name="price_total"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Picking journal search view -->
|
||||
|
||||
<record model="ir.ui.view" id="view_sale_journal_picking_report_search">
|
||||
<field name="name">sale.journal.picking.report.search</field>
|
||||
<field name="model">sale.journal.picking.report</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Picking journal">
|
||||
<group col="8" colspan="4">
|
||||
<filter icon="terp-sale" string="This Year" name="year" domain="[('name','=',time.strftime('%%Y'))]" help="Picking by invoice or by journal method in this year"/>
|
||||
<filter icon="terp-sale" string="This Month" name="month" domain="[('month','=',time.strftime('%%m'))]" help="Picking by invoice or by journal method in this month"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-stock"
|
||||
string="Draft"
|
||||
domain="[('state','=','draft')]"/>
|
||||
<filter icon="terp-stock"
|
||||
string="Pending"
|
||||
domain="[('state','=','waiting')]"/>
|
||||
<filter icon="terp-stock"
|
||||
string="Confirmed"
|
||||
domain="[('state','=','confirmed')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name" select="1"/>
|
||||
<field name="month" select="1"/>
|
||||
<field name="invoice_state" select="1"/>
|
||||
<field name="state" select="1"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="4" col="12">
|
||||
<filter string="Journal" icon="terp-stock" context="{'group_by':'journal_id'}"/>
|
||||
<filter string="Invoice" icon="terp-stock" context="{'group_by':'invoice_type_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Invoice state" icon="terp-stock" context="{'group_by':'invoice_state'}"/>
|
||||
<filter string="state" icon="terp-stock" context="{'group_by':'state'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_sale_journal_picking_report_open">
|
||||
<field name="name">Statistics on picking to invoice</field>
|
||||
<field name="res_model">sale.journal.picking.report</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">[('invoice_state','=','2binvoiced'),('invoice_type_id','=',active_id)]</field>
|
||||
</record>
|
||||
|
||||
<!-- Action for picking journal view -->
|
||||
|
||||
<record model="ir.actions.act_window" id="action_sale_journal_picking_report_open_menu_all">
|
||||
<field name="name">Picking Journal</field>
|
||||
<field name="res_model">sale.journal.picking.report</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,graph</field>
|
||||
<field name="search_view_id" ref="view_sale_journal_picking_report_search"/>
|
||||
<field name="context">{'search_default_month':1, 'group_by_no_leaf':1,'group_by':[]}</field>
|
||||
</record>
|
||||
|
||||
<menuitem name="Picking journal" id="menu_invoice_type_picking_stats_open_all" parent="stock.next_id_61" action="action_sale_journal_picking_report_open_menu_all"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
|
@ -25,7 +25,7 @@ import time
|
|||
|
||||
class sale_journal_invoice_type(osv.osv):
|
||||
_name = 'sale_journal.invoice.type'
|
||||
_description = 'Invoice Type'
|
||||
_description = 'Invoice Types'
|
||||
_columns = {
|
||||
'name': fields.char('Invoice Type', size=64, required=True),
|
||||
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the invoice type without removing it."),
|
||||
|
@ -48,12 +48,12 @@ class sale_journal(osv.osv):
|
|||
'date': fields.date('Journal date', required=True),
|
||||
'date_created': fields.date('Creation date', readonly=True, required=True),
|
||||
'date_validation': fields.date('Validation date', readonly=True),
|
||||
'sale_stats_ids': fields.one2many("sale_journal.sale.stats", "journal_id", 'Sale Stats', readonly=True),
|
||||
'sale_stats_ids': fields.one2many("sale.journal.report", "journal_id", 'Sale Stats', readonly=True),
|
||||
'state': fields.selection([
|
||||
('draft','Draft'),
|
||||
('open','Open'),
|
||||
('done','Done'),
|
||||
], 'State', required=True),
|
||||
], 'State', required=True, readonly=True),
|
||||
'note': fields.text('Note'),
|
||||
}
|
||||
_defaults = {
|
||||
|
@ -98,12 +98,12 @@ class picking_journal(osv.osv):
|
|||
'date': fields.date('Journal date', required=True),
|
||||
'date_created': fields.date('Creation date', readonly=True, required=True),
|
||||
'date_validation': fields.date('Validation date', readonly=True),
|
||||
'picking_stats_ids': fields.one2many("sale_journal.picking.stats", "journal_id", 'Journal Stats', readonly=True),
|
||||
'picking_stats_ids': fields.one2many("sale.journal.picking.report", "journal_id", 'Journal Stats', readonly=True),
|
||||
'state': fields.selection([
|
||||
('draft','Draft'),
|
||||
('open','Open'),
|
||||
('done','Done'),
|
||||
], 'Creation date', required=True),
|
||||
], 'Creation date', required=True, readonly=True),
|
||||
'note': fields.text('Note'),
|
||||
}
|
||||
_defaults = {
|
||||
|
@ -130,5 +130,55 @@ class picking_journal(osv.osv):
|
|||
return True
|
||||
picking_journal()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
#==============================================
|
||||
# sale journal inherit
|
||||
#==============================================
|
||||
|
||||
class res_partner(osv.osv):
|
||||
_inherit = 'res.partner'
|
||||
_columns = {
|
||||
'property_invoice_type': fields.property(
|
||||
'sale_journal.invoice.type',
|
||||
type='many2one',
|
||||
relation='sale_journal.invoice.type',
|
||||
string="Invoicing Method",
|
||||
method=True,
|
||||
view_load=True,
|
||||
group_name="Accounting Properties",
|
||||
help="The type of journal used for sales and picking."),
|
||||
}
|
||||
res_partner()
|
||||
|
||||
class picking(osv.osv):
|
||||
_inherit="stock.picking"
|
||||
_columns = {
|
||||
'journal_id': fields.many2one('sale_journal.picking.journal', 'Journal'),
|
||||
'sale_journal_id': fields.many2one('sale_journal.sale.journal', 'Sale Journal'),
|
||||
'invoice_type_id': fields.many2one('sale_journal.invoice.type', 'Invoice Type', readonly=True)
|
||||
}
|
||||
picking()
|
||||
|
||||
class sale(osv.osv):
|
||||
_inherit="sale.order"
|
||||
_columns = {
|
||||
'journal_id': fields.many2one('sale_journal.sale.journal', 'Journal'),
|
||||
'invoice_type_id': fields.many2one('sale_journal.invoice.type', 'Invoice Type')
|
||||
}
|
||||
def action_ship_create(self, cr, uid, ids, *args):
|
||||
result = super(sale, self).action_ship_create(cr, uid, ids, *args)
|
||||
for order in self.browse(cr, uid, ids, context={}):
|
||||
pids = [ x.id for x in order.picking_ids]
|
||||
self.pool.get('stock.picking').write(cr, uid, pids, {
|
||||
'invoice_type_id': order.invoice_type_id.id,
|
||||
'sale_journal_id': order.journal_id.id
|
||||
})
|
||||
return result
|
||||
|
||||
def onchange_partner_id(self, cr, uid, ids, part):
|
||||
result = super(sale, self).onchange_partner_id(cr, uid, ids, part)
|
||||
if part:
|
||||
itype = self.pool.get('res.partner').browse(cr, uid, part).property_invoice_type.id
|
||||
result['value']['invoice_type_id'] = itype
|
||||
return result
|
||||
sale()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -1,73 +0,0 @@
|
|||
# -*- 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 osv, fields
|
||||
|
||||
|
||||
class res_partner(osv.osv):
|
||||
_inherit = 'res.partner'
|
||||
_columns = {
|
||||
'property_invoice_type': fields.property(
|
||||
'sale_journal.invoice.type',
|
||||
type='many2one',
|
||||
relation='sale_journal.invoice.type',
|
||||
string="Invoicing Method",
|
||||
method=True,
|
||||
view_load=True,
|
||||
group_name="Accounting Properties",
|
||||
help="The type of journal used for sales and picking."),
|
||||
}
|
||||
res_partner()
|
||||
|
||||
class picking(osv.osv):
|
||||
_inherit="stock.picking"
|
||||
_columns = {
|
||||
'journal_id': fields.many2one('sale_journal.picking.journal', 'Journal'),
|
||||
'sale_journal_id': fields.many2one('sale_journal.sale.journal', 'Sale Journal'),
|
||||
'invoice_type_id': fields.many2one('sale_journal.invoice.type', 'Invoice Type', readonly=True)
|
||||
}
|
||||
picking()
|
||||
|
||||
class sale(osv.osv):
|
||||
_inherit="sale.order"
|
||||
_columns = {
|
||||
'journal_id': fields.many2one('sale_journal.sale.journal', 'Journal'),
|
||||
'invoice_type_id': fields.many2one('sale_journal.invoice.type', 'Invoice Type')
|
||||
}
|
||||
def action_ship_create(self, cr, uid, ids, *args):
|
||||
result = super(sale, self).action_ship_create(cr, uid, ids, *args)
|
||||
for order in self.browse(cr, uid, ids, context={}):
|
||||
pids = [ x.id for x in order.picking_ids]
|
||||
self.pool.get('stock.picking').write(cr, uid, pids, {
|
||||
'invoice_type_id': order.invoice_type_id.id,
|
||||
'sale_journal_id': order.journal_id.id
|
||||
})
|
||||
return result
|
||||
|
||||
def onchange_partner_id(self, cr, uid, ids, part):
|
||||
result = super(sale, self).onchange_partner_id(cr, uid, ids, part)
|
||||
if part:
|
||||
itype = self.pool.get('res.partner').browse(cr, uid, part).property_invoice_type.id
|
||||
result['value']['invoice_type_id'] = itype
|
||||
return result
|
||||
sale()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
@ -1,124 +0,0 @@
|
|||
# -*- 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
|
||||
import tools
|
||||
|
||||
class report_sale_journal_invoice_type_stats(osv.osv):
|
||||
_name = "sale_journal.invoice.type.stats"
|
||||
_description = "Stats on picking by invoice method"
|
||||
_auto = False
|
||||
_columns = {
|
||||
'name': fields.char('Year',size=64,required=False, readonly=True),
|
||||
'invoice_state':fields.selection([
|
||||
("invoiced","invoiced"),
|
||||
("2binvoiced","to be invoiced"),
|
||||
("none","None")
|
||||
], "Invoice state", readonly=True),
|
||||
'state': fields.selection([
|
||||
('draft','draft'),
|
||||
('auto','waiting'),
|
||||
('confirmed','confirmed'),
|
||||
('assigned','assigned'),
|
||||
('done','done'),
|
||||
('cancel','cancel'),
|
||||
], 'State', readonly=True),
|
||||
'invoice_type_id':fields.many2one('sale_journal.invoice.type', 'Invoicing method', readonly=True),
|
||||
'quantity': fields.float('Quantities', readonly=True),
|
||||
'price_total': fields.float('Total Price', readonly=True),
|
||||
'price_average': fields.float('Average Price', readonly=True),
|
||||
'count': fields.integer('# of Lines', readonly=True),
|
||||
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'),
|
||||
('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True),
|
||||
|
||||
}
|
||||
_order = 'state,invoice_state,name desc'
|
||||
def init(self, cr):
|
||||
tools.drop_view_if_exists(cr, 'sale_journal_invoice_type_stats')
|
||||
cr.execute("""
|
||||
create or replace view sale_journal_invoice_type_stats as (
|
||||
select
|
||||
min(l.id) as id,
|
||||
to_char(s.date, 'YYYY') as name,
|
||||
to_char(s.date, 'MM') as month,
|
||||
s.state,
|
||||
s.invoice_state,
|
||||
s.invoice_type_id,
|
||||
sum(l.product_qty) as quantity,
|
||||
count(*) as count,
|
||||
sum(l.product_qty*ol.price_unit*(1.0-ol.discount/100.0)) as price_total,
|
||||
(sum(l.product_qty*ol.price_unit*(1.0-ol.discount/100.0))/sum(l.product_qty))::decimal(16,2) as price_average
|
||||
from stock_picking s
|
||||
left join stock_move l on (s.id=l.picking_id)
|
||||
left join sale_order_line ol on (l.sale_line_id=ol.id)
|
||||
group by s.invoice_type_id, to_char(s.date, 'YYYY'),to_char(s.date, 'MM'),s.state, s.invoice_state
|
||||
order by s.invoice_type_id, s.invoice_state, s.state
|
||||
)
|
||||
""")
|
||||
report_sale_journal_invoice_type_stats()
|
||||
|
||||
class report_sale_journal_picking(osv.osv):
|
||||
_name = "sale_journal.picking.stats"
|
||||
_description = "Picking lists by Journal"
|
||||
_auto = False
|
||||
_columns = {
|
||||
'name': fields.char('Year',size=64,required=False, readonly=True),
|
||||
'state': fields.selection([
|
||||
('draft','draft'),
|
||||
('auto','waiting'),
|
||||
('confirmed','confirmed'),
|
||||
('assigned','assigned'),
|
||||
('done','done'),
|
||||
('cancel','cancel'),
|
||||
], 'State', readonly=True),
|
||||
'journal_id':fields.many2one('sale_journal.picking.journal', 'Journal', readonly=True),
|
||||
'quantity': fields.float('Quantities', readonly=True),
|
||||
'price_total': fields.float('Total Price', readonly=True),
|
||||
'price_average': fields.float('Average Price', readonly=True),
|
||||
'count': fields.integer('# of Lines', readonly=True),
|
||||
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'),
|
||||
('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True),
|
||||
|
||||
}
|
||||
_order = 'journal_id,name desc,price_total desc'
|
||||
def init(self, cr):
|
||||
tools.drop_view_if_exists(cr, 'sale_journal_picking_stats')
|
||||
cr.execute("""
|
||||
create or replace view sale_journal_picking_stats as (
|
||||
select
|
||||
min(l.id) as id,
|
||||
to_char(s.date, 'YYYY') as name,
|
||||
to_char(s.date, 'MM') as month,
|
||||
s.state,
|
||||
s.journal_id,
|
||||
sum(l.product_qty) as quantity,
|
||||
count(*) as count,
|
||||
sum(l.product_qty*ol.price_unit*(1.0-ol.discount/100.0)) as price_total,
|
||||
(sum(l.product_qty*ol.price_unit*(1.0-ol.discount/100.0))/sum(l.product_qty))::decimal(16,2) as price_average
|
||||
from stock_picking s
|
||||
right join stock_move l on (s.id=l.picking_id)
|
||||
right join sale_order_line ol on (l.sale_line_id=ol.id)
|
||||
group by s.journal_id, to_char(s.date, 'YYYY'),to_char(s.date, 'MM'),s.state
|
||||
)
|
||||
""")
|
||||
report_sale_journal_picking()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
@ -1,73 +0,0 @@
|
|||
# -*- 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
|
||||
import tools
|
||||
|
||||
class report_sale_journal_sale(osv.osv):
|
||||
_name = "sale_journal.sale.stats"
|
||||
_description = "Sales Orders by Journal"
|
||||
_auto = False
|
||||
_columns = {
|
||||
'name': fields.char('Year',size=64,required=False, readonly=True),
|
||||
'state': fields.selection([
|
||||
('draft','Quotation'),
|
||||
('waiting_date','Waiting Schedule'),
|
||||
('manual','Manual in progress'),
|
||||
('progress','In progress'),
|
||||
('shipping_except','Shipping Exception'),
|
||||
('invoice_except','Invoice Exception'),
|
||||
('done','Done'),
|
||||
('cancel','Cancel')
|
||||
], 'Order State', readonly=True),
|
||||
'journal_id':fields.many2one('sale_journal.sale.journal', 'Journal', readonly=True),
|
||||
'quantity': fields.float('Quantities', readonly=True),
|
||||
'price_total': fields.float('Total Price', readonly=True),
|
||||
'price_average': fields.float('Average Price', readonly=True),
|
||||
'count': fields.integer('# of Lines', readonly=True),
|
||||
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'),
|
||||
('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True),
|
||||
}
|
||||
_order = 'journal_id,name desc,price_total desc'
|
||||
def init(self, cr):
|
||||
tools.drop_view_if_exists(cr, 'sale_journal_sale_stats')
|
||||
cr.execute("""
|
||||
create or replace view sale_journal_sale_stats as (
|
||||
select
|
||||
min(l.id) as id,
|
||||
to_char(s.date_order, 'YYYY') as name,
|
||||
to_char(s.date_order,'MM') as month,
|
||||
s.state,
|
||||
s.journal_id,
|
||||
sum(l.product_uom_qty) as quantity,
|
||||
count(*),
|
||||
sum(l.product_uom_qty*l.price_unit) as price_total,
|
||||
(sum(l.product_uom_qty*l.price_unit)/sum(l.product_uom_qty))::decimal(16,2) as price_average
|
||||
from sale_order s
|
||||
right join sale_order_line l on (s.id=l.order_id)
|
||||
group by s.journal_id, to_char(s.date_order, 'YYYY'),to_char(s.date_order, 'MM'),s.state
|
||||
)
|
||||
""")
|
||||
report_sale_journal_sale()
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
@ -1,385 +1,469 @@
|
|||
<openerp>
|
||||
<data>
|
||||
<record model="ir.ui.view" id="view_sale_journal_invoice_type_form">
|
||||
<field name="name">sale_journal.invoice.type.form</field>
|
||||
<field name="model">sale_journal.invoice.type</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Invoice Type">
|
||||
<field name="name" select="1"/>
|
||||
<field name="active" select="1"/>
|
||||
<field name="invoicing_method" select="1"/>
|
||||
<newline/>
|
||||
<field name="note" colspan="4"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_sale_journal_invoice_type_tree">
|
||||
<field name="name">sale_journal.invoice.type.tree</field>
|
||||
<field name="model">sale_journal.invoice.type</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Invoice Type">
|
||||
<field name="name"/>
|
||||
<field name="invoicing_method"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.actions.act_window" id="action_definition_journal_invoice_type">
|
||||
<field name="res_model">sale_journal.invoice.type</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
<!-- <menuitem name="Invoicing Methods" id="menu_definition_journal_invoice_type" parent="sale.menu_shop_configuration" action="action_definition_journal_invoice_type"/>-->
|
||||
|
||||
<record model="ir.ui.view" id="view_sale_journal_form">
|
||||
<field name="name">sale_journal.sale.journal.form</field>
|
||||
<field name="model">sale_journal.sale.journal</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Sale Journal">
|
||||
<notebook>
|
||||
<page string="Journal">
|
||||
<separator string="Journal Information" colspan="4"/>
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="user_id"/>
|
||||
<field name="date"/>
|
||||
<field name="date_created"/>
|
||||
<field name="date_validation"/>
|
||||
<separator string="States" colspan="4"/>
|
||||
<field name="state"/>
|
||||
<group col="3" colspan="2">
|
||||
<button name="button_open" string="Open Journal" states="draft" type="object" icon="gtk-open"/>
|
||||
<button name="button_close" string="Close Journal" states="open" type="object" icon="gtk-close"/>
|
||||
<button name="button_draft" string="Set to Draft" states="close,open" type="object" icon="gtk-convert"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Sales">
|
||||
<button string="Confirm Sales" name="button_sale_confirm" states="draft,open" type="object" icon="gtk-execute"/>
|
||||
<button string="Cancel Sales" name="button_sale_cancel" states="draft,open" type="object" icon="gtk-cancel"/>
|
||||
<newline/>
|
||||
<field name="sale_stats_ids" colspan="4" nolabel="1">
|
||||
<tree string="Sales">
|
||||
<field name="name"/>
|
||||
<field name="quantity"/>
|
||||
<field name="price_total"/>
|
||||
<field name="price_average"/>
|
||||
<field name="count"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page><page string="Notes">
|
||||
<field name="note" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_sale_journal_tree">
|
||||
<field name="name">sale_journal.sale.journal.tree</field>
|
||||
<field name="model">sale_journal.sale.journal</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Sale Journal">
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="user_id"/>
|
||||
<field name="date"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_sale_journal_search">
|
||||
<field name="name">sale_journal.sale.journal.search</field>
|
||||
<field name="model">sale_journal.sale.journal</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Sales by Journal">
|
||||
<group col="8" colspan="4">
|
||||
<filter icon="terp-sale" string="Open" domain="[('state','=','open')]" help="Open Sale Journals"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="user_id"/>
|
||||
<field name="date" />
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_definition_journal">
|
||||
<field name="res_model">sale_journal.sale.journal</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="context">{"search_default_user_id":uid}</field>
|
||||
<field name="search_view_id" ref="view_sale_journal_search"/>
|
||||
</record>
|
||||
|
||||
<!-- <menuitem name="Sales Journals" id="menu_definition_journal" parent="sale.menu_shop_configuration" action="action_definition_journal"/>-->
|
||||
<menuitem id="menu_sale_journal" name="Journal" parent="base.menu_base_config" sequence="60" />
|
||||
<menuitem name="Sales Journals" id="menu_definition_journal" parent="menu_sale_journal" action="action_definition_journal"/>
|
||||
|
||||
<record model="ir.ui.view" id="sale_journal_sale_order">
|
||||
<field name="name">sale.order.journal.view.form</field>
|
||||
<field name="type">form</field>
|
||||
<field name="model">sale.order</field>
|
||||
<field name="inherit_id" ref="sale.view_order_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="invoiced" position="after">
|
||||
<field name="journal_id" select="1"/>
|
||||
<field name="invoice_type_id" select="1"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="sale_journal_sale_order_tree">
|
||||
<field name="name">sale.order.journal.view.tree</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="model">sale.order</field>
|
||||
<field name="inherit_id" ref="sale.view_order_tree" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="state" position="after">
|
||||
<field name="invoice_type_id"/>
|
||||
<field name="journal_id"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="sale_journal_picking_order">
|
||||
<field name="name">stock.picking.journal.view.form</field>
|
||||
<field name="type">form</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="origin" position="after">
|
||||
<field name="journal_id" select="1"/>
|
||||
<field name="sale_journal_id" select="1"/>
|
||||
<field name="invoice_type_id" select="1"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="sale_journal_picking_order_tree">
|
||||
<field name="name">stock.picking.journal.view.tree</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.vpicktree" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="invoice_state" position="after">
|
||||
<field name="journal_id" select="1"/>
|
||||
<field name="invoice_type_id" select="1"/>
|
||||
<field name="sale_journal_id" select="1"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="sale_journal_picking_order_del">
|
||||
<field name="name">stock.picking.journal.view.form</field>
|
||||
<field name="type">form</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_delivery_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="origin" position="after">
|
||||
<field name="journal_id" select="1"/>
|
||||
<field name="sale_journal_id" select="1"/>
|
||||
<field name="invoice_type_id" select="1"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="sale_journal_picking_order_tree_del">
|
||||
<field name="name">stock.picking.journal.view.tree</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_delivery_tree" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="origin" position="after">
|
||||
<field name="journal_id" select="1"/>
|
||||
<field name="invoice_type_id" select="1"/>
|
||||
<field name="sale_journal_id" select="1"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="sale_journal_picking_order_in">
|
||||
<field name="name">stock.picking.journal.view.form</field>
|
||||
<field name="type">form</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_in_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="origin" position="after">
|
||||
<field name="journal_id" select="1"/>
|
||||
<field name="sale_journal_id" select="1"/>
|
||||
<field name="invoice_type_id" select="1"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="sale_journal_picking_order_tree_in">
|
||||
<field name="name">stock.picking.journal.view.tree</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_in_tree" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="invoice_state" position="after">
|
||||
<field name="journal_id" select="1"/>
|
||||
<field name="invoice_type_id" select="1"/>
|
||||
<field name="sale_journal_id" select="1"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="sale_journal_picking_order_out">
|
||||
<field name="name">stock.picking.journal.view.form</field>
|
||||
<field name="type">form</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_out_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="origin" position="after">
|
||||
<field name="journal_id" select="1"/>
|
||||
<field name="sale_journal_id" select="1"/>
|
||||
<field name="invoice_type_id" select="1"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="sale_journal_picking_order_tree_out">
|
||||
<field name="name">stock.picking.journal.view.tree</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_out_tree" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="invoice_state" position="after">
|
||||
<field name="journal_id" select="1"/>
|
||||
<field name="invoice_type_id" select="1"/>
|
||||
<field name="sale_journal_id" select="1"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_sale_journal_sale_stats_tree">
|
||||
<field name="name">sale_journal.sale.stats.tree</field>
|
||||
<field name="model">sale_journal.sale.stats</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Sales by Journal">
|
||||
<field name="name"/>
|
||||
<field name="state"/>
|
||||
<field name="journal_id"/>
|
||||
<field name="quantity"/>
|
||||
<field name="count"/>
|
||||
<field name="price_total"/>
|
||||
<field name="price_average"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_sale_journal_sale_stats_form">
|
||||
<field name="name">sale_journal.sale.stats.form</field>
|
||||
<field name="model">sale_journal.sale.stats</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Sales by Journal">
|
||||
<field name="name"/>
|
||||
<field name="state"/>
|
||||
<field name="journal_id"/>
|
||||
<field name="quantity"/>
|
||||
<field name="count"/>
|
||||
<field name="price_total"/>
|
||||
<field name="price_average"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_sale_journal_sale_stats_search">
|
||||
<field name="name">sale_journal.sale.stats.search</field>
|
||||
<field name="model">sale_journal.sale.stats</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Sales by Journal">
|
||||
<group col="8" colspan="4">
|
||||
<filter icon="terp-sale" string="This Year" domain="[('name','!=','')]" help="Sale journal in this year"/>
|
||||
<filter icon="terp-sale" string="This Month" domain="[('name','=',time.strftime('%%Y-%%m-01'))]" help="Sale journal in this month"/>
|
||||
<separator orientation="vertical"/>
|
||||
<data>
|
||||
|
||||
<!-- sale journal invoice Type's Form view -->
|
||||
|
||||
<record model="ir.ui.view" id="view_sale_journal_invoice_type_form">
|
||||
<field name="name">sale_journal.invoice.type.form</field>
|
||||
<field name="model">sale_journal.invoice.type</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Invoice Type">
|
||||
<field name="name" select="1"/>
|
||||
<field name="active" select="1"/>
|
||||
<field name="invoicing_method" select="1"/>
|
||||
<newline/>
|
||||
<field name="note" colspan="4"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- sale journal invoice Type's tree view -->
|
||||
|
||||
<record model="ir.ui.view" id="view_sale_journal_invoice_type_tree">
|
||||
<field name="name">sale_journal.invoice.type.tree</field>
|
||||
<field name="model">sale_journal.invoice.type</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Invoice Type">
|
||||
<field name="name"/>
|
||||
<field name="invoicing_method"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Action for sale journal invoice Type -->
|
||||
|
||||
<record model="ir.actions.act_window" id="action_definition_journal_invoice_type">
|
||||
<field name="res_model">sale_journal.invoice.type</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
<!-- <menuitem name="Invoicing Methods" id="menu_definition_journal_invoice_type" parent="sale.menu_shop_configuration" action="action_definition_journal_invoice_type"/> -->
|
||||
|
||||
<!-- sale journal Form view -->
|
||||
|
||||
<record model="ir.ui.view" id="view_sale_journal_form">
|
||||
<field name="name">sale_journal.sale.journal.form</field>
|
||||
<field name="model">sale_journal.sale.journal</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Sales Journals">
|
||||
<group colspan="4" col="6">
|
||||
<field name="name" select="1"/>
|
||||
<field name="code" select="1"/>
|
||||
<field name="user_id" select="1"/>
|
||||
<field name="date" select="1"/>
|
||||
<field name="date_created" select="1"/>
|
||||
<field name="date_validation" select="1"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Sales">
|
||||
<field name="sale_stats_ids" colspan="4" nolabel="1">
|
||||
<tree string="Sales">
|
||||
<field name="name"/>
|
||||
<field name="quantity"/>
|
||||
<field name="price_total"/>
|
||||
<field name="price_average"/>
|
||||
<field name="count"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Notes">
|
||||
<field name="note" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
<field name="state"/>
|
||||
<group col="6" colspan="2">
|
||||
<button name="button_open" string="Open Journal" states="draft" type="object" icon="gtk-open"/>
|
||||
<button name="button_close" string="Close Journal" states="open" type="object" icon="gtk-close"/>
|
||||
<button name="button_draft" string="Set to Draft" states="close,open" type="object" icon="gtk-convert"/>
|
||||
<button string="Confirm Sales" name="button_sale_confirm" states="draft,open" type="object" icon="gtk-execute"/>
|
||||
<button string="Cancel Sales" name="button_sale_cancel" states="draft,open" type="object" icon="gtk-cancel"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Sale journal tree view -->
|
||||
|
||||
<record model="ir.ui.view" id="view_sale_journal_tree">
|
||||
<field name="name">sale_journal.sale.journal.tree</field>
|
||||
<field name="model">sale_journal.sale.journal</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Sales Journals">
|
||||
<field name="name" select="1"/>
|
||||
<field name="code" select="1"/>
|
||||
<field name="user_id" select="1"/>
|
||||
<field name="date" select="1"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Sale journal search view -->
|
||||
|
||||
<record model="ir.ui.view" id="view_sale_journal_search">
|
||||
<field name="name">sale_journal.sale.journal.search</field>
|
||||
<field name="model">sale_journal.sale.journal</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Sales by Journal">
|
||||
<group col="8" colspan="4">
|
||||
<filter icon="terp-sale" string="My Sale Journals" domain="[('user_id','=',uid)]" help="My Sale Journals"/>
|
||||
<filter icon="terp-sale" string="Open" domain="[('state','=','open')]" help="Open Sale Journals"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name" select="1"/>
|
||||
<field name="code" select="1"/>
|
||||
<field name="user_id" select="1"/>
|
||||
<field name="date" select="1"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Action for sale journal view -->
|
||||
|
||||
<record model="ir.actions.act_window" id="action_definition_journal">
|
||||
<field name="res_model">sale_journal.sale.journal</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="search_view_id" ref="view_sale_journal_search"/>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_definition_journal" name="Sales Journals" parent="base.menu_base_config" action="action_definition_journal" sequence="60" />
|
||||
|
||||
<!-- Inherit sales order form view -->
|
||||
|
||||
<record model="ir.ui.view" id="sale_journal_sale_order">
|
||||
<field name="name">sale.order.journal.view.form</field>
|
||||
<field name="type">form</field>
|
||||
<field name="model">sale.order</field>
|
||||
<field name="inherit_id" ref="sale.view_order_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="user_id" position="after">
|
||||
<separator string="Journal" colspan="4"/>
|
||||
<field name="journal_id" select="1" widget="selection"/>
|
||||
<field name="invoice_type_id" select="1" widget="selection"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Inherit sales order tree view-->
|
||||
|
||||
<record model="ir.ui.view" id="sale_journal_sale_order_tree">
|
||||
<field name="name">sale.order.journal.view.tree</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="model">sale.order</field>
|
||||
<field name="inherit_id" ref="sale.view_order_tree" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="state" position="after">
|
||||
<field name="invoice_type_id"/>
|
||||
<field name="journal_id"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_sale_sale_stats_open_menu_all">
|
||||
<field name="name">Sales by Journal</field>
|
||||
<field name="res_model">sale_journal.sale.stats</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="search_view_id" ref="view_sale_journal_sale_stats_search"/>
|
||||
</record>
|
||||
<!-- Inherit stock picking's form view -->
|
||||
|
||||
<record model="ir.ui.view" id="sale_journal_picking_order">
|
||||
<field name="name">stock.picking.journal.view.form</field>
|
||||
<field name="type">form</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="origin" position="after">
|
||||
<field name="journal_id" select="1"/>
|
||||
<field name="sale_journal_id" select="1"/>
|
||||
<field name="invoice_type_id" select="1"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<menuitem name="Reporting" id="menu_definition_report_sales" parent="base.menu_base_partner" sequence="8"/>
|
||||
<menuitem name="Sales by Journal" id="menu_sale_sale_stats_open_all" parent="menu_definition_report_sales" action="action_sale_sale_stats_open_menu_all"/>
|
||||
<!-- Inherit stock picking's tree view -->
|
||||
|
||||
<record model="ir.ui.view" id="sale_journal_picking_order_tree">
|
||||
<field name="name">stock.picking.journal.view.tree</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.vpicktree" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="origin" position="after">
|
||||
<field name="journal_id" select="1"/>
|
||||
<field name="invoice_type_id" select="1"/>
|
||||
<field name="sale_journal_id" select="1"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Inherit stock picking delivery's form view.-->
|
||||
|
||||
<record model="ir.ui.view" id="sale_journal_picking_order_del">
|
||||
<field name="name">stock.picking.journal.view.form</field>
|
||||
<field name="type">form</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_delivery_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="origin" position="after">
|
||||
<field name="journal_id" select="1"/>
|
||||
<field name="sale_journal_id" select="1"/>
|
||||
<field name="invoice_type_id" select="1"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Inherit stock picking delivery's tree view.-->
|
||||
|
||||
<record model="ir.ui.view" id="sale_journal_picking_order_tree_del">
|
||||
<field name="name">stock.picking.journal.view.tree</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_delivery_tree" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="origin" position="after">
|
||||
<field name="journal_id" select="1"/>
|
||||
<field name="invoice_type_id" select="1"/>
|
||||
<field name="sale_journal_id" select="1"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="sale_journal_picking_order_in">
|
||||
<field name="name">stock.picking.journal.view.form</field>
|
||||
<field name="type">form</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_in_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="origin" position="after">
|
||||
<field name="journal_id" select="1"/>
|
||||
<field name="sale_journal_id" select="1"/>
|
||||
<field name="invoice_type_id" select="1"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="sale_journal_picking_order_tree_in">
|
||||
<field name="name">stock.picking.journal.view.tree</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_in_tree" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="origin" position="after">
|
||||
<field name="journal_id" select="1"/>
|
||||
<field name="invoice_type_id" select="1"/>
|
||||
<field name="sale_journal_id" select="1"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="sale_journal_picking_order_out">
|
||||
<field name="name">stock.picking.journal.view.form</field>
|
||||
<field name="type">form</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_out_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="origin" position="after">
|
||||
<field name="journal_id" select="1"/>
|
||||
<field name="sale_journal_id" select="1"/>
|
||||
<field name="invoice_type_id" select="1"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="sale_journal_picking_order_tree_out">
|
||||
<field name="name">stock.picking.journal.view.tree</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_out_tree" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="origin" position="after">
|
||||
<field name="journal_id" select="1"/>
|
||||
<field name="invoice_type_id" select="1"/>
|
||||
<field name="sale_journal_id" select="1"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Action of sale journal report in sale journal -->
|
||||
|
||||
<act_window name="Monthly sales"
|
||||
domain="[('journal_id', '=', active_id)]"
|
||||
res_model="sale.journal.report"
|
||||
src_model="sale_journal.sale.journal"
|
||||
id="act_sale_journal_sale_journal_2_sale_journal_sale_stats"/>
|
||||
|
||||
<!-- Action of stock picking in picking journal -->
|
||||
|
||||
<act_window name="Assigned picking"
|
||||
domain="[('journal_id', '=', active_id),('state', '=', 'assigned')]"
|
||||
res_model="stock.picking"
|
||||
src_model="sale_journal.picking.journal"
|
||||
id="act_sale_journal_picking_journal_2_stock_picking_assigned"/>
|
||||
|
||||
<!-- Action of stock picking in picking journal -->
|
||||
|
||||
<act_window name="Confirmed picking"
|
||||
domain="[('journal_id', '=', active_id),('state', '=', 'confirmed')]"
|
||||
res_model="stock.picking"
|
||||
src_model="sale_journal.picking.journal"
|
||||
id="act_sale_journal_picking_journal_2_stock_picking_confirmed"/>
|
||||
|
||||
<!-- Action of stock picking in sale journal -->
|
||||
|
||||
<act_window name="Assigned picking"
|
||||
domain="[('sale_journal_id', '=', active_id),('state', '=', 'assigned')]"
|
||||
res_model="stock.picking"
|
||||
src_model="sale_journal.sale.journal"
|
||||
id="act_sale_journal_sale_journal_2_stock_picking_assigned"/>
|
||||
|
||||
<act_window name="Monthly sales"
|
||||
domain="[('journal_id', '=', active_id)]"
|
||||
res_model="sale_journal.sale.stats"
|
||||
src_model="sale_journal.sale.journal"
|
||||
id="act_sale_journal_sale_journal_2_sale_journal_sale_stats"/>
|
||||
<!-- Action of stock picking in sale journal -->
|
||||
|
||||
<act_window name="Assigned picking"
|
||||
domain="[('journal_id', '=', active_id),('state', '=', 'assigned')]"
|
||||
res_model="stock.picking"
|
||||
src_model="sale_journal.picking.journal"
|
||||
id="act_sale_journal_picking_journal_2_stock_picking_assigned"/>
|
||||
<act_window name="Confirmed picking"
|
||||
domain="[('sale_journal_id', '=', active_id),('state', '=', 'confirmed')]"
|
||||
res_model="stock.picking"
|
||||
src_model="sale_journal.sale.journal"
|
||||
id="act_sale_journal_sale_journal_2_stock_picking_confirmed"/>
|
||||
|
||||
<act_window name="Confirmed picking"
|
||||
domain="[('journal_id', '=', active_id),('state', '=', 'confirmed')]"
|
||||
res_model="stock.picking"
|
||||
src_model="sale_journal.picking.journal"
|
||||
id="act_sale_journal_picking_journal_2_stock_picking_confirmed"/>
|
||||
<!-- Action of sale order in sale journal -->
|
||||
|
||||
<act_window name="Draft sales"
|
||||
domain="[('journal_id', '=', active_id),('state', '=', 'draft')]"
|
||||
res_model="sale.order"
|
||||
src_model="sale_journal.sale.journal"
|
||||
id="act_sale_journal_sale_journal_2_sale_order_draft"/>
|
||||
|
||||
<!-- Action of sale order in sale journal -->
|
||||
|
||||
<act_window name="Approved sales"
|
||||
domain="[('journal_id', '=', active_id),('state', '=', 'approved')]"
|
||||
res_model="sale.order"
|
||||
src_model="sale_journal.sale.journal"
|
||||
id="act_sale_journal_sale_journal_2_sale_order_approved"/>
|
||||
|
||||
<record id="view_partner_property_form" model="ir.ui.view">
|
||||
<field name="name">res.partner.journal.property.form.inherit</field>
|
||||
<field name="model">res.partner</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="base.view_partner_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<page string="Sales & Purchases" position="inside">
|
||||
<field name="property_invoice_type"/>
|
||||
</page>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!--=====================================================-->
|
||||
<!-- picking journal view-->
|
||||
<!--===================================================== -->
|
||||
|
||||
<record model="ir.ui.view" id="view_picking_journal_form">
|
||||
<field name="name">sale_journal.picking.journal.form</field>
|
||||
<field name="model">sale_journal.picking.journal</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Picking Journal">
|
||||
<group colspan="4" col="6">
|
||||
<field name="name" select="1"/>
|
||||
<field name="code" select="1"/>
|
||||
<field name="user_id" select="1"/>
|
||||
<newline/>
|
||||
<field name="date" select="1"/>
|
||||
<field name="date_created" select="1"/>
|
||||
<field name="date_validation" select="1"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Picking">
|
||||
<field name="picking_stats_ids" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Notes">
|
||||
<field name="note" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
<field name="state"/>
|
||||
<group col="6" colspan="2">
|
||||
<button name="button_open" string="Open Journal" states="draft" type="object" icon="gtk-open"/>
|
||||
<button name="button_close" string="Close Journal" states="open" type="object" icon="gtk-close"/>
|
||||
<button name="button_draft" string="Set to Draft" states="close,open" type="object" icon="gtk-convert"/>
|
||||
<button string="Cancel Picking" name="button_picking_cancel" states="draft,open" type="object" icon="gtk-cancel"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_picking_journal_tree">
|
||||
<field name="name">sale_journal.picking.journal.tree</field>
|
||||
<field name="model">sale_journal.picking.journal</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Picking Journal">
|
||||
<field name="name" select="1"/>
|
||||
<field name="code" select="1"/>
|
||||
<field name="user_id" select="1"/>
|
||||
<field name="date" select="1"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<act_window name="Assigned picking"
|
||||
domain="[('sale_journal_id', '=', active_id),('state', '=', 'assigned')]"
|
||||
res_model="stock.picking"
|
||||
src_model="sale_journal.sale.journal"
|
||||
id="act_sale_journal_sale_journal_2_stock_picking_assigned"/>
|
||||
<!-- Picking journal tree view -->
|
||||
|
||||
<record model="ir.ui.view" id="view_picking_journal_search">
|
||||
<field name="name">sale_journal.picking.journal.search</field>
|
||||
<field name="model">sale_journal.picking.journal</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Picking Journals">
|
||||
<group col="8" colspan="4">
|
||||
<filter icon="terp-hr" string="My Picking Journals" domain="[('user_id','=',uid)]" help="My Picking Journals"/>
|
||||
<filter icon="terp-hr" string="Open" domain="[('state','=','open')]" help="Open Picking Journals"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name" select="1"/>
|
||||
<field name="code" select="1"/>
|
||||
<field name="user_id" select="1" widget="selection"/>
|
||||
<field name="date" select="1"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Action of Picking journals -->
|
||||
|
||||
<record model="ir.actions.act_window" id="action_definition_picking_journal">
|
||||
<field name="name">Picking Journals</field>
|
||||
<field name="res_model">sale_journal.picking.journal</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="search_view_id" ref="view_picking_journal_search"/>
|
||||
</record>
|
||||
|
||||
<menuitem name="Picking Journals" id="menu_definition_journal_picking" parent="stock.menu_stock_configuration" action="action_definition_picking_journal"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_invoice_type_tree">
|
||||
<field name="name">Picking by invoice_method</field>
|
||||
<field name="res_model">sale_journal.invoice.type</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="view_type">tree</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_invoice_type_picking_open">
|
||||
<field name="name">Picking to invoice</field>
|
||||
<field name="res_model">stock.picking</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">[('state','=','done'),('invoice_state','=','2binvoiced'),('invoice_type_id','=',active_id)]</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.values" id="ir_open_invoice_type">
|
||||
<field name="key2">tree_but_open</field>
|
||||
<field name="model">sale_journal.invoice.type</field>
|
||||
<field name="name">Picking to invoice</field>
|
||||
<field name="value" eval="'ir.actions.act_window,%d'%action_invoice_type_picking_open"/>
|
||||
<field name="object" eval="True"/>
|
||||
</record>
|
||||
|
||||
<act_window name="Confirmed picking"
|
||||
domain="[('sale_journal_id', '=', active_id),('state', '=', 'confirmed')]"
|
||||
res_model="stock.picking"
|
||||
src_model="sale_journal.sale.journal"
|
||||
id="act_sale_journal_sale_journal_2_stock_picking_confirmed"/>
|
||||
|
||||
<act_window name="Draft sales"
|
||||
domain="[('journal_id', '=', active_id),('state', '=', 'draft')]"
|
||||
res_model="sale.order"
|
||||
src_model="sale_journal.sale.journal"
|
||||
id="act_sale_journal_sale_journal_2_sale_order_draft"/>
|
||||
|
||||
<act_window name="Approved sales"
|
||||
domain="[('journal_id', '=', active_id),('state', '=', 'approved')]"
|
||||
res_model="sale.order"
|
||||
src_model="sale_journal.sale.journal"
|
||||
id="act_sale_journal_sale_journal_2_sale_order_approved"/>
|
||||
|
||||
<record id="view_partner_property_form" model="ir.ui.view">
|
||||
<field name="name">res.partner.journal.property.form.inherit</field>
|
||||
<field name="model">res.partner</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="base.view_partner_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<page string="Sales & Purchases" position="inside">
|
||||
<field name="property_invoice_type"/>
|
||||
</page>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -1,12 +1,7 @@
|
|||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_sale_journal_invoice_type_stats","sale_journal.invoice.type.stats","model_sale_journal_invoice_type_stats","sale.group_sale_user",1,0,0,0
|
||||
"access_sale_journal_picking_stats","sale_journal.picking.stats","model_sale_journal_picking_stats","sale.group_sale_user",1,0,0,0
|
||||
"access_sale_journal_invoice_type","sale_journal.invoice.type","model_sale_journal_invoice_type","sale.group_sale_user",1,0,0,0
|
||||
"access_sale_journal_invoice_type_finance_invoice","sale_journal.invoice.type invoice","model_sale_journal_invoice_type","account.group_account_invoice",1,0,0,0
|
||||
"access_sale_journal_invoice_type_partner_manager","sale_journal.invoice.type partner manager","model_sale_journal_invoice_type","base.group_partner_manager",1,0,0,0
|
||||
"access_sale_journal_sale_journal","sale_journal.sale.journal","model_sale_journal_sale_journal","sale.group_sale_user",1,0,0,0
|
||||
"access_sale_journal_picking_journal","sale_journal.picking.journal","model_sale_journal_picking_journal","sale.group_sale_user",1,0,0,0
|
||||
"access_sale_journal_sale_stats","sale_journal.sale.stats","model_sale_journal_sale_stats","sale.group_sale_user",1,0,0,0
|
||||
"access_sale_journal_invoice_type_manager","sale_journal.invoice.type.manager","model_sale_journal_invoice_type","sale.group_sale_manager",1,1,1,1
|
||||
"access_sale_journal_sale_journal_manager","sale_journal.sale.journal.manager","model_sale_journal_sale_journal","sale.group_sale_manager",1,1,1,1
|
||||
"access_sale_journal_picking_journal_manager","sale_journal.picking.journal.manager","model_sale_journal_picking_journal","sale.group_sale_manager",1,1,1,1
|
||||
|
|
|
|
@ -588,6 +588,7 @@
|
|||
<field name="origin"/>
|
||||
<field name="date"/>
|
||||
<field name="min_date"/>
|
||||
<field name="invoice_state"/>
|
||||
<field name="state"/>
|
||||
<button name="%(action_partial_picking)d" states="assigned" string="Validate" type="action" icon="gtk-go-forward" help="Validate Picking"/>
|
||||
<button name="button_cancel" states="assigned,confirmed,draft" string="Cancel" icon="gtk-cancel" help="Cancel" confirm="This operation will cancel the picking. Do you want to continue?"/>
|
||||
|
|
|
@ -207,7 +207,7 @@ class survey_browse_response(report_rml):
|
|||
<td><para style="terp_tblheader_General_Centre_simple">""" + to_xml(time.strftime('%d-%m-%Y %I:%M:%S %p', time.strptime(response.date_create.split('.')[0], '%Y-%m-%d %H:%M:%S'))) + """</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre"></para></td>
|
||||
<td><para style="terp_tblheader_General_right">Answer By:- </para></td>
|
||||
<td><para style="terp_tblheader_General_right_simple">""" + to_xml(response.user_id.login) + """</para></td>
|
||||
<td><para style="terp_tblheader_General_right_simple">""" + to_xml(response.user_id.login or '') + """</para></td>
|
||||
</tr>
|
||||
</blockTable><para style="P2"></para>"""
|
||||
|
||||
|
|
|
@ -149,11 +149,10 @@ class survey_form(report_rml):
|
|||
<story>"""
|
||||
surv_obj = pooler.get_pool(cr.dbname).get('survey')
|
||||
for survey in surv_obj.browse(cr,uid,ids):
|
||||
if datas.has_key('form') and datas['form']['survey_title']:
|
||||
rml += """
|
||||
<blockTable colWidths='"""+_tbl_widths+"""' style="title_tbl">
|
||||
<tr><td><para style="title">""" + to_xml(tools.ustr(survey.title)) + """</para><para style="P2"><font></font></para></td></tr>
|
||||
</blockTable>"""
|
||||
rml += """
|
||||
<blockTable colWidths='"""+_tbl_widths+"""' style="title_tbl">
|
||||
<tr><td><para style="title">""" + to_xml(tools.ustr(survey.title)) + """</para><para style="P2"><font></font></para></td></tr>
|
||||
</blockTable>"""
|
||||
if survey.note:
|
||||
rml += """
|
||||
<para style="P2"></para>
|
||||
|
|
|
@ -225,7 +225,7 @@ class survey_question(osv.osv):
|
|||
'page_id': fields.many2one('survey.page', 'Survey Page', ondelete='cascade', required=1),
|
||||
'question': fields.char('Question', size=128, required=1),
|
||||
'answer_choice_ids': fields.one2many('survey.answer', 'question_id', 'Answer'),
|
||||
'is_require_answer': fields.boolean('Require Answer to Question (optional)'),
|
||||
'is_require_answer': fields.boolean('Require Answer to Question'),
|
||||
'required_type': fields.selection([('all','All'), ('at least','At Least'), ('at most','At Most'), ('exactly','Exactly'), ('a range','A Range')], 'Respondent must answer'),
|
||||
'req_ans': fields.integer('#Required Answer'),
|
||||
'maximum_req_ans': fields.integer('Maximum Required Answer'),
|
||||
|
@ -250,7 +250,7 @@ class survey_question(osv.osv):
|
|||
('date_and_time','Date and Time'),('descriptive_text','Descriptive Text'),
|
||||
('table','Table'),
|
||||
], 'Question Type', required=1,),
|
||||
'is_comment_require': fields.boolean('Add Comment Field (optional)'),
|
||||
'is_comment_require': fields.boolean('Add Comment Field'),
|
||||
'comment_label': fields.char('Field Label', size = 255),
|
||||
'comment_field_type': fields.selection([('char', 'Single Line Of Text'), ('text', 'Paragraph of Text')], 'Comment Field Type'),
|
||||
'comment_valid_type': fields.selection([('do_not_validate', '''Don't Validate Comment Text.'''),
|
||||
|
@ -269,7 +269,7 @@ class survey_question(osv.osv):
|
|||
'comment_valid_err_msg': fields.text('Error message'),
|
||||
'make_comment_field': fields.boolean('Make Comment Field an Answer Choice'),
|
||||
'make_comment_field_err_msg': fields.text('Error message'),
|
||||
'is_validation_require': fields.boolean('Validate Text (optional)'),
|
||||
'is_validation_require': fields.boolean('Validate Text'),
|
||||
'validation_type': fields.selection([('do_not_validate', '''Don't Validate Comment Text.'''),\
|
||||
('must_be_specific_length', 'Must Be Specific Length'),\
|
||||
('must_be_whole_number', 'Must Be A Whole Number'),\
|
||||
|
@ -609,7 +609,7 @@ class survey_response(osv.osv):
|
|||
reads = self.read(cr, uid, ids, ['user_id','date_create'], context)
|
||||
res = []
|
||||
for record in reads:
|
||||
name = record['user_id'][1] + ' (' + record['date_create'].split('.')[0] + ')'
|
||||
name = (record['user_id'] and record['user_id'][1] or '' )+ ' (' + record['date_create'].split('.')[0] + ')'
|
||||
res.append((record['id'], name))
|
||||
return res
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
<field name="state">open</field>
|
||||
<field name="tot_comp_survey">1</field>
|
||||
<field name="tot_start_survey">1</field>
|
||||
<field name="response_user">5</field>
|
||||
</record>
|
||||
|
||||
<record id="survey_page_who_are_you" model="survey.page">
|
||||
|
@ -498,6 +499,7 @@
|
|||
<field name="state">open</field>
|
||||
<field name="tot_comp_survey">1</field>
|
||||
<field name="tot_start_survey">1</field>
|
||||
<field name="response_user">5</field>
|
||||
</record>
|
||||
|
||||
<record id="survey_page_odoo_who_are_you" model="survey.page">
|
||||
|
@ -1286,6 +1288,7 @@
|
|||
<field name="responsible_id" ref="base.user_demo"/>
|
||||
<field name="max_response_limit">20</field>
|
||||
<field name="type" ref="survey_type2"/>
|
||||
<field name="response_user">5</field>
|
||||
</record>
|
||||
</data>
|
||||
<data>
|
||||
|
@ -2163,6 +2166,8 @@
|
|||
<field eval="1" name="send_response"/>
|
||||
<field eval="[(6,0,[])]" name="users"/>
|
||||
<field name="type" ref="survey_type3"/>
|
||||
<field name="response_user">5</field>
|
||||
<field name="max_response_limit">20</field>
|
||||
</record>
|
||||
</data>
|
||||
<data>
|
||||
|
|
|
@ -6,8 +6,7 @@
|
|||
id="report_survey_form"
|
||||
model="survey"
|
||||
name="survey.form"
|
||||
menu="False"
|
||||
string="Survey Form"/>
|
||||
string="Print Survey"/>
|
||||
|
||||
<report auto="True"
|
||||
id="survey_analysis"
|
||||
|
|
|
@ -478,7 +478,7 @@
|
|||
<field name="note" colspan="4" nolabel="1"/>
|
||||
<group colspan="4">
|
||||
<label string="" colspan="3"/>
|
||||
<button name="survey_save" string="Ok" type="object" icon="gtk-go-back"/>
|
||||
<button name="survey_save" string="Ok" type="object" icon="gtk-go-forward"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
|
@ -805,7 +805,7 @@
|
|||
</notebook>
|
||||
<group colspan="4">
|
||||
<label string="" colspan="3"/>
|
||||
<button name="survey_save" string="Ok" type="object" icon="gtk-ok"/>
|
||||
<button name="survey_save" string="Ok" type="object" icon="gtk-go-forward"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
|
@ -1156,11 +1156,11 @@
|
|||
res_model="survey.answer"
|
||||
src_model="survey.question"/>
|
||||
|
||||
<act_window domain="[('survey_id', '=', active_id)]"
|
||||
<!--act_window domain="[('survey_id', '=', active_id)]"
|
||||
id="act_survey_response"
|
||||
name="Survey Answer"
|
||||
res_model="survey.response"
|
||||
src_model="survey"/>
|
||||
src_model="survey"/-->
|
||||
|
||||
<menuitem name="Answer a Survey" id="menu_run_survey_form" sequence="2"
|
||||
action="action_view_survey_name" parent="menu_answer_surveys"
|
||||
|
|
|
@ -46,7 +46,7 @@ class survey_browse_answer(osv.osv_memory):
|
|||
|
||||
_columns = {
|
||||
'survey_id': fields.selection(_get_survey, "Survey", required="1"),
|
||||
'response_id': fields.many2one("survey.response", "Survey Answer"),
|
||||
'response_id': fields.many2one("survey.response", "Survey Answer", help="If you want to print all answer of selected survey then don't select survey answer and if you select survey answer then print only selected survey answer."),
|
||||
}
|
||||
|
||||
def action_next(self, cr, uid, ids, context=None):
|
||||
|
|
|
@ -28,11 +28,12 @@ from tools.translate import _
|
|||
class survey_print(osv.osv_memory):
|
||||
_name = 'survey.print'
|
||||
_columns = {
|
||||
'survey_ids': fields.many2many('survey','survey_print',\
|
||||
'survey_id','print_id', "Survey", required="1"),
|
||||
'orientation' : fields.selection([('vertical','Portrait(Vertical)'),\
|
||||
('horizontal','Landscape(Horizontal)')], 'Orientation'),
|
||||
'paper_size' : fields.selection([('letter','Letter (8.5" x 11")'),\
|
||||
('legal','Legal (8.5" x 14")'),('a4','A4 (210mm x 297mm)')], 'Paper Size'),
|
||||
'survey_title' : fields.boolean('Include Survey Title'),
|
||||
'page_number' : fields.boolean('Include Page Numvers'),
|
||||
'without_pagebreak' : fields.boolean('Print Without Page Breaks'),
|
||||
}
|
||||
|
@ -40,7 +41,6 @@ class survey_print(osv.osv_memory):
|
|||
_defaults = {
|
||||
'orientation': lambda *a:'vertical',
|
||||
'paper_size': lambda *a:'letter',
|
||||
'survey_title':lambda *a: 0,
|
||||
'page_number':lambda *a: 0,
|
||||
'without_pagebreak':lambda *a: 0
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ class survey_print(osv.osv_memory):
|
|||
@return : Dictionary value for print survey form.
|
||||
"""
|
||||
|
||||
datas = {'ids' : context.get('active_ids', [])}
|
||||
datas = {'ids' : self.read(cr, uid, ids, [], context)[0]['survey_ids']}
|
||||
res = self.read(cr, uid, ids, ['survey_title', 'orientation', 'paper_size',\
|
||||
'page_number', 'without_pagebreak'], context)
|
||||
res = res and res[0] or {}
|
||||
|
|
|
@ -10,10 +10,11 @@
|
|||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Survey Print">
|
||||
<separator string="Survey" colspan="4"/>
|
||||
<field name="survey_ids" nolabel="1" colspan="4" />
|
||||
<separator string="Print Option" colspan="4"/>
|
||||
<field name="orientation" colspan="4"/>
|
||||
<field name="paper_size" colspan="4"/>
|
||||
<field name="survey_title" colspan="4"/>
|
||||
<field name="page_number" colspan="4"/>
|
||||
<field name="without_pagebreak" colspan="4"/>
|
||||
<separator colspan="4" />
|
||||
|
@ -34,10 +35,9 @@
|
|||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<act_window id="action_act_view_survey_print"
|
||||
key2="client_action_multi" name="Print Survey"
|
||||
res_model="survey.print" src_model="survey"
|
||||
view_mode="form" target="new" view_type="form" />
|
||||
<menuitem name="Print Survey" id="menu_print_survey_form" sequence="1"
|
||||
action="action_view_survey_print" parent="menu_reporting"
|
||||
groups="group_survey_manager" icon="STOCK_PRINT"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
|
@ -29,38 +29,28 @@ class thunderbird_installer(osv.osv_memory):
|
|||
_name = 'thunderbird.installer'
|
||||
_inherit = 'res.config.installer'
|
||||
|
||||
def process_plugin(self, cr, uid, ids, context):
|
||||
"""
|
||||
Default Attach Thunderbird Plug-in File.
|
||||
"""
|
||||
data = {}
|
||||
file = open(config['addons_path'] + "/thunderbird/plugin/tiny_plugin-2.0.xpi", 'r')
|
||||
data['plugin_file'] = base64.encodestring(file.read())
|
||||
self.write(cr, uid, ids, data)
|
||||
return False
|
||||
|
||||
def process_pdf_file(self, cr, uid, ids, context):
|
||||
"""
|
||||
Default Attach Thunderbird Plug-in Installation File.
|
||||
"""
|
||||
data = {}
|
||||
def default_get(self, cr, uid, fields, context={}):
|
||||
data = super(thunderbird_installer, self).default_get(cr, uid, fields, context)
|
||||
pdf_file = open(config['addons_path'] + "/thunderbird/doc/Installation Guide to OpenERP Thunderbid Plug-in.pdf", 'r')
|
||||
data['pdf_file'] = base64.encodestring(pdf_file.read())
|
||||
self.write(cr, uid, ids, data)
|
||||
return False
|
||||
file = open(config['addons_path'] + "/thunderbird/plugin/tiny_plugin-2.0.xpi", 'r')
|
||||
data['plugin_file'] = base64.encodestring(file.read())
|
||||
return data
|
||||
|
||||
_columns = {
|
||||
'name':fields.char('File name', size=34),
|
||||
'pdf_name':fields.char('File name', size=64),
|
||||
'thunderbird':fields.boolean('Thunderbird Module ', help="Allows you to select an object that you’d like to add to your email and its attachments."),
|
||||
'plugin_file':fields.binary('Thunderbird Plug-in', readonly=True, help="Thunderbird plug-in file. Save as this file and install this plug-in in thunderbir."),
|
||||
'pdf_file':fields.binary('Thunderbird Plug-in Installation File', help="The documentation file :- how to install Thunderbird Plug-in.", readonly=True),
|
||||
'plugin_file':fields.binary('Thunderbird Plug-in', readonly=True, help="Thunderbird plug-in file. Save as this file and install this plug-in in thunderbird."),
|
||||
'pdf_file':fields.binary('Installation Manual', help="The documentation file :- how to install Thunderbird Plug-in.", readonly=True),
|
||||
'description':fields.text('Description', readonly=True)
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'thunderbird' : True,
|
||||
'name' : 'tiny_plugin-2.0.xpi',
|
||||
'pdf_name' : 'Installation Guide to OpenERP Thunderbid Plug-in.pdf',
|
||||
'description' : """ * Save The thunderbird plugin Follow the following step to install thunderbird plugin. \n -> 1. From Menu Bar, Open Tools > Add ons. \n -> 2. Now click on install button and a browser window will appear. \n -> 3. Just select the (.xpi) file from thunderbird/plugin directory and click ok, a new software installation window will appear and within a short time Install Now button will be enabled. \n -> 4. Click on Install Now and restart Thunderbird. \n -> 5. Now Thunderbird plugin is installed."""
|
||||
}
|
||||
|
||||
thunderbird_installer()
|
||||
|
|
|
@ -90,9 +90,9 @@ class tinythunderbird_partner(osv.osv):
|
|||
case_pool=self.pool.get(dictcreate.get('object','crm.case'))
|
||||
partner_ids=add_obj.search(cr,user,[('email','=',dictcreate['email_from'])])
|
||||
partner=add_obj.read(cr,user,partner_ids,['partner_id'])
|
||||
if partner:
|
||||
if partner and partner[0] and partner[0]['partner_id']:
|
||||
dictcreate.update({'partner_id':partner[0]['partner_id'][0]})
|
||||
create_id = self.pool.get(dictcreate.get('object','crm.case')).create(cr, user, dictcreate)
|
||||
create_id = case_pool.create(cr, user, dictcreate)
|
||||
cases=case_pool.browse(cr,user,[create_id])
|
||||
case_pool._history(cr, user, cases, _('Archive'), history=True, email=False)
|
||||
return create_id
|
||||
|
@ -104,10 +104,11 @@ class tinythunderbird_partner(osv.osv):
|
|||
|
||||
def thunderbird_createpartner(self,cr,user,vals):
|
||||
dictcreate = dict(vals)
|
||||
search_id = self.pool.get('res.partner').search(cr, user,[('name','=',dictcreate['name'])])
|
||||
address_obj = self.pool.get('res.partner')
|
||||
search_id = address_obj.search(cr, user,[('name','=',dictcreate['name'])])
|
||||
if search_id:
|
||||
return 0
|
||||
create_id = self.pool.get('res.partner').create(cr, user, dictcreate)
|
||||
create_id = address_obj.create(cr, user, dictcreate)
|
||||
return create_id
|
||||
|
||||
def thunderbird_searchobject(self,cr,user,vals):
|
||||
|
@ -116,12 +117,13 @@ class tinythunderbird_partner(osv.osv):
|
|||
return (search_id and search_id[0]) or 0
|
||||
|
||||
def thunderbird_searchcontact(self,cr,user,vals):
|
||||
search_id1 = self.pool.get('res.partner.address').search(cr,user,[('name','ilike',vals)])
|
||||
search_id2 = self.pool.get('res.partner.address').search(cr,user,[('email','=',vals)])
|
||||
address_obj = self.pool.get('res.partner.address')
|
||||
search_id1 = address_obj.search(cr,user,[('name','ilike',vals)])
|
||||
search_id2 = address_obj.search(cr,user,[('email','=',vals)])
|
||||
if search_id1:
|
||||
return self.pool.get('res.partner.address').name_get(cr, user, search_id1)
|
||||
return address_obj.name_get(cr, user, search_id1)
|
||||
elif search_id2:
|
||||
return self.pool.get('res.partner.address').name_get(cr, user, search_id2)
|
||||
return address_obj.name_get(cr, user, search_id2)
|
||||
return []
|
||||
|
||||
def thunderbird_tempsearch(self,cr,user,vals):
|
||||
|
@ -132,21 +134,22 @@ class tinythunderbird_partner(osv.osv):
|
|||
name_get=[]
|
||||
er_val=[]
|
||||
for object in obj:
|
||||
dyn_object = self.pool.get(object)
|
||||
if object == 'res.partner.address':
|
||||
search_id1 = self.pool.get(object).search(cr,user,[('name','ilike',value)])
|
||||
search_id2 = self.pool.get(object).search(cr,user,[('email','=',value)])
|
||||
search_id1 = dyn_object.search(cr,user,[('name','ilike',value)])
|
||||
search_id2 = dyn_object.search(cr,user,[('email','=',value)])
|
||||
if search_id1:
|
||||
name_get.append(object)
|
||||
name_get.append(self.pool.get(object).name_get(cr, user, search_id1))
|
||||
name_get.append(dyn_object.name_get(cr, user, search_id1))
|
||||
elif search_id2:
|
||||
name_get.append(object)
|
||||
name_get.append(self.pool.get(object).name_get(cr, user, search_id2))
|
||||
name_get.append(dyn_object.name_get(cr, user, search_id2))
|
||||
else:
|
||||
try:
|
||||
search_id1 = self.pool.get(object).search(cr,user,[('name','ilike',value)])
|
||||
search_id1 = dyn_object.search(cr,user,[('name','ilike',value)])
|
||||
if search_id1:
|
||||
name_get.append(object)
|
||||
name_get.append(self.pool.get(object).name_get(cr, user, search_id1))
|
||||
name_get.append(dyn_object.name_get(cr, user, search_id1))
|
||||
except:
|
||||
er_val.append(object)
|
||||
continue
|
||||
|
@ -179,17 +182,38 @@ class tinythunderbird_partner(osv.osv):
|
|||
|
||||
def read(self, cr, user, ids, fields=None, context={}, load='_classic_read'):
|
||||
ret_read = super(tinythunderbird_partner, self).read(cr, user, ids,fields,context,load)
|
||||
attach_obj = self.pool.get('ir.attachment')
|
||||
for read_data in ret_read:
|
||||
attachments = self.pool.get('ir.attachment').search(cr,user,[('res_model','=',self._name),('res_id','=',read_data['id'])])
|
||||
attechments_data = self.pool.get('ir.attachment').read(cr,user,attachments,['name'])
|
||||
attachments = attach_obj.search(cr,user,[('res_model','=',self._name),('res_id','=',read_data['id'])])
|
||||
attechments_data = sattach_obj.read(cr,user,attachments,['name'])
|
||||
file_names = [a['name'] for a in attechments_data]
|
||||
text_atteched = '\n'.join(file_names)
|
||||
read_data['attachments'] = text_atteched
|
||||
return ret_read
|
||||
|
||||
def unlink(self, cr, uid, ids, context={}):
|
||||
attachments = self.pool.get('ir.attachment').search(cr,uid,[('res_model','=',self._name),('res_id','in',ids)])
|
||||
self.pool.get('ir.attachment').unlink(cr,uid,attachments)
|
||||
attach_obj = self.pool.get('ir.attachment')
|
||||
attachments = attach_obj.search(cr,uid,[('res_model','=',self._name),('res_id','in',ids)])
|
||||
attach_obj.unlink(cr,uid,attachments)
|
||||
return super(tinythunderbird_partner, self).unlink(cr, uid, ids,context)
|
||||
|
||||
tinythunderbird_partner()
|
||||
def thunderbird_objectsearch(self,cr,user,vals):
|
||||
obj_list= [('crm.claim', 'Claim'), ('crm.lead','Lead'), ('crm.meeting','Metting'), ('crm.opportunity','Opportunity'), ('crm.phonecall','Phonecall'), ('crm.fundraising','Fund raising'), ('crm.helpdesk','Helpdesk')]
|
||||
object=[]
|
||||
model_obj = self.pool.get('ir.model')
|
||||
for obj in obj_list:
|
||||
if model_obj.search(cr, user, [('model', '=', obj[0])]):
|
||||
object.append(obj)
|
||||
return object
|
||||
|
||||
def thunderbird_list_search_object(self,cr,user,vals):
|
||||
model_obj = self.pool.get('ir.model')
|
||||
object=''
|
||||
for obj in vals[0][1].split(','):
|
||||
if model_obj.search(cr, user, [('model', '=', obj)]):
|
||||
object += obj + ","
|
||||
else:
|
||||
object += "null,"
|
||||
return object
|
||||
|
||||
tinythunderbird_partner()
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -1,3 +1,3 @@
|
|||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_tinythunderbird_partner","tinythunderbird.partner","model_tinythunderbird_partner",,1,1,1,1
|
||||
|
||||
"access_thunderbird_installer","thunderbird.installer","model_thunderbird_installer","base.group_user",1,1,1,1
|
||||
|
|
|
|
@ -29,13 +29,11 @@
|
|||
<newline/>
|
||||
|
||||
<field name="plugin_file" filename="name"/>
|
||||
<button name="process_plugin" icon="gtk-execute" string="Get Plugin File" type="object"/>
|
||||
<newline/>
|
||||
<field name="pdf_file" filename="pdf_name"/>
|
||||
<button name="process_pdf_file" icon="gtk-execute" string="Get Plugin Installation File" type="object"/>
|
||||
<newline/>
|
||||
<separator string="Thunderbird plugin installation note." colspan="4"/>
|
||||
<label colspan="8" string="Save The thunderbird plugin Follow the following step to install thunderbird plugin ? 1. From Menu Bar, Open Tools > Add ons. 2. Now click on install button and a browser window will appear. 3. Just select the (.xpi) file from thunderbird/plugin directory and click ok, a new software installation window will appear and within a short time Install Now button will be enabled. 4. Click on Install Now and restart Thunderbird. 5. Now Thunderbird plugin is installed."/>
|
||||
<field name="description" nolabel="1" colspan="8"/>
|
||||
</group>
|
||||
</group>
|
||||
</data>
|
||||
|
@ -74,16 +72,18 @@
|
|||
<label align="0.0" string="This module is required for the thuderbird plug-in to work properly.This allows you to select an object that you had like to add to your email and its attachments. You can select a partner, a task, a project, an analytical account, or any other object and attach selected mail as .eml file in attachment of selected record." width="200"/>
|
||||
</group>
|
||||
<group colspan="8">
|
||||
<separator string="Thunderbird" colspan="4"/>
|
||||
<field name="thunderbird"/>
|
||||
<field name="name" invisible="1"/>
|
||||
<newline/>
|
||||
<field name="plugin_file"/>
|
||||
<button name="process_plugin" icon="gtk-execute" string="Get Plugin File" type="object"/>
|
||||
<newline/>
|
||||
<separator string="Thunderbird plugin installation note." colspan="4"/>
|
||||
<label colspan="8" string="Save The thunderbird plugin Follow the following step to install thunderbird plugin ? 1. From Menu Bar, Open Tools > Add ons. 2. Now click on install button and a browser window will appear. 3. Just select the (.xpi) file from thunderbird/plugin directory and click ok, a new software installation window will appear and within a short time Install Now button will be enabled. 4. Click on Install Now and restart Thunderbird. 5. Now Thunderbird plugin is installed."/>
|
||||
</group>
|
||||
<field name="thunderbird"/>
|
||||
<field name="name" invisible="1"/>
|
||||
<field name="pdf_name" invisible="1"/>
|
||||
<newline/>
|
||||
|
||||
<field name="plugin_file" filename="name"/>
|
||||
<newline/>
|
||||
<field name="pdf_file" filename="pdf_name"/>
|
||||
<newline/>
|
||||
<separator string="Thunderbird plugin installation note." colspan="4"/>
|
||||
<field name="description" nolabel="1" colspan="8"/>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
<separator string="" colspan="4"/>
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<field name="model">wiki.groups</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Wikis">
|
||||
<tree string="Wiki Groups">
|
||||
<field name="name"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
@ -34,7 +34,7 @@
|
|||
<field name="model">wiki.groups</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Wikis">
|
||||
<form string="Wiki Groups">
|
||||
<group colspan="4" col="4">
|
||||
<field name="name" select="1"/>
|
||||
<field name="create_date" readonly="2"/>
|
||||
|
@ -62,7 +62,7 @@
|
|||
<!-- Wiki Groups Action -->
|
||||
|
||||
<record model="ir.actions.act_window" id="action_wiki_groups">
|
||||
<field name="name">Wikis</field>
|
||||
<field name="name">Wiki Groups</field>
|
||||
<field name="res_model">wiki.groups</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
|
@ -74,7 +74,7 @@
|
|||
action="action_wiki_groups"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_wiki_groups_browse">
|
||||
<field name="name">Wikis</field>
|
||||
<field name="name">Wiki Groups</field>
|
||||
<field name="res_model">wiki.groups</field>
|
||||
<field name="view_type">tree</field>
|
||||
</record>
|
||||
|
@ -126,13 +126,15 @@
|
|||
<form string="Wiki">
|
||||
<group col="8" colspan="4">
|
||||
<field name="name" select="1" colspan="6"/>
|
||||
<field name="group_id" select="1" on_change="onchange_group_id(group_id, text_area)"/>
|
||||
<field name="section" invisible="not context.get('section',False)"/>
|
||||
<field name="parent_id"/>
|
||||
<button name="open_wiki_page" type="object"
|
||||
string="Basic Wiki Editing" icon="gtk-ok" />
|
||||
</group>
|
||||
|
||||
<group col="8" colspan="4">
|
||||
<field name="group_id" select="1" on_change="onchange_group_id(group_id, text_area)"/>
|
||||
<field name="section" invisible="not context.get('section',False)"/>
|
||||
<field name="parent_id"/>
|
||||
</group>
|
||||
<separator colspan="4" string="Informations"/>
|
||||
<field name="text_area" nolabel="1" colspan="4" select="1" widget="text_wiki"/>
|
||||
<separator colspan="4" string="Modifications"/>
|
||||
<group col="6" colspan="4">
|
||||
|
@ -169,7 +171,7 @@
|
|||
<!-- search page for wiki -->
|
||||
|
||||
<record model="ir.actions.act_window" id="action_wiki">
|
||||
<field name="name">Search Pages</field>
|
||||
<field name="name">Wiki Pages</field>
|
||||
<field name="res_model">wiki.wiki</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -0,0 +1,42 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
{
|
||||
'name': 'Wiki -Sale - FAQ',
|
||||
'version': '1.0',
|
||||
'category': 'Generic Modules/Others',
|
||||
'description': """This module provides a wiki FAQ Template
|
||||
""",
|
||||
'author': 'Tiny',
|
||||
'website': 'http://openerp.com',
|
||||
'depends': ['wiki_faq','document','crm'],
|
||||
'init_xml': [
|
||||
'wiki_sale_faq_data.xml'
|
||||
],
|
||||
'update_xml': [
|
||||
'wiki_sale_faq_view.xml'
|
||||
],
|
||||
'demo_xml': [
|
||||
],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
<record model="document.directory" id="dir_sale">
|
||||
<field name="name">Sales Document</field>
|
||||
<field name="user_id" ref="base.user_admin"/>
|
||||
<field name="parent_id" ref="document.dir_root"/>
|
||||
<field name="ressource_id">0</field>
|
||||
</record>
|
||||
|
||||
<record id="wiki_groups_sale_faq" model="wiki.groups">
|
||||
<field name="name">Sale FAQ</field>
|
||||
<field name="method">list</field>
|
||||
<field eval="2" name="section"/>
|
||||
<field name="template">== Question ==
|
||||
|
||||
== Answer ==
|
||||
|
||||
== External Links ==
|
||||
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<menuitem id="base.menu_sales" name="Sales" parent="base.menu_base_partner" sequence="1"/>
|
||||
|
||||
<menuitem name="Documents"
|
||||
id="menu_sales" sequence="6"
|
||||
parent="base.menu_base_partner"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_document_form">
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">ir.attachment</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="domain" eval="[('parent_id','=',ref('dir_sale'))]"></field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_wiki_test">
|
||||
<field name="name">Wiki Pages</field>
|
||||
<field name="res_model">wiki.wiki</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain" eval="[('group_id','=',ref('wiki_groups_sale_faq'))]"/>
|
||||
<field name="search_view_id" ref="wiki.view_wiki_filter"/>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
name="Documents"
|
||||
action="action_document_form"
|
||||
id="menu_document_files"
|
||||
parent="menu_sales"/>
|
||||
|
||||
<menuitem parent="menu_sales"
|
||||
id="menu_action_wiki_wiki" name="FAQ"
|
||||
action="action_wiki_test" />
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
Loading…
Reference in New Issue