[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):
|
||||
value = {}
|
||||
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)
|
||||
if list_ids:
|
||||
value['mailing_domain'] = "[('list_id', 'in', %s)]" % list_ids
|
||||
mailing_list_ids = set()
|
||||
for item in 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:
|
||||
value['mailing_domain'] = "[('list_id', '=', False)]"
|
||||
else:
|
||||
|
|
|
@ -186,11 +186,17 @@
|
|||
<form string="Mass Mailing" version="7.0">
|
||||
<header>
|
||||
<button name="action_test_mailing" type="object"
|
||||
class="oe_highlight" string="Test Mailing" states="draft"/>
|
||||
<button name="send_mail" type="object" states="draft,test"
|
||||
class="oe_highlight" string="Test Mailing"
|
||||
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"/>
|
||||
<button name="action_test_mailing" type="object" states="test,done"
|
||||
string="Send Test Sample"/>
|
||||
<button name="send_mail" type="object"
|
||||
attrs="{'invisible': ['&', ('state', '!=', 'done'), ('body_html', '!=', False)]}"
|
||||
string="Send to All"/>
|
||||
<field name="state" widget="statusbar"/>
|
||||
</header>
|
||||
<div class="oe_form_box_info oe_text_center" attrs="{'invisible': [('scheduled', '=', 0)]}">
|
||||
|
@ -250,9 +256,11 @@
|
|||
</group>
|
||||
<notebook>
|
||||
<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="Change Email Design" states="test"/>
|
||||
<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="Design Email" class="oe_highlight"
|
||||
attrs="{'invisible': [('body_html', '!=', False)]}"/>
|
||||
<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">
|
||||
Click to design your email.
|
||||
</p>
|
||||
|
|
|
@ -325,8 +325,8 @@ class mrp_bom(osv.osv):
|
|||
})
|
||||
else:
|
||||
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 bom2:
|
||||
if bom_id:
|
||||
bom2 = self.browse(cr, uid, bom_id)
|
||||
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)
|
||||
result = result + res[0]
|
||||
|
|
Loading…
Reference in New Issue