[MERGE] forward port branch 10.0 up to f4a54d7f66
This commit is contained in:
@@ -38,8 +38,7 @@ def migrate_tags_on_taxes(cr, registry):
|
||||
('type_tax_use', '=', tax_template.type_tax_use),
|
||||
('description', '=', tax_template.description)
|
||||
])
|
||||
if len(tax_id.ids) == 1:
|
||||
tax_id.sudo().write({'tag_ids': [(6, 0, tax_template.tag_ids.ids)]})
|
||||
tax_id.sudo().write({'tag_ids': [(6, 0, tax_template.tag_ids.ids)]})
|
||||
|
||||
def preserve_existing_tags_on_taxes(cr, registry, module):
|
||||
''' This is a utility function used to preserve existing previous tags during upgrade of the module.'''
|
||||
|
||||
@@ -144,8 +144,9 @@ class AccountJournal(models.Model):
|
||||
@api.multi
|
||||
def write(self, vals):
|
||||
# restrict the operation in case we are trying to write a forbidden field
|
||||
if self.company_id.country_id.code == 'FR' and vals.get('update_posted'):
|
||||
raise UserError(ERR_MSG % (self._name, 'update_posted'))
|
||||
for rec in self:
|
||||
if rec.company_id.country_id.code == 'FR' and vals.get('update_posted'):
|
||||
raise UserError(ERR_MSG % (self._name, 'update_posted'))
|
||||
return super(AccountJournal, self).write(vals)
|
||||
|
||||
@api.model
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from lxml import etree, objectify
|
||||
import logging
|
||||
from urllib2 import urlopen, Request
|
||||
from StringIO import StringIO
|
||||
import xml.etree.ElementTree as ET
|
||||
@@ -11,6 +12,8 @@ from odoo import _
|
||||
|
||||
XMLNS = 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def strip_ns(xml, ns):
|
||||
"""Strip the provided name from tag names.
|
||||
@@ -58,11 +61,13 @@ class AuthorizeAPI():
|
||||
|
||||
:param etree._Element data: etree data to process
|
||||
"""
|
||||
data = etree.tostring(data, xml_declaration=True, encoding='utf-8')
|
||||
request = Request(self.url, data)
|
||||
data_tree = etree.tostring(data, xml_declaration=True, encoding='utf-8')
|
||||
request = Request(self.url, data_tree)
|
||||
request.add_header('Content-Type', 'text/xml')
|
||||
_logger.debug('Authorize.net request sent: \n%s', etree.tostring(data, pretty_print=True))
|
||||
response = urlopen(request).read()
|
||||
response = strip_ns(response, XMLNS)
|
||||
_logger.debug('Authorize.net response: \n%s', etree.tostring(response, pretty_print=True))
|
||||
if response.find('messages/resultCode').text == 'Error':
|
||||
messages = map(lambda m: m.text, response.findall('messages/message/text'))
|
||||
raise ValidationError(_('Authorize.net Error Message(s):\n %s') % '\n'.join(messages))
|
||||
|
||||
@@ -51,5 +51,12 @@
|
||||
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.rule" id="purchase_order_report_comp_rule">
|
||||
<field name="name">Purchase Order Report multi-company</field>
|
||||
<field name="model_id" ref="model_purchase_report"/>
|
||||
<field name="global" eval="True"/>
|
||||
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* only when the deferred is resolved, and its value is equal to the resolved value.
|
||||
* The module can be rejected (unloaded). This will be logged in the console as info.
|
||||
*
|
||||
* logs:
|
||||
* logs:
|
||||
* Missing dependencies:
|
||||
* These modules do not appear in the page. It is possible that the
|
||||
* JavaScript file is not in the page or that the module name is wrong
|
||||
@@ -180,16 +180,27 @@
|
||||
var failed = odoo.__DEBUG__.get_failed_jobs();
|
||||
var unloaded = _.filter(debug_jobs, function (job) { return job.missing; });
|
||||
|
||||
var log = [(_.isEmpty(failed) ? (_.isEmpty(unloaded) ? 'info' : 'warning' ) : 'error') + ':', 'Some modules could not be started'];
|
||||
if (missing.length) log.push('\nMissing dependencies: ', missing);
|
||||
if (!_.isEmpty(failed)) log.push('\nFailed modules: ', _.pluck(failed, 'name'));
|
||||
if (!_.isEmpty(rejected)) log.push('\nRejected modules: ', rejected);
|
||||
if (!_.isEmpty(rejected_linked))log.push('\nRejected linked modules:', rejected_linked);
|
||||
if (!_.isEmpty(unloaded)) log.push('\nNon loaded modules: ', _.pluck(unloaded, 'name'));
|
||||
if (odoo.debug && !_.isEmpty(debug_jobs)) log.push('\nDebug: ', debug_jobs);
|
||||
|
||||
if (odoo.debug || !_.isEmpty(failed) || !_.isEmpty(unloaded)) {
|
||||
console[_.isEmpty(failed) || _.isEmpty(unloaded) ? 'info' : 'error'].apply(console, log);
|
||||
var log = console[_.isEmpty(failed) || _.isEmpty(unloaded) ? 'info' : 'error'].bind(console);
|
||||
log((_.isEmpty(failed) ? (_.isEmpty(unloaded) ? 'info' : 'warning') : 'error') + ': Some modules could not be started');
|
||||
if (missing.length) {
|
||||
log('Missing dependencies: ', missing);
|
||||
}
|
||||
if (!_.isEmpty(failed)) {
|
||||
log('Failed modules: ', _.pluck(failed, 'name'));
|
||||
}
|
||||
if (!_.isEmpty(rejected)) {
|
||||
log('Rejected modules: ', rejected);
|
||||
}
|
||||
if (!_.isEmpty(rejected_linked)) {
|
||||
log('Rejected linked modules: ', rejected_linked);
|
||||
}
|
||||
if (!_.isEmpty(unloaded)) {
|
||||
log('Non loaded modules: ', _.pluck(unloaded, 'name'));
|
||||
}
|
||||
if (odoo.debug && !_.isEmpty(debug_jobs)) {
|
||||
log('Debug: ', debug_jobs);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -617,7 +617,7 @@ var fontIconsDialog = Widget.extend({
|
||||
e.stopPropagation();
|
||||
|
||||
this.$('#fa-icon').val(e.target.getAttribute('data-id'));
|
||||
$(".font-icons-icon").removeClass("o_selected");
|
||||
this.$(".font-icons-icon").removeClass("o_selected");
|
||||
$(e.target).addClass("o_selected");
|
||||
},
|
||||
'dblclick .font-icons-icon': function () {
|
||||
@@ -743,7 +743,7 @@ var fontIconsDialog = Widget.extend({
|
||||
continue;
|
||||
case '': continue;
|
||||
default:
|
||||
$(".font-icons-icon").removeClass("o_selected").filter("[data-alias*=',"+cls+",']").addClass("o_selected");
|
||||
this.$(".font-icons-icon").removeClass("o_selected").filter("[data-alias*=',"+cls+",']").addClass("o_selected");
|
||||
if (this.alias.indexOf(cls) !== -1) {
|
||||
this.$('#fa-icon').val(cls);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
import logging
|
||||
from odoo import api, fields, models
|
||||
from odoo import _, api, fields, models
|
||||
from odoo.tools import float_compare
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
@@ -81,4 +81,16 @@ class PaymentTransaction(models.Model):
|
||||
_logger.info('<%s> transaction pending/to confirm manually, sending quote email for order %s (ID %s)', acquirer_name, tx.sale_order_id.name, tx.sale_order_id.id)
|
||||
tx.sale_order_id.force_quotation_send()
|
||||
else:
|
||||
_logger.warning('<%s> transaction MISMATCH for order %s (ID %s)', acquirer_name, tx.sale_order_id.name, tx.sale_order_id.id)
|
||||
_logger.warning(
|
||||
'<%s> transaction AMOUNT MISMATCH for order %s (ID %s): expected %r, got %r',
|
||||
acquirer_name, tx.sale_order_id.name, tx.sale_order_id.id,
|
||||
tx.sale_order_id.amount_total, tx.amount,
|
||||
)
|
||||
tx.sale_order_id.message_post(
|
||||
subject=_("Amount Mismatch (%s)") % acquirer_name,
|
||||
body=_("The sale order was not confirmed despite response from the acquirer (%s): SO amount is %r but acquirer replied with %r.") % (
|
||||
acquirer_name,
|
||||
tx.sale_order_id.amount_total,
|
||||
tx.amount,
|
||||
)
|
||||
)
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
USA, 16 Nov 2017
|
||||
|
||||
I hereby agree to the terms of the Odoo Individual Contributor License
|
||||
Agreement v1.0.
|
||||
|
||||
I declare that I am authorized and able to make this agreement and sign this
|
||||
declaration.
|
||||
|
||||
Signed,
|
||||
|
||||
Edward Gow elgow@users.noreply.github.com https://github.com/elgow
|
||||
+1
-1
@@ -17,7 +17,7 @@ passlib==1.6.5
|
||||
Pillow==3.4.1
|
||||
psutil==4.3.1
|
||||
psycogreen==1.0
|
||||
psycopg2==2.7.3
|
||||
psycopg2==2.7.3.1
|
||||
pydot==1.2.3
|
||||
pyparsing==2.1.10
|
||||
pyPdf==1.13
|
||||
|
||||
Reference in New Issue
Block a user