Forward port of branch saas-3 up to fc9fc3e
This commit is contained in:
commit
8843974d04
|
@ -332,12 +332,12 @@ class account_move_line(osv.osv):
|
||||||
for line_id, invoice_id in cursor.fetchall():
|
for line_id, invoice_id in cursor.fetchall():
|
||||||
res[line_id] = invoice_id
|
res[line_id] = invoice_id
|
||||||
invoice_ids.append(invoice_id)
|
invoice_ids.append(invoice_id)
|
||||||
invoice_names = {False: ''}
|
invoice_names = {}
|
||||||
for invoice_id, name in invoice_obj.name_get(cursor, user, invoice_ids, context=context):
|
for invoice_id, name in invoice_obj.name_get(cursor, user, invoice_ids, context=context):
|
||||||
invoice_names[invoice_id] = name
|
invoice_names[invoice_id] = name
|
||||||
for line_id in res.keys():
|
for line_id in res.keys():
|
||||||
invoice_id = res[line_id]
|
invoice_id = res[line_id]
|
||||||
res[line_id] = (invoice_id, invoice_names[invoice_id])
|
res[line_id] = invoice_id and (invoice_id, invoice_names[invoice_id]) or False
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def name_get(self, cr, uid, ids, context=None):
|
def name_get(self, cr, uid, ids, context=None):
|
||||||
|
|
|
@ -121,14 +121,18 @@ class account_invoice_line(osv.osv):
|
||||||
if inv.currency_id.id != company_currency:
|
if inv.currency_id.id != company_currency:
|
||||||
valuation_price_unit = self.pool.get('res.currency').compute(cr, uid, company_currency, inv.currency_id.id, valuation_price_unit, context={'date': inv.date_invoice})
|
valuation_price_unit = self.pool.get('res.currency').compute(cr, uid, company_currency, inv.currency_id.id, valuation_price_unit, context={'date': inv.date_invoice})
|
||||||
if valuation_price_unit != i_line.price_unit and line['price_unit'] == i_line.price_unit and acc:
|
if valuation_price_unit != i_line.price_unit and line['price_unit'] == i_line.price_unit and acc:
|
||||||
price_diff = round(i_line.price_unit - valuation_price_unit, account_prec)
|
# price with discount and without tax included
|
||||||
line.update({'price': round(valuation_price_unit * line['quantity'], account_prec)})
|
price_unit = self.pool['account.tax'].compute_all(cr, uid, line['taxes'],
|
||||||
|
i_line.price_unit * (1-(i_line.discount or 0.0)/100.0), line['quantity'])['total']
|
||||||
|
price_line = round(valuation_price_unit * line['quantity'], account_prec)
|
||||||
|
price_diff = round(price_unit - price_line, account_prec)
|
||||||
|
line.update({'price': price_line})
|
||||||
diff_res.append({
|
diff_res.append({
|
||||||
'type': 'src',
|
'type': 'src',
|
||||||
'name': i_line.name[:64],
|
'name': i_line.name[:64],
|
||||||
'price_unit': price_diff,
|
'price_unit': round(price_diff / line['quantity'], account_prec),
|
||||||
'quantity': line['quantity'],
|
'quantity': line['quantity'],
|
||||||
'price': round(price_diff * line['quantity'], account_prec),
|
'price': price_diff,
|
||||||
'account_id': acc,
|
'account_id': acc,
|
||||||
'product_id': line['product_id'],
|
'product_id': line['product_id'],
|
||||||
'uos_id': line['uos_id'],
|
'uos_id': line['uos_id'],
|
||||||
|
|
|
@ -86,7 +86,8 @@ openerp_mail_followers = function(session, mail) {
|
||||||
// event: click on 'edit_subtype(pencil)' button to edit subscription
|
// event: click on 'edit_subtype(pencil)' button to edit subscription
|
||||||
this.$el.on('click', '.oe_edit_subtype', self.on_edit_subtype);
|
this.$el.on('click', '.oe_edit_subtype', self.on_edit_subtype);
|
||||||
this.$el.on('click', '.oe_remove_follower', self.on_remove_follower);
|
this.$el.on('click', '.oe_remove_follower', self.on_remove_follower);
|
||||||
this.$el.on('click', '.oe_show_more', self.on_show_more_followers)
|
this.$el.on('click', '.oe_show_more', self.on_show_more_followers);
|
||||||
|
this.$el.on('click', 'a[data-partner]', self.on_follower_clicked);
|
||||||
},
|
},
|
||||||
|
|
||||||
on_edit_subtype: function(event) {
|
on_edit_subtype: function(event) {
|
||||||
|
@ -144,6 +145,26 @@ openerp_mail_followers = function(session, mail) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
on_follower_clicked: function (event) {
|
||||||
|
event.preventDefault();
|
||||||
|
var partner_id = $(event.target).data('partner');
|
||||||
|
var state = {
|
||||||
|
'model': 'res.partner',
|
||||||
|
'id': partner_id,
|
||||||
|
'title': this.record_name
|
||||||
|
};
|
||||||
|
session.webclient.action_manager.do_push_state(state);
|
||||||
|
var action = {
|
||||||
|
type:'ir.actions.act_window',
|
||||||
|
view_type: 'form',
|
||||||
|
view_mode: 'form',
|
||||||
|
res_model: 'res.partner',
|
||||||
|
views: [[false, 'form']],
|
||||||
|
res_id: partner_id,
|
||||||
|
}
|
||||||
|
this.do_action(action);
|
||||||
|
},
|
||||||
|
|
||||||
read_value: function () {
|
read_value: function () {
|
||||||
var self = this;
|
var self = this;
|
||||||
this.displayed_nb = this.displayed_limit;
|
this.displayed_nb = this.displayed_limit;
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
-->
|
-->
|
||||||
<div t-name="mail.followers.partner" class='oe_partner'>
|
<div t-name="mail.followers.partner" class='oe_partner'>
|
||||||
<img class="oe_mail_thumbnail oe_mail_frame" t-attf-src="{record.avatar_url}"/>
|
<img class="oe_mail_thumbnail oe_mail_frame" t-attf-src="{record.avatar_url}"/>
|
||||||
<a t-attf-href="#model=res.partner&id=#{record.id}" t-att-title="record.name"><t t-esc="record.name"/></a>
|
<a t-attf-href="#model=res.partner&id=#{record.id}" t-att-title="record.name" t-att-data-partner="record.id"><t t-esc="record.name"/></a>
|
||||||
<span t-if="record.is_editable and (widget.records_length > 1)" class="oe_edit_subtype oe_e oe_hidden" title="Edit subscription" t-att-data-id="record.id">&</span>
|
<span t-if="record.is_editable and (widget.records_length > 1)" class="oe_edit_subtype oe_e oe_hidden" title="Edit subscription" t-att-data-id="record.id">&</span>
|
||||||
<span t-if="widget.view_is_editable" class="oe_remove_follower oe_e" title="Remove this follower" t-att-data-id="record.id">X</span>
|
<span t-if="widget.view_is_editable" class="oe_remove_follower oe_e" title="Remove this follower" t-att-data-id="record.id">X</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -33,9 +33,9 @@ function openerp_pos_basewidget(instance, module){ //module is instance.point_of
|
||||||
amount = amount.toFixed(decimals);
|
amount = amount.toFixed(decimals);
|
||||||
}
|
}
|
||||||
if(this.currency.position === 'after'){
|
if(this.currency.position === 'after'){
|
||||||
return amount + ' ' + this.currency.symbol;
|
return amount + ' ' + (this.currency.symbol || '');
|
||||||
}else{
|
}else{
|
||||||
return this.currency.symbol + ' ' + amount;
|
return (this.currency.symbol || '') + ' ' + amount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1002,7 +1002,7 @@ class task(osv.osv):
|
||||||
if vals.get('project_id') and not context.get('default_project_id'):
|
if vals.get('project_id') and not context.get('default_project_id'):
|
||||||
context['default_project_id'] = vals.get('project_id')
|
context['default_project_id'] = vals.get('project_id')
|
||||||
# user_id change: update date_start
|
# user_id change: update date_start
|
||||||
if vals.get('user_id') and not vals.get('start_date'):
|
if vals.get('user_id') and not vals.get('date_start'):
|
||||||
vals['date_start'] = fields.datetime.now()
|
vals['date_start'] = fields.datetime.now()
|
||||||
|
|
||||||
# context: no_log, because subtype already handle this
|
# context: no_log, because subtype already handle this
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
import unicodedata
|
||||||
|
|
||||||
from openerp import tools
|
from openerp import tools
|
||||||
import openerp.modules
|
import openerp.modules
|
||||||
|
@ -351,7 +352,8 @@ class ir_translation(osv.osv):
|
||||||
trad = res and res[0] or u''
|
trad = res and res[0] or u''
|
||||||
if source and not trad:
|
if source and not trad:
|
||||||
return tools.ustr(source)
|
return tools.ustr(source)
|
||||||
return trad
|
# Remove control characters
|
||||||
|
return filter(lambda c: unicodedata.category(c) != 'Cc', tools.ustr(trad))
|
||||||
|
|
||||||
def create(self, cr, uid, vals, context=None):
|
def create(self, cr, uid, vals, context=None):
|
||||||
if context is None:
|
if context is None:
|
||||||
|
|
|
@ -4,6 +4,7 @@ import logging
|
||||||
|
|
||||||
import openerp.release
|
import openerp.release
|
||||||
import openerp.tools
|
import openerp.tools
|
||||||
|
from openerp.tools.translate import _
|
||||||
|
|
||||||
import security
|
import security
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue