[MERGE] forward port branch saas-11 up to a0ff1f2ad8

This commit is contained in:
Christophe Simonis
2017-04-21 14:34:11 +02:00
7 changed files with 19 additions and 14 deletions
@@ -25,7 +25,7 @@ class ReportOverdue(models.AbstractModel):
"FROM account_move_line l "
"JOIN account_account_type at ON (l.user_type_id = at.id) "
"JOIN account_move m ON (l.move_id = m.id) "
"WHERE l.partner_id IN %s AND at.type IN ('receivable', 'payable') GROUP BY l.date, l.name, l.ref, l.date_maturity, l.partner_id, at.type, l.blocked, l.amount_currency, l.currency_id, l.move_id, m.name", (((fields.date.today(), ) + (tuple(partner_ids),))))
"WHERE l.partner_id IN %s AND at.type IN ('receivable', 'payable') AND NOT l.reconciled GROUP BY l.date, l.name, l.ref, l.date_maturity, l.partner_id, at.type, l.blocked, l.amount_currency, l.currency_id, l.move_id, m.name", (((fields.date.today(), ) + (tuple(partner_ids),))))
for row in self.env.cr.dictfetchall():
res[row.pop('partner_id')].append(row)
return res
+9 -3
View File
@@ -489,13 +489,19 @@ class MergePartnerAutomatic(models.TransientModel):
counter = 0
for min_id, aggr_ids in self._cr.fetchall():
# exclude partner according to options
if model_mapping and self._partner_use_in(aggr_ids, model_mapping):
# To ensure that the used partners are accessible by the user
partners = self.env['res.partner'].search([('id', 'in', aggr_ids)])
if len(partners) < 2:
continue
# exclude partner according to options
if model_mapping and self._partner_use_in(partners.ids, model_mapping):
continue
self.env['base.partner.merge.line'].create({
'wizard_id': self.id,
'min_id': min_id,
'aggr_ids': aggr_ids,
'aggr_ids': partners.ids,
})
counter += 1
+1 -1
View File
@@ -345,7 +345,7 @@ class SaleOrder(models.Model):
vals = {}
if order.name not in invoices[group_key].origin.split(', '):
vals['origin'] = invoices[group_key].origin + ', ' + order.name
if order.client_order_ref and order.client_order_ref not in invoices[group_key].name.split(', '):
if order.client_order_ref and order.client_order_ref not in invoices[group_key].name.split(', ') and order.client_order_ref != invoices[group_key].name:
vals['name'] = invoices[group_key].name + ', ' + order.client_order_ref
invoices[group_key].write(vals)
if line.qty_to_invoice > 0:
-4
View File
@@ -646,8 +646,6 @@ class Database(http.Controller):
@http.route('/web/database/create', type='http', auth="none", methods=['POST'], csrf=False)
def create(self, master_pwd, name, lang, password, **post):
try:
if not re.match('^[a-zA-Z][a-zA-Z0-9_]+$', name):
raise Exception(_('Invalid database name. Only alphanumerical characters and underscore are allowed.'))
# country code could be = "False" which is actually True in python
country_code = post.get('country_code') or False
dispatch_rpc('db', 'create_database', [master_pwd, name, bool(post.get('demo')), lang, password, post['login'], country_code])
@@ -660,8 +658,6 @@ class Database(http.Controller):
@http.route('/web/database/duplicate', type='http', auth="none", methods=['POST'], csrf=False)
def duplicate(self, master_pwd, name, new_name):
try:
if not re.match('^[a-zA-Z][a-zA-Z0-9_]+$', new_name):
raise Exception(_('Invalid database name. Only alphanumerical characters and underscore are allowed.'))
dispatch_rpc('db', 'duplicate_database', [master_pwd, name, new_name])
return http.local_redirect('/web/database/manager')
except Exception, e:
+4 -1
View File
@@ -129,12 +129,15 @@ var QWeb2 = {
}
return r.join('');
} else {
// avoid XMLSerializer with text node for IE
if (node.nodeType == 3) {
return node.data;
}
if (typeof XMLSerializer !== 'undefined') {
return (new XMLSerializer()).serializeToString(node);
} else {
switch(node.nodeType) {
case 1: return node.outerHTML;
case 3: return node.data;
case 4: return '<![CDATA[' + node.data + ']]>';
case 8: return '<!-- ' + node.data + '-->';
}
+3 -3
View File
@@ -61,7 +61,7 @@
<div class="row">
<div class="col-md-12">
<label for="name" class="control-label">Database Name</label>
<input id="name" type="text" name="name" class="form-control" required="required" autocomplete="off" pattern="^[a-zA-Z][a-zA-Z0-9_]+$" title="Only alphanumerical characters and underscore are allowed"/>
<input id="name" type="text" name="name" class="form-control" required="required" autocomplete="off"/>
</div>
</div>
</div>
@@ -208,7 +208,7 @@
</div>
<div class="form-group">
<label for="name" class="control-label">Database Name</label>
<input id="name" type="text" name="name" class="form-control" required="required" pattern="^[a-zA-Z][a-zA-Z0-9_]+$" title="Only alphanumerical characters and underscore are allowed"/>
<input id="name" type="text" name="name" class="form-control" required="required"/>
</div>
<div class="form-group">
<label for="copy">This database might have been moved or copied.</label>
@@ -281,7 +281,7 @@
</div>
<div class="form-group">
<label for="new_name" class="control-label">New Name</label>
<input id="new_name" type="text" name="new_name" class="form-control" required="required" pattern="^[a-zA-Z][a-zA-Z0-9_]+$" title="Only alphanumerical characters and underscore are allowed"/>
<input id="new_name" type="text" name="new_name" class="form-control" required="required"/>
</div>
</div>
<div class="modal-footer">
+1 -1
View File
@@ -208,7 +208,7 @@
</record>
<record id="group_partner_manager" model="res.groups">
<field name="category_id" ref="module_category_extra"/>
<field name="category_id" ref="module_category_usability"/>
</record>
</data>