[MERGE]: Merge with lp:openobject-trunk-dev-addons2
bzr revid: ksa@tinyerp.co.in-20100607055517-zk9igbujeknamh3x
This commit is contained in:
@@ -1965,13 +1965,12 @@ class account_add_tmpl_wizard(osv.osv_memory):
|
||||
if not tids or not tids[0]['parent_id']:
|
||||
return False
|
||||
ptids = tmpl_obj.read(cr, uid, [tids[0]['parent_id'][0]],['code'])
|
||||
res = None
|
||||
if not ptids or not ptids[0]['code']:
|
||||
raise osv.except_osv(_('Error !'), _('Cannot locate parent code for template account!'))
|
||||
res = acc_obj.search(cr,uid,[('code','=',ptids[0]['code'])])
|
||||
if res:
|
||||
return res[0]
|
||||
else:
|
||||
return False
|
||||
|
||||
return res and res[0] or False
|
||||
|
||||
_columns = {
|
||||
'cparent_id':fields.many2one('account.account', 'Parent target', help="Creates an account with the selected template under this existing parent.", required=True),
|
||||
|
||||
@@ -133,11 +133,7 @@
|
||||
<field name="inherit_id" ref="base.view_partner_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//notebook[last()]" position="after">
|
||||
<notebook colspan="4">
|
||||
<page string="Project">
|
||||
<field name="contract_ids" colspan="4" nolabel="1" />
|
||||
</page>
|
||||
</notebook>
|
||||
<field name="contract_ids" colspan="4" nolabel="1" />
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -19,14 +19,16 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
import mx.DateTime
|
||||
import re
|
||||
|
||||
import tools
|
||||
from datetime import datetime
|
||||
from osv import fields, osv, orm
|
||||
from osv.orm import except_orm
|
||||
from osv.osv import osv_pool
|
||||
from tools.translate import _
|
||||
import mx.DateTime
|
||||
import pooler
|
||||
import re
|
||||
import time
|
||||
import tools
|
||||
|
||||
class base_action_rule(osv.osv):
|
||||
""" Base Action Rules """
|
||||
@@ -132,6 +134,74 @@ the rule to mark CC(mail to any other person defined in actions)."),
|
||||
|
||||
_order = 'sequence'
|
||||
|
||||
def pre_action(self, cr, uid, ids, model, context=None):
|
||||
# Searching for action rules
|
||||
cr.execute("SELECT m.model, r.id from base_action_rule r left join ir_model m on (m.id = r.name)")
|
||||
res = cr.fetchall()
|
||||
# Check if any rule matching with current object
|
||||
for obj_name, rule_id in res:
|
||||
if not (model == obj_name):
|
||||
continue
|
||||
else:
|
||||
obj = self.pool.get(obj_name)
|
||||
self._action(cr, uid, [rule_id], obj.browse(cr, uid, ids, context=context))
|
||||
return True
|
||||
|
||||
def new_create(self, old_create, model, context=None):
|
||||
if not context:
|
||||
context = {}
|
||||
def make_call_old(cr, uid, vals, context=context):
|
||||
new_id = old_create(cr, uid, vals, context=context)
|
||||
if not context.get('action'):
|
||||
self.pre_action(cr, uid, [new_id], model, context=context)
|
||||
return new_id
|
||||
return make_call_old
|
||||
|
||||
def new_write(self, old_write, model, context=None):
|
||||
if not context:
|
||||
context = {}
|
||||
def make_call_old(cr, uid, ids, vals, context=context):
|
||||
if isinstance(ids, (str, int, long)):
|
||||
ids = [ids]
|
||||
if not context.get('action'):
|
||||
self.pre_action(cr, uid, ids, model, context=context)
|
||||
return old_write(cr, uid, ids, vals, context=context)
|
||||
return make_call_old
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
if not context:
|
||||
context = {}
|
||||
res_id = super(base_action_rule, self).create(cr, uid, vals, context)
|
||||
model_pool = self.pool.get('ir.model')
|
||||
model = model_pool.browse(cr, uid, vals.get('name'), context=context).model
|
||||
obj_pool = self.pool.get(model)
|
||||
obj_pool.__setattr__('old_create', obj_pool.create)
|
||||
obj_pool.__setattr__('old_write', obj_pool.write)
|
||||
obj_pool.__setattr__('create', self.new_create(obj_pool.create, model, context=context))
|
||||
obj_pool.__setattr__('write', self.new_write(obj_pool.write, model, context=context))
|
||||
return res_id
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
res = super(base_action_rule, self).write(cr, uid, ids, vals, context)
|
||||
model_pool = self.pool.get('ir.model')
|
||||
if not context:
|
||||
context = {}
|
||||
for rule in self.browse(cr, uid, ids, context=context):
|
||||
model = model_pool.browse(cr, uid, rule.name.id, context=context).model
|
||||
obj_pool = self.pool.get(model)
|
||||
obj_pool.__setattr__('old_create', obj_pool.create)
|
||||
obj_pool.__setattr__('old_write', obj_pool.write)
|
||||
obj_pool.__setattr__('create', self.new_create(obj_pool.create, model, context=context))
|
||||
obj_pool.__setattr__('write', self.new_write(obj_pool.write, model, context=context))
|
||||
return res
|
||||
|
||||
def _check(self, cr, uid, automatic=False, use_new_cursor=False, \
|
||||
context=None):
|
||||
rule_pool= self.pool.get('base.action.rule')
|
||||
rule_ids = rule_pool.search(cr, uid, [], context=context)
|
||||
return rule_pool.write(cr, uid, rule_ids, {}, context=context)
|
||||
|
||||
|
||||
def format_body(self, body):
|
||||
""" Foramat Action rule's body
|
||||
@param self: The object pointer """
|
||||
@@ -235,6 +305,7 @@ the rule to mark CC(mail to any other person defined in actions)."),
|
||||
context.update({'active_id':obj.id, 'active_ids':[obj.id]})
|
||||
self.pool.get('ir.actions.server').run(cr, uid, [action.server_action_id.id], context)
|
||||
write = {}
|
||||
|
||||
if hasattr(obj, 'user_id') and action.act_user_id:
|
||||
obj.user_id = action.act_user_id
|
||||
write['user_id'] = action.act_user_id.id
|
||||
@@ -279,12 +350,10 @@ the rule to mark CC(mail to any other person defined in actions)."),
|
||||
@param ids: List of Basic Action Rule’s IDs,
|
||||
@param objects: pass objects
|
||||
@param context: A standard dictionary for contextual values """
|
||||
|
||||
context.update({'action': True})
|
||||
if not scrit:
|
||||
scrit = []
|
||||
cr.execute("select id from base_action_rule order by sequence")
|
||||
rule_ids = map(lambda x: x[0], cr.fetchall())
|
||||
for action in self.browse(cr, uid, rule_ids):
|
||||
for action in self.browse(cr, uid, ids):
|
||||
level = action.max_level
|
||||
if not level:
|
||||
break
|
||||
@@ -333,6 +402,7 @@ the rule to mark CC(mail to any other person defined in actions)."),
|
||||
self.do_action(cr, uid, action, model_obj, obj, context)
|
||||
break
|
||||
level -= 1
|
||||
context.update({'action': False})
|
||||
return True
|
||||
|
||||
def _check_mail(self, cr, uid, ids, context=None):
|
||||
@@ -359,4 +429,27 @@ the rule to mark CC(mail to any other person defined in actions)."),
|
||||
|
||||
base_action_rule()
|
||||
|
||||
|
||||
class ir_cron(osv.osv):
|
||||
_inherit = 'ir.cron'
|
||||
|
||||
def _poolJobs(self, db_name, check=False):
|
||||
try:
|
||||
db, pool = pooler.get_db_and_pool(db_name)
|
||||
except:
|
||||
return False
|
||||
cr = db.cursor()
|
||||
try:
|
||||
next = datetime.now().strftime('%Y-%m-%d %H:00:00')
|
||||
# Putting nextcall always less than current time in order to call it every time
|
||||
cr.execute('UPDATE ir_cron set nextcall = \'%s\' where numbercall<>0 and active and model=\'base.action.rule\' ' % (next))
|
||||
cr.commit()
|
||||
res = super(ir_cron, self)._poolJobs(db_name, check=check)
|
||||
finally:
|
||||
cr.commit()
|
||||
cr.close()
|
||||
|
||||
ir_cron()
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -12,9 +12,11 @@
|
||||
<field name="domain">[('object_id.model', '=', 'crm.lead')]</field>
|
||||
<field name="context">{'object_id':'crm.lead'}</field>
|
||||
</record>
|
||||
<menuitem action="crm_lead_stage_act" id="menu_crm_lead_stage_act"
|
||||
groups="base.group_extended"
|
||||
parent="crm.menu_crm_case_stage" />
|
||||
|
||||
<menuitem action="crm_lead_stage_act" id="menu_crm_lead_stage_act" name="Stages"
|
||||
groups="base.group_extended" sequence="0"
|
||||
parent="menu_crm_config_lead" />
|
||||
|
||||
|
||||
<!-- Resource Type Form View -->
|
||||
|
||||
@@ -26,10 +28,11 @@
|
||||
<field name="domain">[('object_id.model', '=', 'crm.lead')]</field>
|
||||
<field name="context">{'object_id':'crm.lead'}</field>
|
||||
</record>
|
||||
<menuitem action="crm_lead_resource_act"
|
||||
id="menu_crm_lead_resource_act"
|
||||
groups="base.group_extended"
|
||||
parent="crm.menu_crm_case_resource_type" />
|
||||
|
||||
<menuitem action="crm_lead_resource_act"
|
||||
id="menu_crm_lead_resource_act" name="Resource Type"
|
||||
groups="base.group_extended" sequence="2"
|
||||
parent="menu_crm_config_lead" />
|
||||
|
||||
<!-- CRM Lead Form View -->
|
||||
|
||||
|
||||
@@ -57,7 +57,8 @@ class crm_meeting(osv.osv, crm_case):
|
||||
Define Responsible user and Email account for mail gateway.'),
|
||||
'email_from': fields.char('Email', size=128, help="These people will receive email."),
|
||||
'id': fields.integer('ID'),
|
||||
|
||||
'create_date': fields.datetime('Creation Date' , readonly=True),
|
||||
'write_date': fields.datetime('Write Date' , readonly=True),
|
||||
# Meeting fields
|
||||
'thread_id': fields.many2one('mailgate.thread', 'Thread', required=False),
|
||||
'categ_id': fields.many2one('crm.case.categ', 'Meeting Type', \
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
<field name="context">{'object_id':'crm.meeting'}</field>
|
||||
</record>
|
||||
|
||||
<menuitem action="crm_meeting_categ_action"
|
||||
id="menu_crm_case_meeting-act" parent="crm.menu_crm_case_categ" />
|
||||
<menuitem action="crm_meeting_categ_action" name="Categories"
|
||||
id="menu_crm_case_meeting-act" parent="menu_crm_config_meeting" />
|
||||
|
||||
<!-- CRM Meetings Form View -->
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
</record>
|
||||
|
||||
<menuitem action="crm_opportunity_categ_action"
|
||||
id="menu_crm_case_opportunity-act"
|
||||
parent="crm.menu_crm_case_categ" />
|
||||
id="menu_crm_case_opportunity-act" name="Categories"
|
||||
parent="menu_crm_config_opportunity" />
|
||||
|
||||
<!-- Opportunity Stages Form View-->
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
</record>
|
||||
|
||||
<menuitem action="crm_opportunity_stage_act"
|
||||
id="menu_crm_opportunity_stage_act"
|
||||
parent="crm.menu_crm_case_stage" />
|
||||
id="menu_crm_opportunity_stage_act" name="Stages"
|
||||
parent="menu_crm_config_opportunity" />
|
||||
|
||||
<!-- Opportunity Resource Type Form View -->
|
||||
|
||||
@@ -44,8 +44,8 @@
|
||||
</record>
|
||||
|
||||
<menuitem action="crm_opportunity_resource_act"
|
||||
id="menu_crm_opportunity_resource_act"
|
||||
parent="crm.menu_crm_case_resource_type" />
|
||||
id="menu_crm_opportunity_resource_act" name="Resource"
|
||||
parent="menu_crm_config_opportunity" />
|
||||
|
||||
<!-- Opportunities Form View -->
|
||||
|
||||
@@ -329,7 +329,7 @@
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
<!-- Opportunities Graph View -->
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
<field name="context">{'object_id':'crm.phonecall'}</field>
|
||||
</record>
|
||||
|
||||
<menuitem action="crm_phonecall_categ_action"
|
||||
id="menu_crm_case_phonecall-act" parent="crm.menu_crm_case_categ" />
|
||||
<menuitem action="crm_phonecall_categ_action" name="Categories"
|
||||
id="menu_crm_case_phonecall-act" parent="menu_crm_config_phonecall" />
|
||||
|
||||
<!-- ResourceType Form View -->
|
||||
|
||||
@@ -27,10 +27,9 @@
|
||||
<field name="context">{'object_id':'crm.phonecall'}</field>
|
||||
</record>
|
||||
|
||||
<menuitem action="crm_phonecall_resource_act"
|
||||
id="menu_crm_phonecall_resource_act"
|
||||
parent="crm.menu_crm_case_resource_type" />
|
||||
|
||||
<menuitem action="crm_phonecall_resource_act"
|
||||
id="menu_crm_phonecall_resource_act" name="Resource Type"
|
||||
parent="menu_crm_config_phonecall" />
|
||||
|
||||
<!-- PhoneCalls Tree View -->
|
||||
|
||||
|
||||
+22
-13
@@ -1,8 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<menuitem id="base.menu_crm_configuration" name="Cases"
|
||||
parent="base.menu_base_config" sequence="0" groups="base.group_extended"/>
|
||||
<menuitem id="base.menu_crm_config_sales" name="Sales"
|
||||
parent="base.menu_base_config" sequence="1" groups="base.group_extended"/>
|
||||
|
||||
<menuitem id="menu_crm_config_lead" name="Lead"
|
||||
parent="base.menu_crm_config_sales" sequence="0" groups="base.group_extended"/>
|
||||
|
||||
<menuitem id="menu_crm_config_opportunity" name="Opportunity"
|
||||
parent="base.menu_crm_config_sales" sequence="1" groups="base.group_extended"/>
|
||||
|
||||
<menuitem id="menu_crm_config_meeting" name="Meeting"
|
||||
parent="base.menu_base_config" sequence="4" groups="base.group_extended"/>
|
||||
|
||||
<menuitem id="menu_crm_config_phonecall" name="Phone Call"
|
||||
parent="base.menu_base_config" sequence="5" groups="base.group_extended"/>
|
||||
|
||||
<menuitem id="base.next_id_64" name="Reporting"
|
||||
parent="base.menu_base_partner" sequence="8" />
|
||||
@@ -117,9 +129,7 @@
|
||||
<field name="view_id" ref="crm_case_stage_tree"/>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_crm_case_stage" name="Stages" parent="base.menu_crm_configuration" groups="base.group_extended"/>
|
||||
|
||||
<!-- Case Categories Form View -->
|
||||
<!-- Case Categories Form View -->
|
||||
|
||||
<record id="crm_case_categ-view" model="ir.ui.view">
|
||||
<field name="name">crm.case.categ.form</field>
|
||||
@@ -156,11 +166,11 @@
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="crm_case_categ_tree-view"/>
|
||||
</record>
|
||||
<menuitem id="menu_crm_case_categ" name="Categories" parent="base.menu_crm_configuration" groups="base.group_extended"/>
|
||||
|
||||
<menuitem action="crm_case_section_act"
|
||||
id="menu_crm_case_section_act"
|
||||
parent="base.menu_crm_configuration" />
|
||||
id="menu_crm_case_section_act" sequence="4"
|
||||
parent="base.menu_crm_config_sales" />
|
||||
|
||||
|
||||
|
||||
<!-- Resource Type of case Tree View -->
|
||||
@@ -201,8 +211,6 @@
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="crm_case_resource_type_tree"/>
|
||||
</record>
|
||||
<menuitem id="menu_crm_case_resource_type" name="Resource Type"
|
||||
parent="base.menu_crm_configuration" groups="base.group_extended" />
|
||||
|
||||
<record id="crm_case_section_act_tree" model="ir.actions.act_window">
|
||||
<field name="name">Cases by section</field>
|
||||
@@ -342,10 +350,11 @@
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<menuitem action="crm_segmentation_tree-act"
|
||||
|
||||
<menuitem action="crm_segmentation_tree-act"
|
||||
id="menu_crm_segmentation-act"
|
||||
groups="base.group_extended"
|
||||
parent="base.menu_crm_configuration" />
|
||||
groups="base.group_extended" sequence="5"
|
||||
parent="base.menu_crm_config_sales" />
|
||||
|
||||
<record model="ir.ui.view" id="view_users_form_simple_modif_inherited1">
|
||||
<field name="name">view.users.form.crm.modif.inherited1</field>
|
||||
|
||||
@@ -11,52 +11,48 @@
|
||||
<field name="inherit_id" ref="base.view_partner_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<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>
|
||||
<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>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
date: '2010-04-21 16:04:00'
|
||||
date_deadline: '2010-04-22 00:04:00'
|
||||
duration: 8.0
|
||||
email_from: info@balmerinc.be
|
||||
location: Ahmedabad
|
||||
name: Regarding Presentation
|
||||
email_from: info@mycompany.com
|
||||
location: B-1367 Grand-Rosière
|
||||
name: Technical Presentation
|
||||
partner_address_id: base.res_partner_address_1
|
||||
partner_id: base.res_partner_9
|
||||
partner_id: base.main_partner
|
||||
rrule_type: weekly
|
||||
section_id: crm.section_sales_department
|
||||
- |
|
||||
@@ -77,11 +77,9 @@
|
||||
I can invite internal user.
|
||||
-
|
||||
!record {model: base_calendar.invite.attendee, id: base_calendar_invite_attendee_0}:
|
||||
type: internal
|
||||
partner_id: base.res_partner_9
|
||||
user_ids:
|
||||
- base.user_demo
|
||||
- |
|
||||
type: email
|
||||
email: noemail@openerp.com- |
|
||||
If I set Send mail boolean as True I can see that an email is send to
|
||||
specified email address with proper meeting information.
|
||||
-
|
||||
|
||||
@@ -20,11 +20,12 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from crm import crm
|
||||
from osv import osv, fields
|
||||
from tools.translate import _
|
||||
import base64
|
||||
import time
|
||||
import tools
|
||||
from crm import crm
|
||||
|
||||
class crm_send_new_email(osv.osv_memory):
|
||||
""" Sends new email for the case"""
|
||||
@@ -93,10 +94,12 @@ class crm_send_new_email(osv.osv_memory):
|
||||
if context.get('mail', 'new') == 'new':
|
||||
if len(case.message_ids):
|
||||
message_id = case.message_ids[0].message_id
|
||||
else:
|
||||
message_id = "<%s-openerp-@%s-%s-%d>" % (time.time(), cr.dbname, model, res_id)
|
||||
else:
|
||||
hist = hist_obj.browse(cr, uid, res_id)
|
||||
message_id = hist.message_id
|
||||
model = hist.model_id.model
|
||||
model = hist.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
|
||||
@@ -196,7 +199,7 @@ class crm_send_new_email(osv.osv_memory):
|
||||
include_original = context and context.get('include_original', False) or False
|
||||
res = {}
|
||||
for hist in hist_obj.browse(cr, uid, res_ids, context=context):
|
||||
model = hist.model_id.model
|
||||
model = hist.model
|
||||
|
||||
# In the case where the crm.case does not exist in the database
|
||||
if not model:
|
||||
@@ -225,7 +228,7 @@ class crm_send_new_email(osv.osv_memory):
|
||||
|
||||
original = [header, sender, to, sentdate, desc, signature]
|
||||
|
||||
res['text']= '\n'.join(original)
|
||||
res['text']= '\n\n\n' + '\n'.join(original)
|
||||
|
||||
if 'subject' in fields:
|
||||
res.update({'subject': '[%s] %s' %(str(case.id), case.name or '')})
|
||||
|
||||
@@ -193,10 +193,7 @@
|
||||
<group col="2" colspan="2" attrs="{'invisible':[('type','=','binary')]}">
|
||||
<field name="url" widget="url"/>
|
||||
</group>
|
||||
|
||||
</group>
|
||||
|
||||
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Relation" colspan="2"/>
|
||||
<field name="res_name" readonly="1"/>
|
||||
@@ -219,7 +216,9 @@
|
||||
<page string="Security">
|
||||
<field name="group_ids" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
|
||||
<page string="Indexed Content" groups="base.group_extended">
|
||||
<field name="index_content" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Notes">
|
||||
<field colspan="4" name="description" nolabel="1"/>
|
||||
</page>
|
||||
|
||||
@@ -19,10 +19,11 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from content_index import indexer, cntIndex
|
||||
from subprocess import Popen, PIPE
|
||||
import StringIO
|
||||
import odt2txt
|
||||
from subprocess import Popen, PIPE
|
||||
from content_index import indexer, cntIndex
|
||||
import sys, zipfile, xml.dom.minidom
|
||||
|
||||
def _to_unicode(s):
|
||||
try:
|
||||
@@ -36,6 +37,15 @@ def _to_unicode(s):
|
||||
except UnicodeError:
|
||||
return s
|
||||
|
||||
def textToString(element) :
|
||||
buffer = u""
|
||||
for node in element.childNodes :
|
||||
if node.nodeType == xml.dom.Node.TEXT_NODE :
|
||||
buffer += node.nodeValue
|
||||
elif node.nodeType == xml.dom.Node.ELEMENT_NODE :
|
||||
buffer += textToString(node)
|
||||
return buffer
|
||||
|
||||
class TxtIndex(indexer):
|
||||
def _getMimeTypes(self):
|
||||
return ['text/plain','text/html','text/diff','text/xml', 'text/*',
|
||||
@@ -57,14 +67,23 @@ 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
|
||||
fp.read()
|
||||
file_obj = open(str(fname + ".txt"), "r")
|
||||
data = file_obj.read()
|
||||
return _to_unicode(data)
|
||||
def toString () :
|
||||
""" Converts the document to a string. """
|
||||
buffer = u""
|
||||
for val in ["a:t"]:
|
||||
for paragraph in content.getElementsByTagName(val) :
|
||||
buffer += textToString(paragraph) + "\n"
|
||||
return buffer
|
||||
|
||||
data = []
|
||||
zip = zipfile.ZipFile(fname)
|
||||
files = filter(lambda x: x.startswith('ppt/slides/slide'), zip.namelist())
|
||||
for i in range(1, len(files) + 1):
|
||||
content = xml.dom.minidom.parseString(zip.read('ppt/slides/slide%s.xml' % str(i)))
|
||||
res = toString().encode('ascii','replace')
|
||||
data.append(res)
|
||||
|
||||
return _to_unicode('\n'.join(data))
|
||||
|
||||
cntIndex.register(PptxIndex())
|
||||
|
||||
@@ -76,33 +95,60 @@ class DocIndex(indexer):
|
||||
return ['.doc']
|
||||
|
||||
def _doIndexFile(self,fname):
|
||||
fp = Popen(['antiword', fname], shell=False, stdout=PIPE).stdout
|
||||
return _to_unicode( fp.read())
|
||||
#fp = Popen(['antiword', fname], shell=False, stdout=PIPE).stdout
|
||||
return _to_unicode( 'None')
|
||||
|
||||
cntIndex.register(DocIndex())
|
||||
|
||||
class DocxIndex(indexer):
|
||||
def _getMimeTypes(self):
|
||||
return [ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document']
|
||||
|
||||
|
||||
def _getExtensions(self):
|
||||
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.
|
||||
# --> cp docx2txt.pl docx2txt.sh docx2txt.config /usr/bin/
|
||||
zip = zipfile.ZipFile(fname)
|
||||
content = xml.dom.minidom.parseString(zip.read("word/document.xml"))
|
||||
def toString () :
|
||||
""" Converts the document to a string. """
|
||||
buffer = u""
|
||||
for val in ["w:p", "w:h", "text:list"]:
|
||||
for paragraph in content.getElementsByTagName(val) :
|
||||
buffer += textToString(paragraph) + "\n"
|
||||
return buffer
|
||||
|
||||
fp = Popen(['docx2txt.pl', fname], shell=False, stdout=PIPE).stdout
|
||||
fp.read()
|
||||
file_obj = open(str(fname + ".txt"), "r")
|
||||
data = file_obj.read()
|
||||
return _to_unicode(data)
|
||||
res = toString().encode('ascii','replace')
|
||||
|
||||
return _to_unicode(res)
|
||||
|
||||
cntIndex.register(DocxIndex())
|
||||
|
||||
|
||||
class XlsxIndex(indexer):
|
||||
def _getMimeTypes(self):
|
||||
return [ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']
|
||||
|
||||
def _getExtensions(self):
|
||||
return ['.xlsx']
|
||||
|
||||
def _doIndexFile(self,fname):
|
||||
zip = zipfile.ZipFile(fname)
|
||||
content = xml.dom.minidom.parseString(zip.read("xl/sharedStrings.xml"))
|
||||
def toString () :
|
||||
""" Converts the document to a string. """
|
||||
buffer = u""
|
||||
for val in ["t"]:
|
||||
for paragraph in content.getElementsByTagName(val) :
|
||||
buffer += textToString(paragraph) + "\n"
|
||||
return buffer
|
||||
|
||||
res = toString().encode('ascii','replace')
|
||||
|
||||
return _to_unicode(res)
|
||||
|
||||
cntIndex.register(XlsxIndex())
|
||||
|
||||
class PdfIndex(indexer):
|
||||
def _getMimeTypes(self):
|
||||
return [ 'application/pdf']
|
||||
|
||||
@@ -23,8 +23,12 @@ import xml.dom.minidom
|
||||
domimpl = xml.dom.minidom.getDOMImplementation()
|
||||
import urlparse
|
||||
import urllib
|
||||
from DAV import utils
|
||||
from DAV.propfind import PROPFIND
|
||||
try:
|
||||
from DAV import utils
|
||||
from DAV.propfind import PROPFIND
|
||||
except ImportError:
|
||||
raise osv.except_osv('PyWebDAV Import Error!','Please install pywebdav \
|
||||
from http://pywebdav.googlecode.com/files/PyWebDAV-0.9.3.tar.gz/')
|
||||
import tools
|
||||
|
||||
|
||||
|
||||
@@ -115,31 +115,19 @@ class hr_si_project(osv.osv_memory):
|
||||
# get the latest action (sign_in or out) for this employee
|
||||
cr.execute('select action from hr_attendance where employee_id=%s and action in (\'sign_in\',\'sign_out\') order by name desc limit 1', (emp_id,))
|
||||
res = (cr.fetchone() or ('sign_out',))[0]
|
||||
in_out = res == 'sign_out' and 'out' or 'in'
|
||||
#TODO: invert sign_in et sign_out
|
||||
if res == 'sign_out':
|
||||
model_data_ids = obj_model.search(cr,uid,[('model','=','ir.ui.view'),('name','=','view_hr_timesheet_sign_in')])
|
||||
resource_id = obj_model.read(cr,uid,model_data_ids,fields=['res_id'])[0]['res_id']
|
||||
return {
|
||||
'name': 'Sign in / Sign out',
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'res_model': 'hr.sign.in.project',
|
||||
'views': [(False,'tree'), (resource_id,'form')],
|
||||
'type': 'ir.actions.act_window',
|
||||
'target': 'new'
|
||||
}
|
||||
else:
|
||||
model_data_ids = obj_model.search(cr,uid,[('model','=','ir.ui.view'),('name','=','view_hr_timesheet_sign_out')])
|
||||
resource_id = obj_model.read(cr,uid,model_data_ids,fields=['res_id'])[0]['res_id']
|
||||
return {
|
||||
'name': 'Sign in / Sign out',
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'res_model': 'hr.sign.out.project',
|
||||
'views': [(False,'tree'), (resource_id,'form')],
|
||||
'type': 'ir.actions.act_window',
|
||||
'target': 'new'
|
||||
}
|
||||
model_data_ids = obj_model.search(cr,uid,[('model','=','ir.ui.view'),('name','=','view_hr_timesheet_sign_%s' % in_out)])
|
||||
resource_id = obj_model.read(cr,uid,model_data_ids,fields=['res_id'])[0]['res_id']
|
||||
return {
|
||||
'name': 'Sign in / Sign out',
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'res_model': 'hr.sign.%s.project' % in_out,
|
||||
'views': [(False,'tree'), (resource_id,'form')],
|
||||
'type': 'ir.actions.act_window',
|
||||
'target': 'new'
|
||||
}
|
||||
|
||||
def _get_empid(self, cr, uid, context=None):
|
||||
emp_obj = self.pool.get('hr.employee')
|
||||
@@ -153,10 +141,7 @@ class hr_si_project(osv.osv_memory):
|
||||
emp_obj = self.pool.get('hr.employee')
|
||||
data = self.read(cr, uid, ids, [], context)[0]
|
||||
emp_id = data['emp_id']
|
||||
try:
|
||||
success = emp_obj.attendance_action_change(cr, uid, [emp_id], type = 'sign_in' ,dt=data['date'] or False)
|
||||
except except_osv, e:
|
||||
raise osv.except_osv(e.name, e.value)
|
||||
success = emp_obj.attendance_action_change(cr, uid, [emp_id], type = 'sign_in' ,dt=data['date'] or False)
|
||||
return {}
|
||||
|
||||
def default_get(self, cr, uid, fields_list, context=None):
|
||||
@@ -166,4 +151,4 @@ class hr_si_project(osv.osv_memory):
|
||||
|
||||
hr_si_project()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -50,9 +50,11 @@ class mailgate_thread(osv.osv):
|
||||
_rec_name = 'thread'
|
||||
|
||||
_columns = {
|
||||
'thread': fields.char('Thread', size=32, required=False),
|
||||
'thread': fields.char('Thread', size=124, 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),
|
||||
'model': fields.char('Model Name', size=64, required=False),
|
||||
'res_id': fields.integer('Resource ID'),
|
||||
}
|
||||
|
||||
def __history(self, cr, uid, cases, keyword, history=False, subject=None, email=False, details=None, email_from=False, message_id=False, attach=[], context={}):
|
||||
@@ -78,11 +80,11 @@ class mailgate_thread(osv.osv):
|
||||
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,
|
||||
'model' : case._name,
|
||||
'res_id': case.id,
|
||||
'date': time.strftime('%Y-%m-%d %H:%M:%S'),
|
||||
'thread_id': case.thread_id.id,
|
||||
'message_id': message_id,
|
||||
@@ -96,7 +98,7 @@ class mailgate_thread(osv.osv):
|
||||
'name': subject or 'History',
|
||||
'history': True,
|
||||
'user_id': uid,
|
||||
'model_id' : model_ids and model_ids[0] or False,
|
||||
'model' : case._name,
|
||||
'res_id': case.id,
|
||||
'date': time.strftime('%Y-%m-%d %H:%M:%S'),
|
||||
'description': details or (hasattr(case, 'description') and case.description or False),
|
||||
@@ -130,8 +132,6 @@ class mailgate_message(osv.osv):
|
||||
|
||||
_columns = {
|
||||
'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),
|
||||
@@ -144,7 +144,9 @@ class mailgate_message(osv.osv):
|
||||
'message_id': fields.char('Message Id', size=1024, readonly=True, help="Message Id on Email Server.", select=True),
|
||||
'description': fields.text('Description'),
|
||||
'partner_id': fields.many2one('res.partner', 'Partner', required=False),
|
||||
'attachment_ids': fields.many2many('ir.attachment', 'message_attachment_rel', 'message_id', 'attachment_id', 'Attachments'),
|
||||
'attachment_ids': fields.many2many('ir.attachment', 'message_attachment_rel', 'message_id', 'attachment_id', 'Attachments'),
|
||||
'model': fields.char('Model Name', size=64, required=False),
|
||||
'res_id': fields.integer('Resource ID'),
|
||||
}
|
||||
|
||||
mailgate_message()
|
||||
|
||||
@@ -8,21 +8,27 @@
|
||||
<field name="arch" type="xml">
|
||||
<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>
|
||||
<field name="name" required="1" select="1"/>
|
||||
<field name="date" required="1" select="1"/>
|
||||
<field name="user_id" string="Responsible" select="1"/>
|
||||
<field name="partner_id" readonly="1" />
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<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" />
|
||||
<page string="Details">
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Email Details" colspan="4"/>
|
||||
<field name="email_from" />
|
||||
<field name="email_to" />
|
||||
<field name="email_cc" />
|
||||
<field name="email_bcc" groups="base.group_extended"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Message Details" colspan="4"/>
|
||||
<field name="model" readonly="1"/>
|
||||
<field name="res_id" readonly="1"/>
|
||||
<field name="message_id" />
|
||||
</group>
|
||||
<separator string="Description" colspan="4"/>
|
||||
<separator string="Description" colspan="4"/>
|
||||
<field name="description" nolabel="1" colspan="4" />
|
||||
</page>
|
||||
<page string="Attachments">
|
||||
@@ -41,8 +47,9 @@
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Mailgateway Message">
|
||||
<field name="date" />
|
||||
<field name="email_from" />
|
||||
<field name="user_id" />
|
||||
<field name="name" />
|
||||
<field name="email_from" string="From"/>
|
||||
<field name="user_id" string="Responsible"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -68,28 +75,30 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Mailgateway Thread">
|
||||
<field name="thread" select="1"/>
|
||||
<group col="6" colspan="4">
|
||||
<field name="thread" select="1" colspan="3"/>
|
||||
</group>
|
||||
<separator string="Logs" colspan="4"/>
|
||||
<field name="log_ids" nolabel="1" colspan="4" domain="[('history', '=', True)]">
|
||||
<tree string="Mailgateway Logs">
|
||||
<field name="name" select="1" />
|
||||
<field name="date" />
|
||||
</tree>
|
||||
<form string="Mailgate Logs">
|
||||
<field name="name" />
|
||||
<field name="date" />
|
||||
<field name="user_id" />
|
||||
<field name="message_id" />
|
||||
<notebook colspan="4">
|
||||
<page string="Email 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" />
|
||||
</group>
|
||||
<separator string="Description" colspan="4"/>
|
||||
<tree string="Mailgateway Logs">
|
||||
<field name="name" select="1" />
|
||||
<field name="date" />
|
||||
</tree>
|
||||
<form string="Mailgate Logs">
|
||||
<field name="name" />
|
||||
<field name="date" />
|
||||
<field name="user_id" />
|
||||
<field name="message_id" />
|
||||
<notebook colspan="4">
|
||||
<page string="Email 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" />
|
||||
</group>
|
||||
<separator string="Description" colspan="4"/>
|
||||
<field name="description" nolabel="1" colspan="4" />
|
||||
</page>
|
||||
<page string="Attachments">
|
||||
@@ -145,33 +154,38 @@
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_view_mailgate_thread">
|
||||
<field name="name">Mailgateway Threads</field>
|
||||
<field name="res_model">mailgate.thread</field>
|
||||
<field name="name">Mailgateway Threads</field>
|
||||
<field name="res_model">mailgate.thread</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="view_mailgate_thread_tree"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window.view" id="action_view_mailgate_thread_view1">
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="view_mailgate_thread_tree"/>
|
||||
<field name="act_window_id" ref="action_view_mailgate_thread"/>
|
||||
</record>
|
||||
<record model="ir.actions.act_window.view" id="action_view_mailgate_thread_view2">
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="view_mailgate_thread_form"/>
|
||||
<field name="act_window_id" ref="action_view_mailgate_thread"/>
|
||||
</record>
|
||||
|
||||
<!-- Mailgateway message action-->
|
||||
<record model="ir.actions.act_window" id="action_view_mailgate_message">
|
||||
<field name="name">Mailgateway Messages</field>
|
||||
<field name="res_model">mailgate.message</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="view_mailgate_thread_tree"/>
|
||||
<field name="view_id" ref="view_mailgate_message_tree"/>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_mailgate_message" name="Mailgateway Messages" action="action_view_mailgate_message"
|
||||
parent="base.menu_base_config" sequence="20"/>
|
||||
|
||||
<record model="ir.actions.act_window.view" id="action_view_mailgate_thread_view1">
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="view_mailgate_thread_tree"/>
|
||||
<field name="act_window_id" ref="action_view_mailgate_thread"/>
|
||||
</record>
|
||||
<record model="ir.actions.act_window.view" id="action_view_mailgate_thread_view2">
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="view_mailgate_thread_form"/>
|
||||
<field name="act_window_id" ref="action_view_mailgate_thread"/>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- <menuitem id="base.menu_crm_configuration" name="Cases"
|
||||
parent="base.menu_base_config" sequence="0"/>
|
||||
|
||||
<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"
|
||||
@@ -180,4 +194,4 @@
|
||||
/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
</openerp>
|
||||
|
||||
@@ -130,7 +130,7 @@ class rpc_proxy(object):
|
||||
return self.rpc.execute(self.dbname, self.user_id, self.passwd, *request, **kwargs)
|
||||
|
||||
class email_parser(object):
|
||||
def __init__(self, uid, password, model, email, email_default, dbname, host, port):
|
||||
def __init__(self, uid, password, model, email, email_default, dbname, host, port, smtp_server=None, smtp_port=None, smtp_ssl=None, smtp_user=None, smtp_password=None):
|
||||
self.rpc = rpc_proxy(uid, password, host=host, port=port, dbname=dbname)
|
||||
try:
|
||||
self.model_id = int(model)
|
||||
@@ -141,7 +141,13 @@ class email_parser(object):
|
||||
self.email = email
|
||||
self.email_default = email_default
|
||||
self.canal_id = False
|
||||
|
||||
self.smtp_server = smtp_server
|
||||
self.smtp_port = smtp_port
|
||||
self.smtp_ssl = smtp_ssl
|
||||
self.smtp_user = smtp_user
|
||||
self.smtp_password = smtp_password
|
||||
|
||||
|
||||
def email_get(self, email_from):
|
||||
res = email_re.search(email_from)
|
||||
return res and res.group(1)
|
||||
@@ -170,7 +176,24 @@ class email_parser(object):
|
||||
from email.Header import decode_header
|
||||
s = decode_header(s.replace('\r', ''))
|
||||
return ''.join(map(lambda x:self._to_decode(x[0], [x[1]]), s or []))
|
||||
|
||||
|
||||
def history(self, model, new_id, msg_id, subject, msg_to, msg_from, body, attach):
|
||||
msg_data = {
|
||||
'name': subject,
|
||||
'history': True,
|
||||
'model': model,
|
||||
'res_id': new_id,
|
||||
'message_id': msg_id,
|
||||
'user_id': self.rpc.user_id,
|
||||
'date': time.strftime('%Y-%m-%d %H:%M:%S'),
|
||||
'email_from': msg_from,
|
||||
'email_to': msg_to,
|
||||
'description': body,
|
||||
'attachment_ids': [(6, 0, attach)]
|
||||
}
|
||||
msg_id = self.rpc('mailgate.message', 'create', msg_data)
|
||||
return True
|
||||
|
||||
def msg_new(self, msg):
|
||||
message = self.msg_body_get(msg)
|
||||
msg_subject = self._decode_header(msg['Subject'])
|
||||
@@ -189,26 +212,30 @@ class email_parser(object):
|
||||
data.update(self.partner_get(msg_from))
|
||||
|
||||
try:
|
||||
id = self.rpc(self.model, 'create', data)
|
||||
self.rpc(self.model, 'history', [id], 'Receive', True, msg_to, message['body'], msg_from, False, {'model' : self.model})
|
||||
#self.rpc(self.model, 'case_open', [id])
|
||||
att_ids = []
|
||||
new_id = self.rpc(self.model, 'create', data)
|
||||
attachments = message['attachment']
|
||||
for attach in attachments or []:
|
||||
data_attach = {
|
||||
'name': str(attach),
|
||||
'datas': binascii.b2a_base64(str(attachments[attach])),
|
||||
'datas_fname': str(attach),
|
||||
'description': 'Mail attachment',
|
||||
'res_model': self.model,
|
||||
'res_id': new_id
|
||||
}
|
||||
att_ids.append(self.rpc('ir.attachment', 'create', data_attach))
|
||||
try:
|
||||
self.rpc(self.model, 'history', [new_id], 'Receive', True, msg_to, message['body'], msg_from, False, {'model' : self.model})
|
||||
except Exception, e:
|
||||
self.history(self.model, new_id, msg['Message-Id'], msg_subject, msg_to, msg_from, message['body'], att_ids)
|
||||
except Exception, e:
|
||||
if getattr(e, 'faultCode', '') and 'AccessError' in e.faultCode:
|
||||
e = '\n\nThe Specified user does not have an access to the CRM case.'
|
||||
e = '\n\nThe Specified user does not have an access to the Model.'
|
||||
print e
|
||||
attachments = message['attachment']
|
||||
for attach in attachments or []:
|
||||
data_attach = {
|
||||
'name': str(attach),
|
||||
'datas': binascii.b2a_base64(str(attachments[attach])),
|
||||
'datas_fname': str(attach),
|
||||
'description': 'Mail attachment',
|
||||
'res_model': self.model,
|
||||
'res_id': id
|
||||
}
|
||||
self.rpc('ir.attachment', 'create', data_attach)
|
||||
|
||||
|
||||
return id
|
||||
return new_id
|
||||
|
||||
# #change the return type format to dictionary
|
||||
# {
|
||||
@@ -262,63 +289,6 @@ class email_parser(object):
|
||||
#end for
|
||||
return message
|
||||
|
||||
def msg_user(self, msg, id):
|
||||
body = self.msg_body_get(msg)
|
||||
|
||||
# handle email body commands (ex: Set-State: Draft)
|
||||
actions = {}
|
||||
body_data=''
|
||||
for line in body['body'].split('\n'):
|
||||
res = command_re.match(line)
|
||||
if res:
|
||||
actions[res.group(1).lower()] = res.group(2).lower()
|
||||
else:
|
||||
body_data += line+'\n'
|
||||
body['body'] = body_data
|
||||
|
||||
data = {
|
||||
# 'description': body['body'],
|
||||
}
|
||||
act = 'case_open'
|
||||
if 'state' in actions:
|
||||
if actions['state'] in ['draft', 'close', 'cancel', 'open', 'pending']:
|
||||
act = 'case_' + actions['state']
|
||||
|
||||
for k1, k2 in [('cost', 'planned_cost'), ('revenue', 'planned_revenue'), ('probability', 'probability')]:
|
||||
try:
|
||||
data[k2] = float(actions[k1])
|
||||
except:
|
||||
pass
|
||||
|
||||
if 'priority' in actions:
|
||||
if actions['priority'] in ('1', '2', '3', '4', '5'):
|
||||
data['priority'] = actions['priority']
|
||||
|
||||
if 'partner' in actions:
|
||||
data['email_from'] = actions['partner'][:128]
|
||||
|
||||
if 'user' in actions:
|
||||
uids = self.rpc('res.users', 'name_search', actions['user'])
|
||||
if uids:
|
||||
data['user_id'] = uids[0][0]
|
||||
|
||||
self.rpc(self.model, act, [id])
|
||||
self.rpc(self.model, 'write', [id], data)
|
||||
attachments = body['attachment']
|
||||
for attach in attachments or []:
|
||||
data_attach = {
|
||||
'name': str(attach),
|
||||
'datas': binascii.b2a_base64(str(attachments[attach])),
|
||||
'datas_fname': str(attach),
|
||||
'description': 'Mail attachment',
|
||||
'res_model': self.model,
|
||||
'res_id': id
|
||||
}
|
||||
self.rpc('ir.attachment', 'create', data_attach)
|
||||
|
||||
self.rpc(self.model, 'history', [id], 'Send', True, self._decode_header(msg['To']), body['body'], self._decode_header(msg['From']), False, {'model' : self.model})
|
||||
return id
|
||||
|
||||
def msg_send(self, msg, emails, priority=None):
|
||||
if not len(emails):
|
||||
return False
|
||||
@@ -330,85 +300,38 @@ class email_parser(object):
|
||||
msg['Cc'] = ','.join(emails[1:])
|
||||
del msg['Reply-To']
|
||||
msg['Reply-To'] = self.email
|
||||
if priority:
|
||||
msg['X-Priority'] = priorities.get(priority, '3 (Normal)')
|
||||
s = smtplib.SMTP()
|
||||
s.connect()
|
||||
s.sendmail(self.email, emails, msg.as_string())
|
||||
s = smtplib.SMTP(self.smtp_server, self.smtp_port)
|
||||
s.ehlo()
|
||||
s.starttls()
|
||||
s.ehlo()
|
||||
|
||||
if self.smtp_user and self.smtp_password:
|
||||
s.login(self.smtp_user, self.smtp_password)
|
||||
s.sendmail(self.email, emails, msg.as_string())
|
||||
s.close()
|
||||
return True
|
||||
|
||||
def msg_partner(self, msg, id):
|
||||
message = self.msg_body_get(msg)
|
||||
body = message['body']
|
||||
act = 'case_open'
|
||||
self.rpc(self.model, act, [id])
|
||||
#body2 = '\n'.join(map(lambda l: '> '+l, (body or '').split('\n')))
|
||||
#data = {
|
||||
# 'description':body,
|
||||
#}
|
||||
#self.rpc(self.model, 'write', [id], data)
|
||||
attachments = message['attachment']
|
||||
for attach in attachments or []:
|
||||
data_attach = {
|
||||
'name': str(attach),
|
||||
'datas': binascii.b2a_base64(str(attachments[attach])),
|
||||
'datas_fname': str(attach),
|
||||
'description': 'Mail attachment',
|
||||
'res_model': self.model,
|
||||
'res_id': id
|
||||
}
|
||||
self.rpc('ir.attachment', 'create', data_attach)
|
||||
|
||||
self.rpc(self.model, 'history', [id], 'Send', True, self._decode_header(msg['To']), message['body'], self._decode_header(msg['From']), False, {'model' : self.model})
|
||||
return id
|
||||
|
||||
def msg_test(self, msg, case_str):
|
||||
if not case_str:
|
||||
return (False, False)
|
||||
emails = self.rpc(self.model, 'emails_get', int(case_str))
|
||||
return (int(case_str), emails)
|
||||
|
||||
def parse(self, msg):
|
||||
case_str = reference_re.search(msg.get('References', ''))
|
||||
if case_str:
|
||||
case_str = case_str.group(1)
|
||||
else:
|
||||
case_str = case_re.search(msg.get('Subject', ''))
|
||||
if case_str:
|
||||
case_str = case_str.group(1)
|
||||
(case_id, emails) = self.msg_test(msg, case_str)
|
||||
if case_id:
|
||||
if emails[0] and self.email_get(emails[0])==self.email_get(self._decode_header(msg['From'])):
|
||||
self.msg_user(msg, case_id)
|
||||
else:
|
||||
self.msg_partner(msg, case_id)
|
||||
else:
|
||||
case_id = self.msg_new(msg)
|
||||
subject = self._decode_header(msg['subject'])
|
||||
if msg.get('Subject', ''):
|
||||
del msg['Subject']
|
||||
msg['Subject'] = '['+str(case_id)+'] '+subject
|
||||
msg['Message-Id'] = '<'+str(time.time())+'-openerpcrm-'+str(case_id)+'@'+socket.gethostname()+'>'
|
||||
|
||||
emails = self.rpc(self.model, 'emails_get', case_id)
|
||||
priority = emails[3]
|
||||
em = [emails[0], emails[1]] + (emails[2] or '').split(',')
|
||||
emails = map(self.email_get, filter(None, em))
|
||||
#TODO: Something with Message hierarchy
|
||||
res_id = self.msg_new(msg)
|
||||
subject = self._decode_header(msg['subject'])
|
||||
if msg.get('Subject', ''):
|
||||
del msg['Subject']
|
||||
msg['Subject'] = '['+str(res_id)+'] '+subject
|
||||
msg['Message-Id'] = '<'+str(time.time())+'-openerpcrm-'+str(res_id)+'@'+socket.gethostname()+'>'
|
||||
|
||||
mm = [self._decode_header(msg['From']), self._decode_header(msg['To'])]+self._decode_header(msg.get('Cc', '')).split(',')
|
||||
msg_mails = map(self.email_get, filter(None, mm))
|
||||
|
||||
emails = filter(lambda m: m and m not in msg_mails, emails)
|
||||
try:
|
||||
self.msg_send(msg, emails, priority)
|
||||
except:
|
||||
self.msg_send(msg, msg_mails)
|
||||
except Exception, e:
|
||||
if self.email_default:
|
||||
a = self._decode_header(msg['Subject'])
|
||||
del msg['Subject']
|
||||
msg['Subject'] = '[OpenERP-CaseError] ' + a
|
||||
msg['Subject'] = '[OpenERP-FetchError] ' + a
|
||||
self.msg_send(msg, self.email_default.split(','))
|
||||
return case_id, emails
|
||||
return res_id, msg_mails
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys, optparse
|
||||
@@ -425,10 +348,14 @@ if __name__ == '__main__':
|
||||
parser.add_option("-d", "--dbname", dest="dbname", help="Database name (default: terp)", default='terp')
|
||||
parser.add_option("--host", dest="host", help="Hostname of the Open ERP Server", default="localhost")
|
||||
parser.add_option("--port", dest="port", help="Port of the Open ERP Server", default="8069")
|
||||
|
||||
parser.add_option('--smtp', dest='smtp_server', default='', help='specify the SMTP server for sending email')
|
||||
parser.add_option('--smtp-port', dest='smtp_port', default='25', help='specify the SMTP port', type="int")
|
||||
parser.add_option('--smtp-ssl', dest='smtp_ssl', default='', help='specify the SMTP server support SSL or not')
|
||||
parser.add_option('--smtp-user', dest='smtp_user', default='', help='specify the SMTP username for sending email')
|
||||
parser.add_option('--smtp-password', dest='smtp_password', default='', help='specify the SMTP password for sending email')
|
||||
|
||||
(options, args) = parser.parse_args()
|
||||
parser = email_parser(options.userid, options.password, options.model, options.email, options.default, dbname=options.dbname, host=options.host, port=options.port)
|
||||
parser = email_parser(options.userid, options.password, options.model, options.email, options.default, dbname=options.dbname, host=options.host, port=options.port, smtp_server=options.smtp_server, smtp_port=options.smtp_port, smtp_ssl=options.smtp_ssl, smtp_user=options.smtp_user, smtp_password=options.smtp_password)
|
||||
|
||||
msg_txt = email.message_from_file(sys.stdin)
|
||||
|
||||
|
||||
@@ -47,14 +47,14 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search">
|
||||
<group col="16" colspan="6">
|
||||
<filter icon="gtk-media-rewind" string=" 365 Days "
|
||||
<filter icon="terp-go-year" string=" 365 Days "
|
||||
domain="[('date_start','<=', time.strftime('%%Y-%%m-%%d')),('date_start','>',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Production performed in last 365 Days"/>
|
||||
<filter icon="gtk-media-rewind" string=" 30 Days "
|
||||
<filter icon="terp-go-month" string=" 30 Days "
|
||||
name="month"
|
||||
domain="[('date_start','<=', time.strftime('%%Y-%%m-%%d')), ('date_start','>',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Production performed in last 30 days"/>
|
||||
<filter icon="gtk-media-rewind"
|
||||
<filter icon="terp-go-week"
|
||||
string=" 7 Days "
|
||||
separator="1"
|
||||
domain="[('date_start','<=', time.strftime('%%Y-%%m-%%d')), ('date_start','>',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
|
||||
@@ -69,7 +69,7 @@
|
||||
</group>
|
||||
<newline/>
|
||||
|
||||
<group expand="1" string="Group By...">
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Raw Material Location" icon="terp-gtk-jump-to-rtl" context="{'group_by':'location_src_id'}"/>
|
||||
<filter string="Finished Products Location" icon="terp-gtk-jump-to-ltr" context="{'group_by':'location_dest_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Tasks Analysis">
|
||||
<group colspan="10" col="12">
|
||||
<filter icon="gtk-media-rewind" string=" 365 Days "
|
||||
<filter icon="terp-go-year" string=" 365 Days "
|
||||
domain="[('date_start','<=', time.strftime('%%Y-%%m-%%d')),('date_start','>',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Tasks performed in last 365 Days"/>
|
||||
<filter icon="terp-go-month" string=" 30 Days "
|
||||
@@ -107,7 +107,7 @@
|
||||
</field>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="10" col="12">
|
||||
<group expand="0" string="Group By..." colspan="10" col="12">
|
||||
<filter string="User" name="User" icon="terp-personal" context="{'group_by':'user_id'}" />
|
||||
<filter string="Project" icon="terp-folder-blue" context="{'group_by':'project_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
|
||||
@@ -213,7 +213,7 @@
|
||||
<field name="project_id" select="1" widget="selection" string="Project"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="4" col="20" groups="base.group_extended">
|
||||
<group expand="0" string="Group By..." colspan="4" col="20" groups="base.group_extended">
|
||||
<filter string="Stage" icon="terp-stage" domain="[]"
|
||||
context="{'group_by':'stage_id'}" />
|
||||
<filter string="Priority" icon="terp-rating-rated" domain="[]"
|
||||
|
||||
@@ -162,7 +162,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Planning by Account">
|
||||
<group col="8" colspan="4">
|
||||
<filter icon="terp-project" string="Current Plannings" domain="[('date_from','<=',time.strftime('%%Y-%%m-%%d')),('date_to','>=',time.strftime('%%Y-%%m-%%d'))]" help="Current Plannings"/>
|
||||
<filter icon="terp-check" string="Current Plannings" domain="[('date_from','<=',time.strftime('%%Y-%%m-%%d')),('date_to','>=',time.strftime('%%Y-%%m-%%d'))]" help="Current Plannings"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name" select="1"/>
|
||||
<field name="code" select="1"/>
|
||||
|
||||
@@ -169,7 +169,7 @@
|
||||
<filter string="Order Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_order'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Expected Date" icon="terp-go-month" domain="[]" context="{'group_by':'minimum_planned_date'}"/>
|
||||
<filter string="Source Document”" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'origin'}"/>
|
||||
<filter string="Source Document" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'origin'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record model="ir.ui.view" id="view_purchase_order_graph">
|
||||
<record model="ir.ui.view" id="view_purchase_order_report_graph">
|
||||
<field name="name">product.month.graph</field>
|
||||
<field name="model">purchase.report</field>
|
||||
<field name="type">graph</field>
|
||||
@@ -88,7 +88,7 @@
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="10" col="12">
|
||||
<group expand="0" string="Group By..." colspan="10" col="12">
|
||||
<filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<filter string="Warehouse" icon="terp-go-home" context="{'group_by':'warehouse_id'}"/>
|
||||
<filter string="Location" icon="terp-go-home" context="{'group_by':'location_id'}"/>
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
<field name="resource_id" string="Resource" widget="selection"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="4" col="20">
|
||||
<group expand="0" string="Group By..." colspan="4" col="20">
|
||||
<filter string="Resource" icon="terp-personal" domain="[]" context="{'group_by':'resource_id'}"/>
|
||||
<filter string="Company" icon="terp-go-home" domain="[]" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
</group>
|
||||
|
||||
@@ -44,16 +44,16 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Stock Move">
|
||||
<group>
|
||||
<filter icon="terp-stock"
|
||||
<filter icon="terp-go-year"
|
||||
string="This Year"
|
||||
domain="[('year','=',time.strftime('%%Y'))]"
|
||||
help="Stock Moves of the year"/>
|
||||
<filter icon="terp-stock"
|
||||
<filter icon="terp-go-month"
|
||||
name="month"
|
||||
string="This Month"
|
||||
domain="[('month','=',time.strftime('%%m'))]"
|
||||
help="Stock Moves of this month"/>
|
||||
<filter icon="terp-stock"
|
||||
<filter icon="terp-go-today"
|
||||
string="Today"
|
||||
separator="1"
|
||||
domain="[('date_planned','>=', time.strftime('%%Y-%%m-%%d')), ('date_planned','<',(datetime.date.today()-datetime.timedelta(days=1)).strftime('%%Y-%%m-%%d'))]"
|
||||
@@ -61,39 +61,39 @@
|
||||
<separator orientation="vertical"/>
|
||||
|
||||
<filter string="Waiting"
|
||||
icon="terp-stock"
|
||||
icon="terp-gtk-media-pause"
|
||||
domain="[('state','=','waiting')]"
|
||||
help = "Confirmed Stock-Moves"/>
|
||||
|
||||
<filter string="Available"
|
||||
icon="terp-stock"
|
||||
icon="terp-camera_test"
|
||||
domain="[('state','=','assigned')]"
|
||||
help = "Available Stock-Moves"/>
|
||||
|
||||
<filter string="Done"
|
||||
name="done"
|
||||
icon="terp-stock"
|
||||
icon="terp-dialog-close"
|
||||
domain="[('state','=','done')]"
|
||||
help = "Completed Stock-Moves"/>
|
||||
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-stock" string="Internal Locations" domain="[('location_id.usage','=','internal')]"/>
|
||||
<filter icon="terp-stock" string="Scrap Locations" domain="[('location_id.scrap_location','=',1)]"/>
|
||||
<filter icon="terp-go-home" string="Internal Locations" domain="[('location_id.usage','=','internal')]"/>
|
||||
<filter icon="terp-go-home" string="Scrap Locations" domain="[('location_id.scrap_location','=',1)]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="product_id"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." >
|
||||
<filter string="Partner" name="Partner" icon="terp-stock" domain="[]" context="{'group_by':'partner_id'}"/>
|
||||
<filter name="product" string="Product" icon="terp-stock" context="{'group_by':'product_id'}"/>
|
||||
<group expand="0" string="Group By..." >
|
||||
<filter string="Partner" name="Partner" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
|
||||
<filter name="product" string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter name="src_location" string="Source Location" icon="terp-stock" context="{'group_by':'location_id'}"/>
|
||||
<filter string="Dest. Location" icon="terp-stock" context="{'group_by':'location_dest_id'}"/>
|
||||
<filter string="State" icon="terp-stock" context="{'group_by':'state'}"/>
|
||||
<filter name="src_location" string="Source Location" icon="terp-gtk-jump-to-rtl" context="{'group_by':'location_id'}"/>
|
||||
<filter string="Dest. Location" icon="terp-gtk-jump-to-ltr" context="{'group_by':'location_dest_id'}"/>
|
||||
<filter string="State" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Day" icon="terp-stock" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-stock" context="{'group_by':'date_planned'}"/>
|
||||
<filter string="Year" icon="terp-stock" context="{'group_by':'year'}"/>
|
||||
<filter string="Day" icon="terp-go-month" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-go-month" context="{'group_by':'date_planned'}"/>
|
||||
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Extended options..." groups="base.group_extended">
|
||||
|
||||
@@ -54,38 +54,38 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search">
|
||||
<group col="16" colspan="6">
|
||||
<filter icon="gtk-media-rewind" string=" 365 Days "
|
||||
<filter icon="terp-go-year" string=" 365 Days "
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')),('date','>',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Picking in last 365 days"/>
|
||||
<filter icon="gtk-media-rewind" string=" 30 Days "
|
||||
<filter icon="terp-go-month" string=" 30 Days "
|
||||
name="month"
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')), ('date','>',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Picking in last 30 days"/>
|
||||
<filter icon="gtk-media-rewind"
|
||||
<filter icon="terp-go-week"
|
||||
string=" 7 Days "
|
||||
separator="1"
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')), ('date','>',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Picking during last 7 days"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Todo" icon="terp-stock" domain="[('state','in',('draft','auto','confirmed','assigned'))]"/>
|
||||
<filter string="Done" icon="terp-stock" domain="[('state','=','done')]"/>
|
||||
<filter string="Todo" icon="terp-gtk-go-back-rtl" domain="[('state','in',('draft','auto','confirmed','assigned'))]"/>
|
||||
<filter string="Done" icon="terp-dialog-close" domain="[('state','=','done')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By...">
|
||||
<filter string="Partner" name="Partner" icon="terp-stock" domain="[]" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="Company" icon="terp-stock" domain="[]" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<filter string="Shipping Type" icon="terp-stock" domain="[]" context="{'group_by':'type'}"/>
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Partner" name="Partner" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="Company" icon="terp-go-home" domain="[]" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<filter string="Shipping Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'type'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Product" icon="terp-stock" domain="[]" context="{'group_by':'product_id'}"/>
|
||||
<filter string="State" icon="terp-stock" domain="[]" context="{'group_by':'state'}"/>
|
||||
<filter string="Invoice Status" icon="terp-stock" domain="[]" context="{'group_by':'invoice_state'}"/>
|
||||
<filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
|
||||
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
|
||||
<filter string="Invoice Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'invoice_state'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Day" icon="terp-stock" domain="[]" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-stock" domain="[]" context="{'group_by':'month'}"/>
|
||||
<filter string="Year" icon="terp-stock" domain="[]" context="{'group_by':'year'}"/>
|
||||
<filter string="Day" icon="terp-go-month" domain="[]" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-go-month" domain="[]" context="{'group_by':'month'}"/>
|
||||
<filter string="Year" icon="terp-go-year" domain="[]" context="{'group_by':'year'}"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Extended options..." groups="base.group_extended">
|
||||
|
||||
@@ -9,17 +9,17 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Location">
|
||||
<group col="10" colspan="4">
|
||||
<filter icon="terp-stock" name="internal_locations" string="Internal Locations" domain="[('location_id.usage', '=', 'internal')]" help="Internal Locations"/>
|
||||
<filter icon="terp-stock" string="Customer Locations" domain="[('location_id.usage', '=', 'customer')]" help="Customer Locations" />
|
||||
<filter icon="terp-stock" string="Supplier Locations" domain="[('location_id.usage', '=', 'supplier')]" help="Supplier Locations" />
|
||||
<filter icon="terp-go-home" name="internal_locations" string="Internal Locations" domain="[('location_id.usage', '=', 'internal')]" help="Internal Locations"/>
|
||||
<filter icon="terp-go-home" string="Customer Locations" domain="[('location_id.usage', '=', 'customer')]" help="Customer Locations" />
|
||||
<filter icon="terp-go-home" string="Supplier Locations" domain="[('location_id.usage', '=', 'supplier')]" help="Supplier Locations" />
|
||||
<separator orientation="vertical"/>
|
||||
<field name="location_id"/>
|
||||
<field name="product_id"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="4" col="10">
|
||||
<filter string="Location" icon="terp-stock" domain="[]" context="{'group_by':'location_id'}"/>
|
||||
<filter string="Product" icon="terp-stock" domain="[]" context="{'group_by':'product_id'}"/>
|
||||
<filter string="Location" icon="terp-go-home" domain="[]" context="{'group_by':'location_id'}"/>
|
||||
<filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
@@ -155,12 +155,12 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Dates of Inventories">
|
||||
<filter icon="gtk-media-rewind" name="stockable" string="Stockable"
|
||||
<filter icon="terp-accessories-archiver" name="stockable" string="Stockable"
|
||||
domain="[('product_id.type','=', 'product')]"/>
|
||||
<filter icon="gtk-media-rewind" string="Consumable"
|
||||
<filter icon="terp-accessories-archiver" string="Consumable"
|
||||
domain="[('product_id.type','=', 'consumable')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="gtk-media-rewind" string="Non Inv"
|
||||
<filter icon="terp-accessories-archiver-minus" string="Non Inv"
|
||||
domain="[('date','=', False)]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="product_id"/>
|
||||
|
||||
+65
-65
@@ -55,9 +55,9 @@
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="4" col="4" groups="base.group_extended">
|
||||
<filter string="State" icon="terp-sale" domain="[]" context="{'group_by':'state'}"/>
|
||||
<filter string="Date" icon="terp-sale" domain="[]" context="{'group_by':'date'}"/>
|
||||
<group expand="0" string="Group By..." colspan="4" col="4" groups="base.group_extended">
|
||||
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
|
||||
<filter string="Date" icon="terp-go-month" domain="[]" context="{'group_by':'date'}"/>
|
||||
</group>
|
||||
</search>
|
||||
|
||||
@@ -271,7 +271,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Product Lots Filter">
|
||||
<group col="10" colspan="4">
|
||||
<filter icon="terp-stock" name="available" string="Available" domain="[('stock_available', '>', 0)]" help="Available Product Lots" />
|
||||
<filter icon="terp-check" name="available" string="Available" domain="[('stock_available', '>', 0)]" help="Available Product Lots" />
|
||||
<separator orientation="vertical"/>
|
||||
<field name="prefix"/>
|
||||
<field name="name"/>
|
||||
@@ -280,8 +280,8 @@
|
||||
<field name="date"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="4" col="8">
|
||||
<filter string="Product" icon="terp-stock" domain="[]" context="{'group_by':'product_id'}"/>
|
||||
<group expand="0" string="Group By..." colspan="4" col="8">
|
||||
<filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
@@ -438,11 +438,11 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Stock Locations">
|
||||
<filter icon="terp-stock" name="in_location"
|
||||
<filter icon="terp-go-home" name="in_location"
|
||||
string="Internal" domain="[('location_id.usage', '=', 'internal')]" help="Internal Locations" />
|
||||
<filter icon="terp-stock" name="customer"
|
||||
<filter icon="terp-go-home" name="customer"
|
||||
string="Customer" domain="[('location_id.usage', '=', 'customer')]" help="Customer Locations" />
|
||||
<filter icon="terp-stock" name="supplier"
|
||||
<filter icon="terp-go-home" name="supplier"
|
||||
string="Supplier" domain="[('location_id.usage', '=', 'supplier')]" help="Supplier Locations" />
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name"/>
|
||||
@@ -712,10 +712,10 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Stock Picking">
|
||||
<group col="10" colspan="4">
|
||||
<filter icon="terp-stock" name="available" string="Available" domain="[('state','=','assigned')]" help="Available Pickings"/>
|
||||
<filter icon="terp-stock" string="Confirmed" domain="[('state','=','confirmed')]" help="Confirmed Pickings"/>
|
||||
<filter icon="terp-check" name="available" string="Available" domain="[('state','=','assigned')]" help="Available Pickings"/>
|
||||
<filter icon="terp-camera_test" string="Confirmed" domain="[('state','=','confirmed')]" help="Confirmed Pickings"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-stock" string="Back Order" domain="[('backorder_id', '!=', False)]" help="Has Back Order" />
|
||||
<filter icon="terp-accessories-archiver-minus" string="Back Order" domain="[('backorder_id', '!=', False)]" help="Has Back Order" />
|
||||
<separator orientation="vertical"/>
|
||||
<field name="location_id"/>
|
||||
<field name="location_dest_id"/>
|
||||
@@ -723,10 +723,10 @@
|
||||
<field name="address_id"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="4" col="8">
|
||||
<filter string="Partner" icon="terp-stock" domain="[]" context="{'group_by':'address_id'}"/>
|
||||
<filter string="State" icon="terp-stock" domain="[]" context="{'group_by':'state'}"/>
|
||||
<filter string="Date" icon="terp-stock" domain="[]" context="{'group_by':'date'}"/>
|
||||
<group expand="0" string="Group By..." colspan="4" col="8">
|
||||
<filter string="Partner" icon="terp-personal" domain="[]" context="{'group_by':'address_id'}"/>
|
||||
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
|
||||
<filter string="Date" icon="terp-go-month" domain="[]" context="{'group_by':'date'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
@@ -859,20 +859,20 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Stock Delivery">
|
||||
<group col="10" colspan="4">
|
||||
<filter icon="terp-stock" name="available" string="Available" domain="[('state','=','assigned')]" help="Assigned Orders" />
|
||||
<filter icon="terp-stock" string="Confirmed" domain="[('state','=','confirmed')]" help="Confirmed Orders"/>
|
||||
<filter icon="terp-check" name="available" string="Available" domain="[('state','=','assigned')]" help="Assigned Orders" />
|
||||
<filter icon="terp-camera_test" string="Confirmed" domain="[('state','=','confirmed')]" help="Confirmed Orders"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-stock" string="Back Order" domain="[('backorder_id','!=',False)]" help="Back Order"/>
|
||||
<filter icon="terp-accessories-archiver-minus" string="Back Order" domain="[('backorder_id','!=',False)]" help="Back Order"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name"/>
|
||||
<field name="address_id"/>
|
||||
<field name="origin"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="4" col="10">
|
||||
<filter string="Partner" icon="terp-stock" domain="[]" context="{'group_by':'address_id'}"/>
|
||||
<filter string="State" icon="terp-stock" domain="[]" context="{'group_by':'state'}"/>
|
||||
<filter string="Order Date" icon="terp-stock" domain="[]" context="{'group_by':'date'}"/>
|
||||
<group expand="0" string="Group By..." colspan="4" col="10">
|
||||
<filter string="Partner" icon="terp-personal" domain="[]" context="{'group_by':'address_id'}"/>
|
||||
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
|
||||
<filter string="Order Date" icon="terp-go-month" domain="[]" context="{'group_by':'date'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
@@ -1041,8 +1041,8 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Picking list">
|
||||
<group col="8" colspan="4">
|
||||
<filter icon="terp-stock" string="Available" domain="[('state','=','assigned')]" help="Assigned Outgoing Orders"/>
|
||||
<filter icon="terp-stock" string="Confirmed" domain="[('state','=','confirmed')]" help="Confirmed Outgoing Orders"/>
|
||||
<filter icon="terp-check" string="Available" domain="[('state','=','assigned')]" help="Assigned Outgoing Orders"/>
|
||||
<filter icon="terp-camera_test" string="Confirmed" domain="[('state','=','confirmed')]" help="Confirmed Outgoing Orders"/>
|
||||
<separator orientation="vertical"/>
|
||||
|
||||
<field name="name"/>
|
||||
@@ -1051,11 +1051,11 @@
|
||||
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="4" col="8">
|
||||
<filter string="Partner" icon="terp-stock" domain="[]" context="{'group_by':'address_id'}"/>
|
||||
<filter string="State" icon="terp-stock" domain="[]" context="{'group_by':'state'}"/>
|
||||
<filter string="Order Date" icon="terp-stock" domain="[]" context="{'group_by':'date'}"/>
|
||||
<filter string="Expected Date" icon="terp-stock" domain="[]" context="{'group_by':'min_date'}"/>
|
||||
<group expand="0" string="Group By..." colspan="4" col="8">
|
||||
<filter string="Partner" icon="terp-personal" domain="[]" context="{'group_by':'address_id'}"/>
|
||||
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
|
||||
<filter string="Order Date" icon="terp-go-month" domain="[]" context="{'group_by':'date'}"/>
|
||||
<filter string="Expected Date" icon="terp-go-month" domain="[]" context="{'group_by':'min_date'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
@@ -1216,9 +1216,9 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Input Picking List">
|
||||
<group col="8" colspan="4">
|
||||
<filter icon="terp-stock" name="available" string="Available" domain="[('state','=','assigned')]" help="Assigned Incoming Orders" />
|
||||
<filter icon="terp-check" name="available" string="Available" domain="[('state','=','assigned')]" help="Assigned Incoming Orders" />
|
||||
<separator orientation="vertical" />
|
||||
<filter icon="terp-stock" string="Back Order" domain="[('backorder_id', '!=', False)]" help="Has Back Order" groups="base.group_extended"/>
|
||||
<filter icon="terp-accessories-archiver-minus" string="Back Order" domain="[('backorder_id', '!=', False)]" help="Has Back Order" groups="base.group_extended"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name"/>
|
||||
<field name="address_id"/>
|
||||
@@ -1226,13 +1226,13 @@
|
||||
<field name="company_id" widget="selection" groups="base.group_multi_company" />
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="4" col="8">
|
||||
<filter icon="terp-stock" name="state" string="State" domain="[]" context="{'group_by':'state'}"/>
|
||||
<group expand="0" string="Group By..." colspan="4" col="8">
|
||||
<filter icon="terp-stock_effects-object-colorize" name="state" string="State" domain="[]" context="{'group_by':'state'}"/>
|
||||
<separator orientation="vertical" />
|
||||
<filter string="Partner" icon="terp-stock" domain="[]" context="{'group_by':'address_id'}"/>
|
||||
<filter string="Partner" icon="terp-personal" domain="[]" context="{'group_by':'address_id'}"/>
|
||||
<separator orientation="vertical" />
|
||||
<filter string="Order Date" icon="terp-stock" domain="[]" context="{'group_by':'date'}"/>
|
||||
<filter string="Expected Date" icon="terp-stock" domain="[]" context="{'group_by':'min_date'}"/>
|
||||
<filter string="Order Date" icon="terp-go-month" domain="[]" context="{'group_by':'date'}"/>
|
||||
<filter string="Expected Date" icon="terp-go-month" domain="[]" context="{'group_by':'min_date'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
@@ -1275,20 +1275,20 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Internal Picking List">
|
||||
<group col="8" colspan="4">
|
||||
<filter icon="terp-stock" string="Available" domain="[('state','=','assigned')]" help="Assigned Internal Moves"/>
|
||||
<filter icon="terp-stock" name="confirmed" string="Confirmed" domain="[('state','=','confirmed')]" help="Confirmed Internal Moves" />
|
||||
<filter icon="terp-check" string="Available" domain="[('state','=','assigned')]" help="Assigned Internal Moves"/>
|
||||
<filter icon="terp-camera_test" name="confirmed" string="Confirmed" domain="[('state','=','confirmed')]" help="Confirmed Internal Moves" />
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name"/>
|
||||
<field name="origin"/>
|
||||
<field name="company_id" widget="selection"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="4" col="8">
|
||||
<filter string="State" icon="terp-stock" domain="[]" context="{'group_by':'state'}"/>
|
||||
<filter string="Partner" icon="terp-stock" domain="[]" context="{'group_by':'address_id'}"/>
|
||||
<filter string="Order Date" icon="terp-stock" domain="[]" context="{'group_by':'date'}"/>
|
||||
<filter string="Expected Date" icon="terp-stock" domain="[]" context="{'group_by':'min_date'}"/>
|
||||
<filter string="Origin" icon="terp-stock" domain="[]" context="{'group_by':'origin'}"/>
|
||||
<group expand="0" string="Group By..." colspan="4" col="8">
|
||||
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
|
||||
<filter string="Partner" icon="terp-personal" domain="[]" context="{'group_by':'address_id'}"/>
|
||||
<filter string="Order Date" icon="terp-go-month" domain="[]" context="{'group_by':'date'}"/>
|
||||
<filter string="Expected Date" icon="terp-go-month" domain="[]" context="{'group_by':'min_date'}"/>
|
||||
<filter string="Origin" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'origin'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
@@ -1397,9 +1397,9 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Stock Moves">
|
||||
<group col="8" colspan="4">
|
||||
<filter icon="terp-stock" string="Done" name="done" domain="[('state','=','done')]" help="Stock moves"/>
|
||||
<filter icon="terp-dialog-close" string="Done" name="done" domain="[('state','=','done')]" help="Stock moves"/>
|
||||
<filter icon="terp-stock" string="Future" name="future" domain="[('state','in',('assigned','confirmed','waiting'))]" help="Future stock moves"/>
|
||||
<filter icon="terp-stock" string="Ready" name="ready" domain="[('state','=','assigned')]" help="Future stock moves that are ready"/>
|
||||
<filter icon="terp-camera_test" string="Ready" name="ready" domain="[('state','=','assigned')]" help="Future stock moves that are ready"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="product_id"/>
|
||||
<field name="location_id" string="Location" domain="['|',('location_id','ilike',self),('location_dest_id','ilike',self)]"/>
|
||||
@@ -1407,18 +1407,18 @@
|
||||
<field name="date_planned"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="4" col="8">
|
||||
<filter string="Product" name="by_product" icon="terp-stock" domain="[]" context="{'group_by':'product_id'}"/>
|
||||
<filter string="Lot" name="prodlot_id" icon="terp-stock" domain="[]" context="{'group_by':'prodlot_id'}"/>
|
||||
<filter string="Packing" name="picking_id" icon="terp-stock" domain="[]" context="{'group_by':'picking_id'}"/>
|
||||
<group expand="0" string="Group By..." colspan="4" col="8">
|
||||
<filter string="Product" name="by_product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
|
||||
<filter string="Lot" name="prodlot_id" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'prodlot_id'}"/>
|
||||
<filter string="Packing" name="picking_id" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'picking_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Source" icon="terp-stock" domain="[]" context="{'group_by':'location_id'}"/>
|
||||
<filter string="Destination" icon="terp-stock" domain="[]" context="{'group_by':'location_dest_id'}"/>
|
||||
<filter string="Source" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'location_id'}"/>
|
||||
<filter string="Destination" icon="terp-gtk-jump-to-ltr" domain="[]" context="{'group_by':'location_dest_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-stock" string="State" domain="[]" context="{'group_by':'state'}" />
|
||||
<filter icon="terp-stock_effects-object-colorize" string="State" domain="[]" context="{'group_by':'state'}" />
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Creation" icon="terp-stock" domain="[]" context="{'group_by':'date'}"/>
|
||||
<filter string="Expected" icon="terp-stock" domain="[]" context="{'group_by':'date_planned'}"/>
|
||||
<filter string="Creation" icon="terp-go-month" domain="[]" context="{'group_by':'date'}"/>
|
||||
<filter string="Expected" icon="terp-go-month" domain="[]" context="{'group_by':'date_planned'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
@@ -1451,7 +1451,7 @@
|
||||
<field name="partner_id" string="Supplier"/>
|
||||
<field name="product_id"/>
|
||||
<field name="product_qty" />
|
||||
<field name="product_uom" string="Uint Of Measure"/>
|
||||
<field name="product_uom" string="Unit Of Measure"/>
|
||||
<field name="prodlot_id" string="Lot" groups="base.group_extended"/>
|
||||
<field name="date_planned"/>
|
||||
<field name="date_expected"/>
|
||||
@@ -1526,9 +1526,9 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Stock Moves">
|
||||
<group col="8" colspan="4">
|
||||
<filter icon="terp-stock" name="receive" string="To Receive" domain="[('state','in',('confirmed','assigned'))]" help="Stock to be received"/>
|
||||
<filter icon="terp-stock" string="Back Orders" domain="[('backorder_id','!=',False)]" help="Back Orders"/>
|
||||
<filter icon="terp-stock" string="Planned Today" domain="[('date_planned::date','=',time.strftime('%%Y-%%m-%%d'))]" help="Orders planned for today"/>
|
||||
<filter icon="terp-gtk-go-back-rtl" name="receive" string="To Receive" domain="[('state','in',('confirmed','assigned'))]" help="Stock to be received"/>
|
||||
<filter icon="terp-accessories-archiver-minus" string="Back Orders" domain="[('backorder_id','!=',False)]" help="Back Orders"/>
|
||||
<filter icon="terp-go-today" string="Planned Today" domain="[('date_planned::date','=',time.strftime('%%Y-%%m-%%d'))]" help="Orders planned for today"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="origin" string="Latest Procurement"/>
|
||||
<field name="partner_id" string="Supplier"/>
|
||||
@@ -1539,12 +1539,12 @@
|
||||
<field name="tracking_id" context="{'tracking_lot': self}" />
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="4" col="8">
|
||||
<filter string="Product" icon="terp-stock" domain="[]" context="{'group_by':'product_id'}"/>
|
||||
<filter string="State" icon="terp-stock" domain="[]" context="{'group_by':'state'}"/>
|
||||
<group expand="0" string="Group By..." colspan="4" col="8">
|
||||
<filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
|
||||
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Order Date" icon="terp-stock" domain="[]" context="{'group_by':'date'}"/>
|
||||
<filter string="Expected Date" icon="terp-stock" domain="[]" context="{'group_by':'date_expected'}" />
|
||||
<filter string="Order Date" icon="terp-go-month" domain="[]" context="{'group_by':'date'}"/>
|
||||
<filter string="Expected Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_expected'}" />
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
|
||||
@@ -239,7 +239,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Stock and Sales Forecast">
|
||||
<group col='10' colspan='4'>
|
||||
<filter icon="terp-purchase" string="Validated" domain="[('state','=','validated')]" separator="1"/>
|
||||
<filter icon="terp-camera_test" string="Validated" domain="[('state','=','validated')]" separator="1"/>
|
||||
<field name="company_id" select="1" widget="selection"/>
|
||||
<field name="warehouse_id" select="1" widget="selection"/>
|
||||
<field name="period_id" select="1" widget="selection"/>
|
||||
|
||||
@@ -255,8 +255,8 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Survey">
|
||||
<group col='10' colspan='4'>
|
||||
<filter icon="terp-crm" string="Draft" domain="[('state','=','draft')]"/>
|
||||
<filter string="Open" icon="terp-stock" domain="[('state','=','open')]"/>
|
||||
<filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]"/>
|
||||
<filter string="Open" icon="terp-check" domain="[('state','=','open')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="title" select="1"/>
|
||||
<field name="type" select="1" widget="selection"/>
|
||||
@@ -1065,13 +1065,13 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Survey">
|
||||
<group col='10' colspan='4'>
|
||||
<filter icon="terp-crm" string="Unanswered" domain="[('state','=','waiting_answer')]"/>
|
||||
<filter icon="terp-stock" string="Late" domain="[('date_deadline','<',current_date)]"/>
|
||||
<filter icon="terp-emblem-important" string="Unanswered" domain="[('state','=','waiting_answer')]"/>
|
||||
<filter icon="terp-gtk-media-pause" string="Late" domain="[('date_deadline','<',current_date)]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="survey_id" widget="selection" select="1"/>
|
||||
<field name="email" select="1"/>
|
||||
<field name="user_id" select="1" widget="selection" default="1">
|
||||
<filter string="MY" icon="terp-partner" domain="[('user_id','=',uid)]"/>
|
||||
<filter string="MY" icon="terp-personal" domain="[('user_id','=',uid)]"/>
|
||||
</field>
|
||||
</group>
|
||||
</search>
|
||||
|
||||
Reference in New Issue
Block a user