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

This commit is contained in:
Christophe Simonis
2017-01-25 15:01:29 +01:00
9 changed files with 41 additions and 10 deletions
+1 -1
View File
@@ -405,7 +405,7 @@ class AccountInvoice(models.Model):
default_model='account.invoice',
default_res_id=self.id,
default_use_template=bool(template),
default_template_id=template.id,
default_template_id=template and template.id or False,
default_composition_mode='comment',
mark_invoice_as_sent=True,
custom_layout="account.mail_template_data_notification_email_account_invoice"
@@ -164,7 +164,7 @@ class IrModelFieldsAnonymizeWizard(models.TransientModel):
table_name = self.env[model_name]._table
# get the current value
self.env.cr.execute("select id, %s from %s" % (field_name, table_name))
self.env.cr.execute('select id, "%s" from "%s"' % (field_name, table_name))
for record in self.env.cr.dictfetchall():
data.append({"model_id": model_name, "field_id": field_name, "id": record['id'], "value": record[field_name]})
@@ -196,7 +196,7 @@ class IrModelFieldsAnonymizeWizard(models.TransientModel):
if anonymized_value is None:
raise UserError('%s: %s' % (error_type, _("Anonymized value can not be empty.")))
sql = "update %(table)s set %(field)s = %%(anonymized_value)s where id = %%(id)s" % {
sql = 'update "%(table)s" set "%(field)s" = %%(anonymized_value)s where id = %%(id)s' % {
'table': table_name,
'field': field_name,
}
@@ -285,7 +285,7 @@ class IrModelFieldsAnonymizeWizard(models.TransientModel):
custom_updates.sort(key=itemgetter('sequence'))
queries = [(record['query'], record['query_type']) for record in custom_updates if record['query_type']]
elif table_name:
queries = [("update %(table)s set %(field)s = %%(value)s where id = %%(id)s" % {
queries = [('update "%(table)s" set "%(field)s" = %%(value)s where id = %%(id)s' % {
'table': table_name,
'field': line['field_id'],
}, 'sql')]
+1 -1
View File
@@ -705,7 +705,7 @@ class Message(models.Model):
def _invalidate_documents(self):
""" Invalidate the cache of the documents followed by ``self``. """
for record in self:
if record.res_id:
if record.model and record.res_id:
self.env[record.model].invalidate_cache(ids=[record.res_id])
@api.model
@@ -189,6 +189,7 @@ td {
height: 100%;
display: table;
border: none;
overflow: hidden;
}
.pos .window .subwindow{
display: table-row;
@@ -213,6 +214,19 @@ td {
position: relative;
}
.pos .clientlist-screen .window,
.pos .clientlist-screen .full-content .subwindow{
display: block;
}
.pos .clientlist-screen .full-content .subwindow-container{
display: block;
height: 100%;
}
.pos .clientlist-screen .full-content .subwindow.collapsed,
.pos .clientlist-screen .full-content .subwindow-container.collapsed{
height: auto;
}
/* ---- Scrollers ----- */
.pos .scroller-container{
@@ -703,6 +717,7 @@ td {
display: inline-block;
float: right;
text-align: center;
width: 216px;
margin: 16px;
margin-top: 8px;
margin-left: 0px;
@@ -1335,6 +1335,9 @@ var ClientListScreenWidget = ScreenWidget.extend({
var new_height = contents.height();
if(!this.details_visible){
// resize client list to take into account client details
parent.height('-=' + new_height);
if(clickpos < scroll + new_height + 20 ){
parent.scrollTop( clickpos - 20 );
}else{
@@ -1364,6 +1367,7 @@ var ClientListScreenWidget = ScreenWidget.extend({
});
} else if (visibility === 'hide') {
contents.empty();
parent.height('100%');
if( height > scroll ){
contents.css({height:height+'px'});
contents.animate({height:0},400,function(){
+4 -1
View File
@@ -137,7 +137,10 @@ class PortalWizardUser(models.TransientModel):
user_portal = None
# create a user if necessary, and make sure it is in the portal group
if not user:
company_id = wizard_user.partner_id.company_id.id
if wizard_user.partner_id.company_id:
company_id = wizard_user.partner_id.company_id.id
else:
company_id = self.env['res.company']._company_default_get('res.users')
user_portal = wizard_user.sudo().with_context(company_id=company_id)._create_user()
else:
user_portal = user
+3 -3
View File
@@ -338,11 +338,11 @@ class InventoryLine(models.Model):
theoretical_qty = self.product_id.uom_id._compute_quantity(theoretical_qty, self.product_uom_id)
self.theoretical_qty = theoretical_qty
@api.onchange('product_id', 'product_uom_id')
def onchange_product_or_uom(self):
@api.onchange('product_id')
def onchange_product(self):
res = {}
# If no UoM or incorrect UoM put default one from product
if self.product_id and (not self.product_uom_id or self.product_id.uom_id.category_id != self.product_uom_id.category_id):
if self.product_id:
self.product_uom_id = self.product_id.uom_id
res['domain'] = {'product_uom_id': [('category_id', '=', self.product_id.uom_id.category_id.id)]}
return res
+1 -1
View File
@@ -378,7 +378,7 @@ class Website(models.Model):
request.session['sale_order_id'] = sale_order.id
if request.website.partner_id.id != partner.id:
partner.write({'last_website_so_id': sale_order_id})
partner.write({'last_website_so_id': sale_order.id})
if sale_order:
+9
View File
@@ -0,0 +1,9 @@
Italy, 2017-01-24
I hereby agree to the terms of the Odoo Individual Contributor License Agreement v1.0.
I declare that I am authorized and able to make this agreement and sign this declaration.
Signed,
Sergio Corato sergiocorato@gmail.com https://github.com/sergiocorato