[MERGE] forward port branch 11.0 up to 5a1f874602
This commit is contained in:
@@ -1025,6 +1025,7 @@ class AccountTax(models.Model):
|
||||
'refund_account_id': tax.refund_account_id.id,
|
||||
'analytic': tax.analytic,
|
||||
'price_include': tax.price_include,
|
||||
'tax_exigibility': tax.tax_exigibility,
|
||||
})
|
||||
|
||||
return {
|
||||
|
||||
@@ -954,6 +954,8 @@ class AccountMoveLine(models.Model):
|
||||
ctx['date'] = vals['date']
|
||||
temp['currency_id'] = bank.currency_id.id
|
||||
temp['amount_currency'] = bank.company_id.currency_id.with_context(ctx).compute(tax_vals['amount'], bank.currency_id, round=True)
|
||||
if vals.get('tax_exigible'):
|
||||
temp['tax_exigible'] = True
|
||||
tax_lines_vals.append(temp)
|
||||
|
||||
#Toggle the 'tax_exigible' field to False in case it is not yet given and the tax in 'tax_line_id' or one of
|
||||
|
||||
@@ -838,6 +838,7 @@ var StatementModel = BasicModel.extend({
|
||||
|
||||
prop.computed_with_tax = tax.price_include
|
||||
prop.tax_amount = tax.amount
|
||||
prop.tax_exigible = tax.tax_exigibility === 'on_payment' ? true : undefined
|
||||
prop.amount = tax.base;
|
||||
prop.amount_str = field_utils.format.monetary(Math.abs(prop.amount), {}, formatOptions);
|
||||
prop.invalid = !self._isValid(prop);
|
||||
@@ -1132,6 +1133,7 @@ var StatementModel = BasicModel.extend({
|
||||
name : prop.label,
|
||||
debit : amount > 0 ? amount : 0,
|
||||
credit : amount < 0 ? -amount : 0,
|
||||
tax_exigible: prop.tax_exigible,
|
||||
// This one isn't usefull for the server,
|
||||
// But since we need to change the amount (and thus its semantics) into base_amount
|
||||
// It might be useful to have a trace in the RPC for debugging purposes
|
||||
|
||||
@@ -33,6 +33,11 @@ class Partner(models.Model):
|
||||
street_number2 = fields.Char('Door', compute='_split_street', help="Door Number",
|
||||
inverse='_set_street', store=True)
|
||||
|
||||
@api.model
|
||||
def _address_fields(self):
|
||||
"""Returns the list of address fields that are synced from the parent."""
|
||||
return super(Partner, self)._address_fields() + ['street_name', 'street_number', 'street_number2']
|
||||
|
||||
def get_street_fields(self):
|
||||
"""Returns the fields that can be used in a street format.
|
||||
Overwrite this function if you want to add your own fields."""
|
||||
|
||||
@@ -48,7 +48,11 @@ class ServerActions(models.Model):
|
||||
# TDE CLEANME: when going to new api with server action, remove action
|
||||
if not action.template_id or not self._context.get('active_id'):
|
||||
return False
|
||||
action.template_id.send_mail(self._context.get('active_id'), force_send=False, raise_exception=False)
|
||||
# Clean context from default_type to avoid making attachment
|
||||
# with wrong values in subsequent operations
|
||||
cleaned_ctx = dict(self.env.context)
|
||||
cleaned_ctx.pop('default_type', None)
|
||||
action.template_id.with_context(cleaned_ctx).send_mail(self._context.get('active_id'), force_send=False, raise_exception=False)
|
||||
return False
|
||||
|
||||
@api.model
|
||||
|
||||
@@ -472,8 +472,9 @@ class Picking(models.Model):
|
||||
else:
|
||||
location_dest_id, supplierloc = self.env['stock.warehouse']._get_partner_locations()
|
||||
|
||||
self.location_id = location_id
|
||||
self.location_dest_id = location_dest_id
|
||||
if self.state == 'draft':
|
||||
self.location_id = location_id
|
||||
self.location_dest_id = location_dest_id
|
||||
# TDE CLEANME move into onchange_partner_id
|
||||
if self.partner_id and self.partner_id.picking_warn:
|
||||
if self.partner_id.picking_warn == 'no-message' and self.partner_id.parent_id:
|
||||
|
||||
Reference in New Issue
Block a user