[MERGE] forward port branch 10.0 up to 2b4bc45e58
This commit is contained in:
@@ -1947,6 +1947,12 @@ msgstr ""
|
|||||||
msgid "Bank Statement"
|
msgid "Bank Statement"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: account
|
||||||
|
#: code:addons/account/models/account_bank_statement.py:935
|
||||||
|
#, python-format
|
||||||
|
msgid "Bank Statement %s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#. module: account
|
#. module: account
|
||||||
#: model:ir.model,name:account.model_account_bank_statement_line
|
#: model:ir.model,name:account.model_account_bank_statement_line
|
||||||
msgid "Bank Statement Line"
|
msgid "Bank Statement Line"
|
||||||
|
|||||||
@@ -922,7 +922,7 @@ class AccountBankStatementLine(models.Model):
|
|||||||
'currency_id': currency.id,
|
'currency_id': currency.id,
|
||||||
'amount': abs(total),
|
'amount': abs(total),
|
||||||
'communication': self._get_communication(payment_methods[0] if payment_methods else False),
|
'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
|
# Complete dicts to create both counterpart move lines and write-offs
|
||||||
|
|||||||
@@ -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)
|
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:
|
if line.move_id.id not in move_ids:
|
||||||
move_ids.add(line.move_id.id)
|
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
|
return True
|
||||||
|
|
||||||
####################################################
|
####################################################
|
||||||
|
|||||||
@@ -853,8 +853,8 @@ class Meeting(models.Model):
|
|||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
def _compute_color_partner(self):
|
def _compute_color_partner(self):
|
||||||
for meeting in self.sudo():
|
for meeting in self:
|
||||||
meeting.color_partner_id = meeting.user_id.partner_id.id
|
meeting.color_partner_id = meeting.sudo().user_id.partner_id.id
|
||||||
|
|
||||||
@api.constrains('start_datetime', 'stop_datetime', 'start_date', 'stop_date')
|
@api.constrains('start_datetime', 'stop_datetime', 'start_date', 'stop_date')
|
||||||
def _check_closing_date(self):
|
def _check_closing_date(self):
|
||||||
|
|||||||
@@ -506,19 +506,14 @@ class SaleOrder(models.Model):
|
|||||||
res = {}
|
res = {}
|
||||||
currency = self.currency_id or self.company_id.currency_id
|
currency = self.currency_id or self.company_id.currency_id
|
||||||
for line in self.order_line:
|
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:
|
for tax in line.tax_id:
|
||||||
group = tax.tax_group_id
|
group = tax.tax_group_id
|
||||||
res.setdefault(group, 0.0)
|
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:
|
for t in taxes:
|
||||||
res[group] += t['amount']
|
if t['id'] == tax.id or t['id'] in tax.children_tax_ids.ids:
|
||||||
if tax.include_base_amount:
|
res[group] += t['amount']
|
||||||
base_tax += tax.compute_all(price_reduce + base_tax, quantity=1, product=line.product_id,
|
|
||||||
partner=self.partner_shipping_id)['taxes'][0]['amount']
|
|
||||||
res = sorted(res.items(), key=lambda l: l[0].sequence)
|
res = sorted(res.items(), key=lambda l: l[0].sequence)
|
||||||
res = map(lambda l: (l[0].name, l[1]), res)
|
res = map(lambda l: (l[0].name, l[1]), res)
|
||||||
return res
|
return res
|
||||||
|
|||||||
@@ -6527,6 +6527,12 @@ msgstr ""
|
|||||||
msgid "You cannot cancel a stock move that has been set to 'Done'."
|
msgid "You cannot cancel a stock move that has been set to 'Done'."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: stock
|
||||||
|
#: code:addons/stock/models/stock_inventory.py:103
|
||||||
|
#, python-format
|
||||||
|
msgid "You cannot delete a validated inventory adjustement."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#. module: stock
|
#. module: stock
|
||||||
#: code:addons/stock/models/stock_inventory.py:369
|
#: code:addons/stock/models/stock_inventory.py:369
|
||||||
#, python-format
|
#, python-format
|
||||||
|
|||||||
@@ -96,6 +96,13 @@ class Inventory(models.Model):
|
|||||||
else:
|
else:
|
||||||
self.total_qty = 0
|
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
|
@api.model
|
||||||
def _selection_filter(self):
|
def _selection_filter(self):
|
||||||
""" Get the list of filter allowed according to the options checked
|
""" Get the list of filter allowed according to the options checked
|
||||||
|
|||||||
@@ -198,7 +198,6 @@ class ProductProduct(models.Model):
|
|||||||
]
|
]
|
||||||
return []
|
return []
|
||||||
|
|
||||||
@api.model
|
|
||||||
def _get_anglo_saxon_price_unit(self, uom=False):
|
def _get_anglo_saxon_price_unit(self, uom=False):
|
||||||
price = self.standard_price
|
price = self.standard_price
|
||||||
if not self or not uom or self.uom_id.id == uom.id:
|
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)
|
product_id = fields.Many2one('product.product', 'Product', required=True)
|
||||||
quantity = fields.Float(
|
quantity = fields.Float(
|
||||||
'Quantity', default=1.0,
|
'Quantity', default=1.0,
|
||||||
digits=dp.get_precision('Product Unit of Measure'), required=True)
|
digits=0, required=True)
|
||||||
weight = fields.Float(
|
weight = fields.Float(
|
||||||
'Weight', default=1.0,
|
'Weight', default=1.0,
|
||||||
digits=dp.get_precision('Product Unit of Measure'))
|
digits=dp.get_precision('Stock Weight'))
|
||||||
volume = fields.Float(
|
volume = fields.Float(
|
||||||
'Volume', default=1.0,
|
'Volume', default=1.0)
|
||||||
digits=dp.get_precision('Product Unit of Measure'))
|
|
||||||
former_cost = fields.Float(
|
former_cost = fields.Float(
|
||||||
'Former Cost', digits=dp.get_precision('Product Price'))
|
'Former Cost', digits=dp.get_precision('Product Price'))
|
||||||
former_cost_per_unit = fields.Float(
|
former_cost_per_unit = fields.Float(
|
||||||
|
|||||||
@@ -194,7 +194,8 @@ var FieldTextHtml = widget.extend({
|
|||||||
},
|
},
|
||||||
start: function () {
|
start: function () {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
// Do not Forward port in >= 11.0
|
||||||
|
this.$formButtons = this.getParent().$buttons;
|
||||||
this.callback = _.uniqueId('FieldTextHtml_');
|
this.callback = _.uniqueId('FieldTextHtml_');
|
||||||
window.odoo[this.callback+"_editor"] = function (EditorBar) {
|
window.odoo[this.callback+"_editor"] = function (EditorBar) {
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
@@ -297,7 +298,8 @@ var FieldTextHtml = widget.extend({
|
|||||||
this.$el.closest('.modal-body').css('max-height', 'none');
|
this.$el.closest('.modal-body').css('max-height', 'none');
|
||||||
this.$iframe = this.$el.find('iframe');
|
this.$iframe = this.$el.find('iframe');
|
||||||
// deactivate any button to avoid saving a not ready 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.document = null;
|
||||||
this.$body = $();
|
this.$body = $();
|
||||||
this.$content = $();
|
this.$content = $();
|
||||||
@@ -324,7 +326,8 @@ var FieldTextHtml = widget.extend({
|
|||||||
this._dirty_flag = false;
|
this._dirty_flag = false;
|
||||||
this.render_value();
|
this.render_value();
|
||||||
// reactivate all the buttons when the field's content (the iframe) is loaded
|
// 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 () {
|
setTimeout(function () {
|
||||||
self.add_button();
|
self.add_button();
|
||||||
setTimeout(self.resize,0);
|
setTimeout(self.resize,0);
|
||||||
@@ -422,6 +425,8 @@ var FieldTextHtml = widget.extend({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
destroy: function () {
|
destroy: function () {
|
||||||
|
// Do not Forward port in >= 11.0
|
||||||
|
this.$formButtons.find('button').removeClass('o_disabled').attr('disabled', false);
|
||||||
$(window).off('resize', this.resize);
|
$(window).off('resize', this.resize);
|
||||||
delete window.odoo[this.callback+"_editor"];
|
delete window.odoo[this.callback+"_editor"];
|
||||||
delete window.odoo[this.callback+"_content"];
|
delete window.odoo[this.callback+"_content"];
|
||||||
|
|||||||
Reference in New Issue
Block a user