[MERGE] forward port branch saas-15 up to 27cd03e032

This commit is contained in:
Christophe Simonis
2017-09-15 16:45:53 +02:00
9 changed files with 22 additions and 13 deletions
+6
View File
@@ -9688,6 +9688,12 @@ msgstr ""
msgid "You have"
msgstr ""
#. module: account
#: code:addons/account/models/account_payment.py:360
#, python-format
msgid "You have to define a sequence for %s in your company."
msgstr ""
#. module: account
#: code:addons/account/wizard/account_report_general_ledger.py:21
#, python-format
+1 -1
View File
@@ -115,7 +115,7 @@ class AccountInvoice(models.Model):
def _get_outstanding_info_JSON(self):
self.outstanding_credits_debits_widget = json.dumps(False)
if self.state == 'open':
domain = [('account_id', '=', self.account_id.id), ('partner_id', '=', self.env['res.partner']._find_accounting_partner(self.partner_id).id), ('reconciled', '=', False), ('amount_residual', '!=', 0.0)]
domain = [('account_id', '=', self.account_id.id), ('partner_id', '=', self.env['res.partner']._find_accounting_partner(self.partner_id).id), ('reconciled', '=', False), '|', ('amount_residual', '!=', 0.0), ('amount_residual_currency', '!=', 0.0)]
if self.type in ('out_invoice', 'in_refund'):
domain.extend([('credit', '>', 0), ('debit', '=', 0)])
type_payment = _('Outstanding credits')
+2
View File
@@ -391,6 +391,8 @@ class account_payment(models.Model):
if rec.payment_type == 'outbound':
sequence_code = 'account.payment.supplier.invoice'
rec.name = self.env['ir.sequence'].with_context(ir_sequence_date=rec.payment_date).next_by_code(sequence_code)
if not rec.name and self.payment_type != 'transfer':
raise UserError(_("You have to define a sequence for %s in your company.") % (sequence_code,))
# Create the journal entry
amount = rec.amount * (rec.payment_type in ('outbound', 'transfer') and 1 or -1)
@@ -109,7 +109,7 @@ class AccountInvoiceReport(models.Model):
ai.type, ai.state, pt.categ_id, ai.date_due, ai.account_id, ail.account_id AS account_line_id,
ai.partner_bank_id,
SUM ((invoice_type.sign * ail.quantity) / u.factor * u2.factor) AS product_qty,
SUM(ail.price_subtotal_signed) AS price_total,
SUM(ail.price_subtotal_signed * invoice_type.sign) AS price_total,
SUM(ABS(ail.price_subtotal_signed)) / CASE
WHEN SUM(ail.quantity / u.factor * u2.factor) <> 0::numeric
THEN SUM(ail.quantity / u.factor * u2.factor)
+1
View File
@@ -16,6 +16,7 @@ class AccountChartTemplate(models.Model):
if not self == self.env.ref('l10n_mx.mx_coa'):
return res
journal_basis = self.env['account.journal'].search([
('company_id', '=', company.id),
('type', '=', 'general'),
('code', '=', 'CBMX')], limit=1)
company.write({'tax_cash_basis_journal_id': journal_basis.id})
@@ -20,7 +20,8 @@ class MailMailStats(models.Model):
string='Mail ID (tech)',
help='ID of the related mail_mail. This field is an integer field because '
'the related mail_mail can be deleted separately from its statistics. '
'However the ID is needed for several action and controllers.'
'However the ID is needed for several action and controllers.',
index=True,
)
message_id = fields.Char(string='Message-ID')
model = fields.Char(string='Document model')
+4 -4
View File
@@ -25,10 +25,10 @@ class StockPicking(models.Model):
res = super(StockPicking, self)._create_backorder(backorder_moves)
for picking in self:
if picking.picking_type_id.code == 'incoming':
backorder = self.search([('backorder_id', '=', picking.id)])
backorder.message_post_with_view('mail.message_origin_link',
values={'self': backorder, 'origin': backorder.purchase_id},
subtype_id=self.env.ref('mail.mt_note').id)
for backorder in self.search([('backorder_id', '=', picking.id)]):
backorder.message_post_with_view('mail.message_origin_link',
values={'self': backorder, 'origin': backorder.purchase_id},
subtype_id=self.env.ref('mail.mt_note').id)
return res
@@ -349,10 +349,8 @@
<t t-if="not acquirer.country_ids or quotation and quotation.partner_id.country_id in acquirer.country_ids">
<label t-if="buttons.get(acquirer.id)">
<input t-att-value="acquirer.id" type="radio" name="acquirer" t-att-checked="acquirers[0] == acquirer"/>
<img class="media-object" style="width: 60px; display: inline-block;"
t-att-title="acquirer.name"
t-att-src="'/payment_%s/static/src/img/%s_icon.png' % (acquirer.provider, acquirer.provider)"/>
<span t-field="acquirer.name"/>
<span itemprop="image" t-field="acquirer.image_small" t-options="{'widget': 'image', 'style':'max-width: 60px; display: inline-block;'}"/>
<span t-field="acquirer.name"/>
</label>
<t t-set="payment_methods_available" t-value="True"/>
</t>
@@ -6,9 +6,10 @@ var ajax = require('web.ajax');
$(document).ready(function () {
// If option is enable
if ($("#checkbox_cgv").length) {
$("#checkbox_cgv").click(function() {
var enabling_button = function() {
$("div.oe_sale_acquirer_button").find('input, button').prop("disabled", !this.checked);
});
};
$("#checkbox_cgv").click(enabling_button).each(enabling_button);
}
// When choosing an acquirer, display its Pay Now button