summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorJigar Amin <jam@tinyerp.com>2012-11-20 14:49:44 +0530
committerJigar Amin <jam@tinyerp.com>2012-11-20 14:49:44 +0530
commit3cebd09f9cf5f2ee409bb34e91ceaa241558e371 (patch)
treebb23910c8c9b09fecfd0ba8f97dadfc7d7d13f1a /addons
parent1387cd9bcaa413068e26db2d66000ca1c22261f6 (diff)
parent87d4e235a4bd5c7ef2fcdb0de019098464db3666 (diff)
[MERGE] Sync with trunk
bzr revid: jam@tinyerp.com-20121120091944-o59v1foebgrq4zpb
Diffstat (limited to 'addons')
-rw-r--r--addons/crm/crm_lead.py15
-rw-r--r--addons/crm/crm_lead_view.xml66
-rw-r--r--addons/crm_claim/crm_claim.py2
-rw-r--r--addons/crm_helpdesk/crm_helpdesk.py2
-rw-r--r--addons/hr_recruitment/hr_recruitment.py17
-rw-r--r--addons/lunch/lunch_demo.xml36
-rw-r--r--addons/lunch/security/lunch_security.xml11
-rw-r--r--addons/mail/mail_thread.py2
-rw-r--r--addons/membership/membership.py9
-rw-r--r--addons/project/project.py2
10 files changed, 97 insertions, 65 deletions
diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py
index 547b25af27c..ae9537072a2 100644
--- a/addons/crm/crm_lead.py
+++ b/addons/crm/crm_lead.py
@@ -50,7 +50,7 @@ class crm_lead(base_stage, format_address, osv.osv):
def _get_default_stage_id(self, cr, uid, context=None):
""" Gives default stage_id """
section_id = self._get_default_section_id(cr, uid, context=context)
- return self.stage_find(cr, uid, [], section_id, [('state', '=', 'draft'), ('type', '=', 'both')], context=context)
+ return self.stage_find(cr, uid, [], section_id, [('state', '=', 'draft')], context=context)
def _resolve_section_id_from_context(self, cr, uid, context=None):
""" Returns ID of section based on the value of 'section_id'
@@ -224,11 +224,7 @@ class crm_lead(base_stage, format_address, osv.osv):
multi='day_close', type="float", store=True),
'state': fields.related('stage_id', 'state', type="selection", store=True,
selection=crm.AVAILABLE_STATES, string="Status", readonly=True,
- help='The Status is set to \'Draft\', when a case is created.\
- If the case is in progress the Status is set to \'Open\'.\
- When the case is over, the Status is set to \'Done\'.\
- If the case needs to be reviewed then the Status is \
- set to \'Pending\'.'),
+ help='The Status is set to \'Draft\', when a case is created. If the case is in progress the Status is set to \'Open\'. When the case is over, the Status is set to \'Done\'. If the case needs to be reviewed then the Status is set to \'Pending\'.'),
# Only used for type opportunity
'probability': fields.float('Success Rate (%)',group_operator="avg"),
@@ -328,7 +324,7 @@ class crm_lead(base_stage, format_address, osv.osv):
cases = self.browse(cr, uid, ids2, context=context)
return self._action(cr, uid, cases, False, context=context)
- def stage_find(self, cr, uid, cases, section_id, domain=[], order='sequence', context=None):
+ def stage_find(self, cr, uid, cases, section_id, domain=None, order='sequence', context=None):
""" Override of the base.stage method
Parameter of the stage search taken from the lead:
- type: stage type must be the same or 'both'
@@ -341,6 +337,9 @@ class crm_lead(base_stage, format_address, osv.osv):
# collect all section_ids
section_ids = []
types = ['both']
+ if not cases :
+ type = context.get('default_type')
+ types += [type]
if section_id:
section_ids.append(section_id)
for lead in cases:
@@ -833,7 +832,7 @@ class crm_lead(base_stage, format_address, osv.osv):
}
for line in msg.get('body', '').split('\n'):
line = line.strip()
- res = tools.misc.command_re.match(line)
+ res = tools.command_re.match(line)
if res and maps.get(res.group(1).lower()):
key = maps.get(res.group(1).lower())
update_vals[key] = res.group(2).lower()
diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml
index 5ff1bc15f69..465982ee3aa 100644
--- a/addons/crm/crm_lead_view.xml
+++ b/addons/crm/crm_lead_view.xml
@@ -14,9 +14,9 @@
<record id="action_crm_lead_unread" model="ir.values">
<field name="name">action_crm_lead_unread</field>
<field name="action_id" ref="actions_server_crm_lead_unread"/>
- <field name="value" eval="'ir.actions.server,' + str(ref('actions_server_crm_lead_unread'))" />
+ <field name="value" eval="'ir.actions.server,' + str(ref('actions_server_crm_lead_unread'))"/>
<field name="key">action</field>
- <field name="model_id" ref="model_crm_lead" />
+ <field name="model_id" ref="model_crm_lead"/>
<field name="model">crm.lead</field>
<field name="key2">client_action_multi</field>
</record>
@@ -32,9 +32,9 @@
<record id="action_crm_lead_read" model="ir.values">
<field name="name">action_crm_lead_read</field>
<field name="action_id" ref="actions_server_crm_lead_read"/>
- <field name="value" eval="'ir.actions.server,' + str(ref('actions_server_crm_lead_read'))" />
+ <field name="value" eval="'ir.actions.server,' + str(ref('actions_server_crm_lead_read'))"/>
<field name="key">action</field>
- <field name="model_id" ref="model_crm_lead" />
+ <field name="model_id" ref="model_crm_lead"/>
<field name="model">crm.lead</field>
<field name="key2">client_action_multi</field>
</record>
@@ -143,7 +143,7 @@
<div class="oe_right oe_button_box" name="buttons">
<button type="action"
name="%(act_crm_opportunity_crm_phonecall_new)d"
- string="Phone Calls" />
+ string="Phone Calls"/>
</div>
<div class="oe_title">
<label for="name" class="oe_edit_only" string="Lead Description"/>
@@ -167,13 +167,13 @@
</div>
</group>
<group>
- <label for="contact_name" />
+ <label for="contact_name"/>
<div>
<field name="contact_name" class="oe_inline"/>,
<field name="title" placeholder="Title" domain="[('domain', '=', 'contact')]" class="oe_inline" options='{"no_open": True}'/>
</div>
<field name="email_from" widget="email"/>
- <field name="function" />
+ <field name="function"/>
<field name="phone"/>
<field name="mobile"/>
<field name="fax"/>
@@ -209,14 +209,14 @@
<group string="Categorization">
<field name="company_id"
groups="base.group_multi_company"
- widget="selection" colspan="2" />
+ widget="selection" colspan="2"/>
<field name="type_id" widget="selection"/>
<field name="channel_id" widget="selection"/>
<field name="referred"/>
<field name="state" groups="base.group_no_one"/>
</group>
<group string="Mailings">
- <field name="opt_out" />
+ <field name="opt_out"/>
</group>
</group>
</page>
@@ -253,12 +253,12 @@
<field name="create_date" groups="base.group_no_one"/>
<field name="name"/>
<field name="contact_name"/>
- <field name="country_id" invisible="context.get('invisible_country', True)" />
+ <field name="country_id" invisible="context.get('invisible_country', True)"/>
<field name="email_from"/>
<field name="phone"/>
<field name="stage_id"/>
<field name="user_id" invisible="1"/>
- <field name="section_id" invisible="context.get('invisible_section', True)" />
+ <field name="section_id" invisible="context.get('invisible_section', True)"/>
<field name="state" invisible="1"/>
<field name="type_id" invisible="1"/>
<field name="referred" invisible="1"/>
@@ -276,8 +276,8 @@
<field name="arch" type="xml">
<calendar string="Leads Generation"
date_start="date_action" color="user_id">
- <field name="name" />
- <field name="partner_name" />
+ <field name="name"/>
+ <field name="partner_name"/>
</calendar>
</field>
</record>
@@ -354,14 +354,14 @@
<field name="arch" type="xml">
<search string="Search Leads">
<field name="name" string="Lead / Customer" filter_domain="['|','|',('partner_name','ilike',self),('email_from','ilike',self),('name','ilike',self)]"/>
- <field name="categ_ids" string="Category" filter_domain="[('categ_ids','ilike',self)]" />
+ <field name="categ_ids" string="Category" filter_domain="[('categ_ids','ilike',self)]"/>
<field name="create_date"/>
<filter icon="terp-mail-message-new" string="Unread Messages" help="Unread messages" name="message_unread" domain="[('message_unread','=',True)]"/>
<separator/>
<filter icon="terp-check" string="New" name="new" help="New Leads" domain="[('state','=','draft')]"/>
<filter icon="terp-camera_test" string="In Progress" name="open" domain="[('state','=','open')]"/>
<separator/>
- <filter string="Unassigned Leads" icon="terp-personal-" domain="[('user_id','=', False)]" help="Unassigned Leads" />
+ <filter string="Unassigned Leads" icon="terp-personal-" domain="[('user_id','=', False)]" help="Unassigned Leads"/>
<separator/>
<filter string="Leads Assigned to Me or My Team(s)" icon="terp-personal+" context="{'invisible_section': False}"
domain="['|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
@@ -373,8 +373,8 @@
<filter string="Salesperson" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<filter string="Team" icon="terp-personal+" domain="[]" context="{'group_by':'section_id'}"/>
<filter string="Referrer" icon="terp-personal" domain="[]" context="{'group_by':'referred'}"/>
- <filter string="Campaign" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'type_id'}" />
- <filter string="Channel" icon="terp-call-start" domain="[]" context="{'group_by':'channel_id'}" />
+ <filter string="Campaign" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'type_id'}"/>
+ <filter string="Channel" icon="terp-call-start" domain="[]" context="{'group_by':'channel_id'}"/>
<separator orientation="vertical"/>
<filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}"/>
<filter string="Creation" help="Create date" icon="terp-go-month" domain="[]" context="{'group_by':'create_date'}" groups="base.group_no_one"/>
@@ -415,7 +415,7 @@
name="action_makeMeeting"
type="object"
context="{'search_default_attendee_id': active_id, 'default_attendee_id' : active_id}"
- />
+ />
</div>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
@@ -452,7 +452,7 @@
<label for="section_id"/>
<div>
<field name="section_id" widget="selection"/>
- <button name="case_escalate" string="Escalate" type="object" states="draft,open,pending" />
+ <button name="case_escalate" string="Escalate" type="object" states="draft,open,pending"/>
</div>
</group>
<group>
@@ -485,12 +485,12 @@
</group>
<group>
- <label for="contact_name" />
+ <label for="contact_name"/>
<div>
<field name="contact_name" class="oe_inline"/>
<field name="title" placeholder="Title" domain="[('domain', '=', 'contact')]" options='{"no_open": True}' class="oe_inline"/>
</div>
- <field name="function" />
+ <field name="function"/>
<field name="mobile"/>
<field name="fax"/>
</group>
@@ -500,7 +500,7 @@
<field name="channel_id" widget="selection"/>
</group>
<group string="Mailings">
- <field name="opt_out" />
+ <field name="opt_out"/>
</group>
<group string="Misc">
<field name="active"/>
@@ -542,15 +542,15 @@
<field name="create_date" groups="base.group_no_one"/>
<field name="name" string="Opportunity"/>
<field name="partner_id" string="Customer"/>
- <field name="country_id" invisible="context.get('invisible_country', True)" />
+ <field name="country_id" invisible="context.get('invisible_country', True)"/>
<field name="date_action"/>
- <field name="title_action" />
+ <field name="title_action"/>
<field name="channel_id" invisible="1"/>
<field name="type_id" invisible="1"/>
<field name="stage_id"/>
<field name="planned_revenue" sum="Expected Revenues"/>
<field name="probability" widget="progressbar" avg="Avg. of Probability"/>
- <field name="section_id" invisible="context.get('invisible_section', True)" />
+ <field name="section_id" invisible="context.get('invisible_section', True)"/>
<field name="user_id"/>
<field name="priority" invisible="1"/>
<field name="state" groups="base.group_no_one"/>
@@ -568,30 +568,30 @@
<search string="Search Opportunities">
<field name="name" string="Opportunity / Customer"
filter_domain="['|','|','|',('partner_id','ilike',self),('partner_name','ilike',self),('email_from','ilike',self),('name', 'ilike', self)]"/>
- <field name="categ_ids" string="Category" filter_domain="[('categ_ids','ilike', self)]" />
+ <field name="categ_ids" string="Category" filter_domain="[('categ_ids','ilike', self)]"/>
<filter icon="terp-mail-message-new" string="Unread Messages" help="Unread messages" name="message_unread" domain="[('message_unread','=',True)]"/>
<separator/>
<filter icon="terp-check" string="New" help="New Opportunities" name="new" domain="[('state','=','draft')]"/>
<filter icon="terp-camera_test" string="In Progress" help="Open Opportunities" name="open" domain="[('state','=','open')]"/>
<separator/>
- <filter string="Unassigned Opportunities" icon="terp-personal-" domain="[('user_id','=', False)]" help="Unassigned Opportunities" />
+ <filter string="Unassigned Opportunities" icon="terp-personal-" domain="[('user_id','=', False)]" help="Unassigned Opportunities"/>
<separator/>
<filter string="Opportunities Assigned to Me or My Team(s)" icon="terp-personal+"
domain="['|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]" context="{'invisible_section': False}"
- help="Opportunities that are assigned to either me or one of the sale teams I manage" />
+ help="Opportunities that are assigned to either me or one of the sale teams I manage"/>
<field name="user_id"/>
<field name="section_id" context="{'invisible_section': False, 'default_section_id': self}"/>
<field name="partner_id"/>
<group expand="0" string="Group By..." colspan="16">
- <filter string="Salesperson" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}" />
+ <filter string="Salesperson" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<filter string="Team" help="Sales Team" icon="terp-personal+" domain="[]" context="{'group_by':'section_id'}"/>
<filter string="Customer" help="Partner" icon="terp-personal+" domain="[]" context="{'group_by':'partner_id'}"/>
- <filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}" />
- <filter string="Priority" icon="terp-rating-rated" domain="[]" context="{'group_by':'priority'}" />
+ <filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}"/>
+ <filter string="Priority" icon="terp-rating-rated" domain="[]" context="{'group_by':'priority'}"/>
<filter string="Campaign" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'type_id'}"/>
- <filter string="Channel" icon="terp-call-start" domain="[]" context="{'group_by':'channel_id'}" />
+ <filter string="Channel" icon="terp-call-start" domain="[]" context="{'group_by':'channel_id'}"/>
<filter string="Creation" icon="terp-go-month" domain="[]" context="{'group_by':'create_date'}" groups="base.group_no_one"/>
- <filter string="Exp.Closing" icon="terp-go-month" help="Expected Closing" domain="[]" context="{'group_by':'date_deadline'}" />
+ <filter string="Exp.Closing" icon="terp-go-month" help="Expected Closing" domain="[]" context="{'group_by':'date_deadline'}"/>
</group>
<group string="Display">
<filter string="Show Sales Team" icon="terp-personal+" context="{'invisible_section': False}" domain="[]" help="Show Sales Team"/>
diff --git a/addons/crm_claim/crm_claim.py b/addons/crm_claim/crm_claim.py
index 8308e5420d0..70dcc18baf7 100644
--- a/addons/crm_claim/crm_claim.py
+++ b/addons/crm_claim/crm_claim.py
@@ -224,7 +224,7 @@ class crm_claim(base_stage, osv.osv):
}
for line in msg['body'].split('\n'):
line = line.strip()
- res = tools.misc.command_re.match(line)
+ res = tools.command_re.match(line)
if res and maps.get(res.group(1).lower()):
key = maps.get(res.group(1).lower())
update_vals[key] = res.group(2).lower()
diff --git a/addons/crm_helpdesk/crm_helpdesk.py b/addons/crm_helpdesk/crm_helpdesk.py
index 276dd0b4b49..373cf53aed6 100644
--- a/addons/crm_helpdesk/crm_helpdesk.py
+++ b/addons/crm_helpdesk/crm_helpdesk.py
@@ -133,7 +133,7 @@ class crm_helpdesk(base_state, base_stage, osv.osv):
}
for line in msg['body'].split('\n'):
line = line.strip()
- res = tools.misc.command_re.match(line)
+ res = tools.command_re.match(line)
if res and maps.get(res.group(1).lower()):
key = maps.get(res.group(1).lower())
update_vals[key] = res.group(2).lower()
diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py
index 155f20daf4d..de1539da55a 100644
--- a/addons/hr_recruitment/hr_recruitment.py
+++ b/addons/hr_recruitment/hr_recruitment.py
@@ -356,7 +356,8 @@ class hr_applicant(base_stage, osv.Model):
"""
if isinstance(ids, (str, int, long)):
ids = [ids]
- if update_vals is None: vals = {}
+ if update_vals is None:
+ update_vals = {}
update_vals.update({
'description': msg.get('body'),
@@ -373,12 +374,12 @@ class hr_applicant(base_stage, osv.Model):
}
for line in msg.get('body', '').split('\n'):
line = line.strip()
- res = tools.misc.command_re.match(line)
+ res = tools.command_re.match(line)
if res and maps.get(res.group(1).lower(), False):
key = maps.get(res.group(1).lower())
update_vals[key] = res.group(2).lower()
- return super(hr_applicant, self).message_update(cr, uids, ids, update_vals=update_vals, context=context)
+ return super(hr_applicant, self).message_update(cr, uid, ids, msg, update_vals=update_vals, context=context)
def create(self, cr, uid, vals, context=None):
obj_id = super(hr_applicant, self).create(cr, uid, vals, context=context)
@@ -420,7 +421,7 @@ class hr_applicant(base_stage, osv.Model):
self.write(cr, uid, [applicant.id], {'emp_id': emp_id}, context=context)
self.case_close(cr, uid, [applicant.id], context)
else:
- raise osv.except_osv(_('Warning!'),_('You must define Applied Job for this applicant.'))
+ raise osv.except_osv(_('Warning!'), _('You must define Applied Job for this applicant.'))
action_model, action_id = model_data.get_object_reference(cr, uid, 'hr', 'open_view_employee_list')
dict_act_window = act_window.read(cr, uid, action_id, [])
@@ -433,13 +434,13 @@ class hr_applicant(base_stage, osv.Model):
"""Overrides cancel for crm_case for setting probability
"""
res = super(hr_applicant, self).case_cancel(cr, uid, ids, context)
- self.write(cr, uid, ids, {'probability' : 0.0})
+ self.write(cr, uid, ids, {'probability': 0.0})
return res
def case_pending(self, cr, uid, ids, context=None):
"""Marks case as pending"""
res = super(hr_applicant, self).case_pending(cr, uid, ids, context)
- self.write(cr, uid, ids, {'probability' : 0.0})
+ self.write(cr, uid, ids, {'probability': 0.0})
return res
def case_reset(self, cr, uid, ids, context=None):
@@ -452,7 +453,7 @@ class hr_applicant(base_stage, osv.Model):
def set_priority(self, cr, uid, ids, priority, *args):
"""Set applicant priority
"""
- return self.write(cr, uid, ids, {'priority' : priority})
+ return self.write(cr, uid, ids, {'priority': priority})
def set_high_priority(self, cr, uid, ids, *args):
"""Set applicant priority to high
@@ -475,7 +476,7 @@ class hr_applicant(base_stage, osv.Model):
return self.message_post(cr, uid, ids, body=_("Stage changed to <b>%s</b>.") % (stage_name), context=context)
def case_get_note_msg_prefix(self, cr, uid, id, context=None):
- return 'Applicant'
+ return 'Applicant'
def case_open_send_note(self, cr, uid, ids, context=None):
message = _("Applicant has been set <b>in progress</b>.")
diff --git a/addons/lunch/lunch_demo.xml b/addons/lunch/lunch_demo.xml
index 9e92291b62d..7488208fd42 100644
--- a/addons/lunch/lunch_demo.xml
+++ b/addons/lunch/lunch_demo.xml
@@ -100,28 +100,28 @@
</record>
<record model="lunch.order" id="order_1">
- <field name="user_id" ref="base.user_root"/>
+ <field name="user_id" ref="base.user_demo"/>
<field name="date" eval="time.strftime('2012-10-23')"/>
<field name="order_line_ids" eval="[]"/>
<field name="state">new</field>
</record>
<record model="lunch.order" id="order_2">
- <field name="user_id" ref="base.user_root"/>
+ <field name="user_id" ref="base.user_demo"/>
<field name="date" eval="time.strftime('2012-10-22')"/>
<field name="order_line_ids" eval="[]"/>
<field name="state">confirmed</field>
</record>
<record model="lunch.order" id="order_3">
- <field name="user_id" ref="base.user_root"/>
+ <field name="user_id" ref="base.user_demo"/>
<field name="date" eval="time.strftime('2012-10-24')"/>
<field name="order_line_ids" eval="[]"/>
- <field name="state">cancelled</field>
+ <field name="state">partially</field>
</record>
<record model="lunch.order.line" id="order_line_1">
- <field name="user_id" ref="base.user_root"/>
+ <field name="user_id" ref="base.user_demo"/>
<field name="product_id" ref="product_Bolognese"/>
<field name="date" eval="time.strftime('2012-10-23')"/>
<field name="state">new</field>
@@ -131,7 +131,7 @@
</record>
<record model="lunch.order.line" id="order_line_2">
- <field name="user_id" ref="base.user_root"/>
+ <field name="user_id" ref="base.user_demo"/>
<field name="product_id" ref="product_italiana"/>
<field name="date" eval="time.strftime('2012-10-22')"/>
<field name="state">confirmed</field>
@@ -141,7 +141,7 @@
</record>
<record model="lunch.order.line" id="order_line_3">
- <field name="user_id" ref="base.user_root"/>
+ <field name="user_id" ref="base.user_demo"/>
<field name="product_id" ref="product_gouda"/>
<field name="date" eval="time.strftime('2012-10-24')"/>
<field name="state">cancelled</field>
@@ -150,9 +150,18 @@
<field name="order_id" ref="order_3"/>
</record>
+ <record model="lunch.order.line" id="order_line_4">
+ <field name="user_id" ref="base.user_demo"/>
+ <field name="product_id" ref="product_chicken_curry"/>
+ <field name="date" eval="time.strftime('2012-10-24')"/>
+ <field name="state">confirmed</field>
+ <field name="supplier" ref="partner_coin_gourmand"/>
+ <field name="note">+Salad +Tomatoes +Eggs</field>
+ <field name="order_id" ref="order_3"/>
+ </record>
<record model="lunch.cashmove" id="cashmove_1">
- <field name="user_id" ref="base.user_root"/>
+ <field name="user_id" ref="base.user_demo"/>
<field name="date" eval="time.strftime('2012-10-23')"/>
<field name="description">Pizza Italiana</field>
<field name="amount">-7.40</field>
@@ -161,7 +170,16 @@
</record>
<record model="lunch.cashmove" id="cashmove_2">
- <field name="user_id" ref="base.user_root"/>
+ <field name="user_id" ref="base.user_demo"/>
+ <field name="date" eval="time.strftime('2012-10-24')"/>
+ <field name="description">Chicken curry</field>
+ <field name="amount">-2.60</field>
+ <field name="order_id" ref="order_3"/>
+ <field name="state">order</field>
+ </record>
+
+ <record model="lunch.cashmove" id="cashmove_3">
+ <field name="user_id" ref="base.user_demo"/>
<field name="date" eval="time.strftime('2012-10-24')"/>
<field name="description">Payment: 5 lunch tickets (6€)</field>
<field name="amount">30</field>
diff --git a/addons/lunch/security/lunch_security.xml b/addons/lunch/security/lunch_security.xml
index ad45ec92511..654f844c876 100644
--- a/addons/lunch/security/lunch_security.xml
+++ b/addons/lunch/security/lunch_security.xml
@@ -1,12 +1,19 @@
<?xml version="1.0" ?>
<openerp>
<data>
+ <record model="ir.module.category" id="module_lunch_category">
+ <field name="name">Lunch</field>
+ <field name="description">Helps you handle your lunch needs, if you are a manager you will be able to create new products, cashmoves and to confirm or cancel orders.</field>
+ <field name="sequence">16</field>
+ </record>
<record id="group_lunch_user" model="res.groups">
- <field name="name">Lunch / User</field>
+ <field name="name">User</field>
+ <field name="category_id" ref="module_lunch_category"/>
</record>
<record id="group_lunch_manager" model="res.groups">
- <field name="name">Lunch / Manager</field>
+ <field name="name">Manager</field>
<field name="implied_ids" eval="[(4, ref('group_lunch_user'))]"/>
+ <field name="category_id" ref="module_lunch_category"/>
</record>
</data>
</openerp>
diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py
index ee1a015396b..a809f7e8e2e 100644
--- a/addons/mail/mail_thread.py
+++ b/addons/mail/mail_thread.py
@@ -341,7 +341,7 @@ class mail_thread(osv.AbstractModel):
message = self.pool.get('mail.message').browse(cr, uid, message_ids[0], context=context)
_logger.debug('Routing mail with Message-Id %s: direct reply to a private message: %s, custom_values: %s, uid: %s',
message_id, message.id, custom_values, uid)
- return [(False, 0, custom_values, uid)]
+ return [(message.model, message.res_id, custom_values, uid)]
# 2. Look for a matching mail.alias entry
# Delivered-To is a safe bet in most modern MTAs, but we have to fallback on To + Cc values
diff --git a/addons/membership/membership.py b/addons/membership/membership.py
index d39bdb6d903..8851747d77f 100644
--- a/addons/membership/membership.py
+++ b/addons/membership/membership.py
@@ -470,7 +470,14 @@ class Product(osv.osv):
'membership_date_from': fields.date('Date from', help='Date from which membership becomes active.'),
'membership_date_to': fields.date('Date to', help='Date until which membership remains active.'),
}
-
+ def _check_end_date(self, cr, uid, ids, context=None):
+ for membership in self.browse(cr, uid, ids, context=context):
+ if membership.membership_date_to < membership.membership_date_from:
+ return False
+ return True
+ _constraints = [
+ (_check_end_date, 'Error ! Ending Date cannot be set before Beginning Date.', ['membership_date_to']),
+ ]
_defaults = {
'membership': False,
}
diff --git a/addons/project/project.py b/addons/project/project.py
index 9c28fadeab9..68122d1a614 100644
--- a/addons/project/project.py
+++ b/addons/project/project.py
@@ -1247,7 +1247,7 @@ class task(base_stage, osv.osv):
}
for line in msg['body'].split('\n'):
line = line.strip()
- res = tools.misc.command_re.match(line)
+ res = tools.command_re.match(line)
if res:
match = res.group(1).lower()
field = maps.get(match)