[MERGE] forward port of branch saas-5 up to 651e5ac
This commit is contained in:
commit
0eb602dd61
|
@ -480,9 +480,14 @@ class MassMailing(osv.Model):
|
||||||
def on_change_model_and_list(self, cr, uid, ids, mailing_model, list_ids, context=None):
|
def on_change_model_and_list(self, cr, uid, ids, mailing_model, list_ids, context=None):
|
||||||
value = {}
|
value = {}
|
||||||
if mailing_model == 'mail.mass_mailing.contact':
|
if mailing_model == 'mail.mass_mailing.contact':
|
||||||
list_ids = map(lambda item: item if isinstance(item, (int, long)) else [lid for lid in item[2]], list_ids)
|
mailing_list_ids = set()
|
||||||
if list_ids:
|
for item in list_ids:
|
||||||
value['mailing_domain'] = "[('list_id', 'in', %s)]" % list_ids
|
if isinstance(item, (int, long)):
|
||||||
|
mailing_list_ids.add(item)
|
||||||
|
elif len(item) == 3:
|
||||||
|
mailing_list_ids |= set(item[2])
|
||||||
|
if mailing_list_ids:
|
||||||
|
value['mailing_domain'] = "[('list_id', 'in', %s)]" % list(mailing_list_ids)
|
||||||
else:
|
else:
|
||||||
value['mailing_domain'] = "[('list_id', '=', False)]"
|
value['mailing_domain'] = "[('list_id', '=', False)]"
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -186,11 +186,17 @@
|
||||||
<form string="Mass Mailing" version="7.0">
|
<form string="Mass Mailing" version="7.0">
|
||||||
<header>
|
<header>
|
||||||
<button name="action_test_mailing" type="object"
|
<button name="action_test_mailing" type="object"
|
||||||
class="oe_highlight" string="Test Mailing" states="draft"/>
|
class="oe_highlight" string="Test Mailing"
|
||||||
<button name="send_mail" type="object" states="draft,test"
|
attrs="{'invisible': ['|', ('state', '!=', 'draft'), ('body_html', '=', False)]}"/>
|
||||||
|
<button name="action_test_mailing" type="object"
|
||||||
|
attrs="{'invisible': ['&', ('state', '=', 'draft'), ('body_html', '!=', False)]}"
|
||||||
|
string="Test Mailing"/>
|
||||||
|
<button name="send_mail" type="object"
|
||||||
|
attrs="{'invisible': ['|', ('state', '=', 'done'), ('body_html', '=', False)]}"
|
||||||
class="oe_highlight" string="Send to All"/>
|
class="oe_highlight" string="Send to All"/>
|
||||||
<button name="action_test_mailing" type="object" states="test,done"
|
<button name="send_mail" type="object"
|
||||||
string="Send Test Sample"/>
|
attrs="{'invisible': ['&', ('state', '!=', 'done'), ('body_html', '!=', False)]}"
|
||||||
|
string="Send to All"/>
|
||||||
<field name="state" widget="statusbar"/>
|
<field name="state" widget="statusbar"/>
|
||||||
</header>
|
</header>
|
||||||
<div class="oe_form_box_info oe_text_center" attrs="{'invisible': [('scheduled', '=', 0)]}">
|
<div class="oe_form_box_info oe_text_center" attrs="{'invisible': [('scheduled', '=', 0)]}">
|
||||||
|
@ -250,9 +256,11 @@
|
||||||
</group>
|
</group>
|
||||||
<notebook>
|
<notebook>
|
||||||
<page string="Mail Body">
|
<page string="Mail Body">
|
||||||
<button name="action_edit_html" type="object" string="Design Email" class="oe_highlight" states="draft"/>
|
<button name="action_edit_html" type="object" string="Design Email" class="oe_highlight"
|
||||||
<button name="action_edit_html" type="object" string="Change Email Design" states="test"/>
|
attrs="{'invisible': [('body_html', '!=', False)]}"/>
|
||||||
<div attrs="{'invisible' : ['|', '|', ('state', '=', 'done'), ('body_html','!=',False), ('mailing_domain', '=', False)]}" class="oe_view_nocontent oe_clear">
|
<button name="action_edit_html" type="object" string="Change Email Design"
|
||||||
|
attrs="{'invisible': [('body_html', '=', False)]}"/>
|
||||||
|
<div attrs="{'invisible' : ['|', ('state', '=', 'done'), ('body_html','!=',False)]}" class="oe_view_nocontent oe_clear">
|
||||||
<p class="oe_view_nocontent_create oe_edit_only">
|
<p class="oe_view_nocontent_create oe_edit_only">
|
||||||
Click to design your email.
|
Click to design your email.
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -325,8 +325,8 @@ class mrp_bom(osv.osv):
|
||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
bom_id = self._bom_find(cr, uid, bom_line_id.product_uom.id, product_id=bom_line_id.product_id.id, properties=properties)
|
bom_id = self._bom_find(cr, uid, bom_line_id.product_uom.id, product_id=bom_line_id.product_id.id, properties=properties)
|
||||||
bom2 = self.browse(cr, uid, bom_id)
|
if bom_id:
|
||||||
if bom2:
|
bom2 = self.browse(cr, uid, bom_id)
|
||||||
res = self._bom_explode(cr, uid, bom2, bom_line_id.product_id, factor,
|
res = self._bom_explode(cr, uid, bom2, bom_line_id.product_id, factor,
|
||||||
properties=properties, level=level + 10, previous_products=all_prod, master_bom=master_bom)
|
properties=properties, level=level + 10, previous_products=all_prod, master_bom=master_bom)
|
||||||
result = result + res[0]
|
result = result + res[0]
|
||||||
|
|
Loading…
Reference in New Issue