[MERGE] forward port branch saas-6 up to f8b82bdd63

This commit is contained in:
Christophe Simonis
2017-01-27 15:15:46 +01:00
4 changed files with 17 additions and 3 deletions
+1 -1
View File
@@ -82,7 +82,7 @@ class Usb(Escpos):
def _raw(self, msg):
""" Print any command sent in raw format """
if len(msg) != self.device.write(self.out_ep, msg, self.interface):
if len(msg) != self.device.write(self.out_ep, msg, self.interface, timeout=5000):
self.device.write(self.out_ep, self.errorText, self.interface)
raise TicketNotPrinted()
+2 -1
View File
@@ -11,7 +11,8 @@ class TestMassMailing(osv.TransientModel):
_columns = {
'email_to': fields.char('Recipients', required=True,
help='Comma-separated list of email addresses.'),
'mass_mailing_id': fields.many2one('mail.mass_mailing', 'Mailing', required=True),
'mass_mailing_id': fields.many2one(
'mail.mass_mailing', 'Mailing', required=True, ondelete='cascade'),
}
_defaults = {
@@ -74,6 +74,12 @@ class test_inherits(common.TransactionCase):
self.assertIn(daughter, partner_demo.daughter_ids)
# search the partner from the daughter record
partners = self.env['res.partner'].search([('daughter_ids', 'like', 'not existing daugther')])
self.assertFalse(partners)
partners = self.env['res.partner'].search([('daughter_ids', 'not like', 'not existing daugther')])
self.assertIn(partner_demo, partners)
partners = self.env['res.partner'].search([('daughter_ids', '!=', False)])
self.assertIn(partner_demo, partners)
partners = self.env['res.partner'].search([('daughter_ids', 'in', daughter.ids)])
self.assertIn(partner_demo, partners)
+8 -1
View File
@@ -999,7 +999,14 @@ class expression(object):
if call_null:
o2m_op = 'in' if operator in NEGATIVE_TERM_OPERATORS else 'not in'
push(create_substitution_leaf(leaf, ('id', o2m_op, select_distinct_from_where_not_null(cr, column._fields_id, comodel._table)), model))
# determine ids from column._fields_id
if comodel._fields[column._fields_id].store:
ids1 = select_distinct_from_where_not_null(cr, column._fields_id, comodel._table)
else:
ids2 = comodel.search(cr, uid, [(column._fields_id, '!=', False)], context=context)
recs = comodel.browse(cr, SUPERUSER_ID, ids2, {'prefetch_fields': False})
ids1 = recs.mapped(column._fields_id).ids
push(create_substitution_leaf(leaf, ('id', o2m_op, ids1), model))
elif column._type == 'many2many':
rel_table, rel_id1, rel_id2 = column._sql_names(model)