[MERGE] forward port branch 10.0 up to 2b4bc45e58

This commit is contained in:
Christophe Simonis
2018-03-29 17:09:37 +02:00
10 changed files with 38 additions and 21 deletions
+6
View File
@@ -1947,6 +1947,12 @@ msgstr ""
msgid "Bank Statement"
msgstr ""
#. module: account
#: code:addons/account/models/account_bank_statement.py:935
#, python-format
msgid "Bank Statement %s"
msgstr ""
#. module: account
#: model:ir.model,name:account.model_account_bank_statement_line
msgid "Bank Statement Line"
@@ -922,7 +922,7 @@ class AccountBankStatementLine(models.Model):
'currency_id': currency.id,
'amount': abs(total),
'communication': self._get_communication(payment_methods[0] if payment_methods else False),
'name': self.statement_id.name,
'name': self.statement_id.name or _("Bank Statement %s") % self.date,
})
# Complete dicts to create both counterpart move lines and write-offs
+1 -1
View File
@@ -1259,7 +1259,7 @@ class AccountMoveLine(models.Model):
raise UserError(_('You cannot do this modification on a reconciled entry. You can just change some non legal fields or you must unreconcile first.\n%s.') % err_msg)
if line.move_id.id not in move_ids:
move_ids.add(line.move_id.id)
self.env['account.move'].browse(list(move_ids))._check_lock_date()
self.env['account.move'].browse(list(move_ids))._check_lock_date()
return True
####################################################
+2 -2
View File
@@ -853,8 +853,8 @@ class Meeting(models.Model):
@api.multi
def _compute_color_partner(self):
for meeting in self.sudo():
meeting.color_partner_id = meeting.user_id.partner_id.id
for meeting in self:
meeting.color_partner_id = meeting.sudo().user_id.partner_id.id
@api.constrains('start_datetime', 'stop_datetime', 'start_date', 'stop_date')
def _check_closing_date(self):
+4 -9
View File
@@ -506,19 +506,14 @@ class SaleOrder(models.Model):
res = {}
currency = self.currency_id or self.company_id.currency_id
for line in self.order_line:
base_tax = 0
price_reduce = line.price_unit * (1.0 - line.discount / 100.0)
taxes = line.tax_id.compute_all(price_reduce, quantity=line.product_uom_qty, product=line.product_id, partner=self.partner_shipping_id)['taxes']
for tax in line.tax_id:
group = tax.tax_group_id
res.setdefault(group, 0.0)
# FORWARD-PORT UP TO SAAS-17
price_reduce = line.price_unit * (1.0 - line.discount / 100.0)
taxes = tax.compute_all(price_reduce + base_tax, quantity=line.product_uom_qty,
product=line.product_id, partner=self.partner_shipping_id)['taxes']
for t in taxes:
res[group] += t['amount']
if tax.include_base_amount:
base_tax += tax.compute_all(price_reduce + base_tax, quantity=1, product=line.product_id,
partner=self.partner_shipping_id)['taxes'][0]['amount']
if t['id'] == tax.id or t['id'] in tax.children_tax_ids.ids:
res[group] += t['amount']
res = sorted(res.items(), key=lambda l: l[0].sequence)
res = map(lambda l: (l[0].name, l[1]), res)
return res
+6
View File
@@ -6527,6 +6527,12 @@ msgstr ""
msgid "You cannot cancel a stock move that has been set to 'Done'."
msgstr ""
#. module: stock
#: code:addons/stock/models/stock_inventory.py:103
#, python-format
msgid "You cannot delete a validated inventory adjustement."
msgstr ""
#. module: stock
#: code:addons/stock/models/stock_inventory.py:369
#, python-format
+7
View File
@@ -96,6 +96,13 @@ class Inventory(models.Model):
else:
self.total_qty = 0
@api.multi
def unlink(self):
for inventory in self:
if inventory.state == 'done':
raise UserError(_('You cannot delete a validated inventory adjustement.'))
return super(Inventory, self).unlink()
@api.model
def _selection_filter(self):
""" Get the list of filter allowed according to the options checked
-1
View File
@@ -198,7 +198,6 @@ class ProductProduct(models.Model):
]
return []
@api.model
def _get_anglo_saxon_price_unit(self, uom=False):
price = self.standard_price
if not self or not uom or self.uom_id.id == uom.id:
@@ -282,13 +282,12 @@ class AdjustmentLines(models.Model):
product_id = fields.Many2one('product.product', 'Product', required=True)
quantity = fields.Float(
'Quantity', default=1.0,
digits=dp.get_precision('Product Unit of Measure'), required=True)
digits=0, required=True)
weight = fields.Float(
'Weight', default=1.0,
digits=dp.get_precision('Product Unit of Measure'))
digits=dp.get_precision('Stock Weight'))
volume = fields.Float(
'Volume', default=1.0,
digits=dp.get_precision('Product Unit of Measure'))
'Volume', default=1.0)
former_cost = fields.Float(
'Former Cost', digits=dp.get_precision('Product Price'))
former_cost_per_unit = fields.Float(
+8 -3
View File
@@ -194,7 +194,8 @@ var FieldTextHtml = widget.extend({
},
start: function () {
var self = this;
// Do not Forward port in >= 11.0
this.$formButtons = this.getParent().$buttons;
this.callback = _.uniqueId('FieldTextHtml_');
window.odoo[this.callback+"_editor"] = function (EditorBar) {
setTimeout(function () {
@@ -297,7 +298,8 @@ var FieldTextHtml = widget.extend({
this.$el.closest('.modal-body').css('max-height', 'none');
this.$iframe = this.$el.find('iframe');
// deactivate any button to avoid saving a not ready iframe
$('.o_cp_buttons, .o_statusbar_buttons').find('button').addClass('o_disabled').attr('disabled', true);
// Do not Forward port in >= 11.0
this.$formButtons.find('button').addClass('o_disabled').attr('disabled', true);
this.document = null;
this.$body = $();
this.$content = $();
@@ -324,7 +326,8 @@ var FieldTextHtml = widget.extend({
this._dirty_flag = false;
this.render_value();
// reactivate all the buttons when the field's content (the iframe) is loaded
$('.o_cp_buttons, .o_statusbar_buttons').find('button').removeClass('o_disabled').attr('disabled', false);
// Do not Forward port in >= 11.0
this.$formButtons.find('button').removeClass('o_disabled').attr('disabled', false);
setTimeout(function () {
self.add_button();
setTimeout(self.resize,0);
@@ -422,6 +425,8 @@ var FieldTextHtml = widget.extend({
}
},
destroy: function () {
// Do not Forward port in >= 11.0
this.$formButtons.find('button').removeClass('o_disabled').attr('disabled', false);
$(window).off('resize', this.resize);
delete window.odoo[this.callback+"_editor"];
delete window.odoo[this.callback+"_content"];