diff --git a/addons/account/wizard/account_reconcile.py b/addons/account/wizard/account_reconcile.py index 199c70c0307..a36f2efbc12 100644 --- a/addons/account/wizard/account_reconcile.py +++ b/addons/account/wizard/account_reconcile.py @@ -70,7 +70,7 @@ class AccountMoveLineReconcileWriteoff(models.TransientModel): writeoff_acc_id = fields.Many2one('account.account', string='Write-Off account', required=True, domain=[('deprecated', '=', False)]) date_p = fields.Date(string='Date', default=fields.Date.context_today) comment = fields.Char(required=True, default='Write-off') - analytic_id = fields.Many2one('account.analytic.account', string='Analytic Account', domain=[('parent_id', '!=', False)]) + analytic_id = fields.Many2one('account.analytic.account', string='Analytic Account') @api.multi def trans_rec_addendum(self): diff --git a/addons/payment_transfer/i18n/payment_transfer.pot b/addons/payment_transfer/i18n/payment_transfer.pot index f37857b6e0e..f2c913e4f96 100644 --- a/addons/payment_transfer/i18n/payment_transfer.pot +++ b/addons/payment_transfer/i18n/payment_transfer.pot @@ -85,3 +85,9 @@ msgstr "" msgid "received data for reference %s" msgstr "" +#. module: payment_transfer +#: code:addons/payment_transfer/models/payment_acquirer.py:19 +#, python-format +msgid "Wire Transfer" +msgstr "" + diff --git a/addons/payment_transfer/models/payment_acquirer.py b/addons/payment_transfer/models/payment_acquirer.py index 540dafaa986..a8d47098c6c 100644 --- a/addons/payment_transfer/models/payment_acquirer.py +++ b/addons/payment_transfer/models/payment_acquirer.py @@ -16,7 +16,7 @@ class TransferPaymentAcquirer(osv.Model): def _get_providers(self, cr, uid, context=None): providers = super(TransferPaymentAcquirer, self)._get_providers(cr, uid, context=context) - providers.append(['transfer', 'Wire Transfer']) + providers.append(['transfer', _('Wire Transfer')]) return providers def transfer_get_form_action_url(self, cr, uid, id, context=None): diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 812c3d68e78..e516ddeda72 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -229,8 +229,8 @@ class SaleOrder(models.Model): a clean extension chain). """ self.ensure_one() - journal_ids = self.env['account.journal'].search([('type', '=', 'sale'), ('company_id', '=', self.company_id.id)], limit=1) - if not journal_ids: + journal_id = self.env['account.invoice'].default_get(['journal_id'])['journal_id'] + if not journal_id: raise UserError(_('Please define an accounting sale journal for this company.')) invoice_vals = { 'name': self.client_order_ref or '', @@ -239,7 +239,7 @@ class SaleOrder(models.Model): 'reference': self.client_order_ref or self.name, 'account_id': self.partner_invoice_id.property_account_receivable_id.id, 'partner_id': self.partner_invoice_id.id, - 'journal_id': journal_ids[0].id, + 'journal_id': journal_id, 'currency_id': self.pricelist_id.currency_id.id, 'comment': self.note, 'payment_term_id': self.payment_term_id.id, diff --git a/addons/stock_landed_costs/stock_landed_costs.py b/addons/stock_landed_costs/stock_landed_costs.py index ce954a89248..83d96f44035 100644 --- a/addons/stock_landed_costs/stock_landed_costs.py +++ b/addons/stock_landed_costs/stock_landed_costs.py @@ -267,7 +267,8 @@ class stock_landed_cost(osv.osv): if digits: value = float_round(value, precision_digits=digits[1], rounding_method='UP') - value = min(value, line.price_unit - value_split) + fnc = min if line.price_unit > 0 else max + value = fnc(value, line.price_unit - value_split) value_split += value if valuation.id not in towrite_dict: diff --git a/addons/website/models/website.py b/addons/website/models/website.py index cb18b26acf0..e61ce9bc1f3 100644 --- a/addons/website/models/website.py +++ b/addons/website/models/website.py @@ -655,11 +655,11 @@ class res_partner(osv.osv): } return urlplus('//maps.googleapis.com/maps/api/staticmap' , params) - def google_map_link(self, cr, uid, ids, zoom=8, context=None): + def google_map_link(self, cr, uid, ids, zoom=10, context=None): partner = self.browse(cr, uid, ids[0], context=context) params = { 'q': '%s, %s %s, %s' % (partner.street or '', partner.city or '', partner.zip or '', partner.country_id and partner.country_id.name_get()[0][1] or ''), - 'z': 10 + 'z': zoom, } return urlplus('https://maps.google.com/maps' , params) diff --git a/addons/website_quote/data/website_quotation_data.xml b/addons/website_quote/data/website_quotation_data.xml index 47e13bf286b..bb01e321a32 100644 --- a/addons/website_quote/data/website_quotation_data.xml +++ b/addons/website_quote/data/website_quotation_data.xml @@ -14,7 +14,11 @@ + + + @@ -150,11 +154,7 @@ - - - Sales Order - Send by Email (Online Quote) diff --git a/doc/cla/corporate/compassionCH.md b/doc/cla/corporate/compassionCH.md new file mode 100644 index 00000000000..4f2ca78203f --- /dev/null +++ b/doc/cla/corporate/compassionCH.md @@ -0,0 +1,16 @@ +Switzerland, 2015-08-18 + +Compassion Switzerland agrees to the terms of the Odoo Corporate Contributor License +Agreement v1.0. + +I declare that I am authorized and able to make this agreement and sign this +declaration. + +Signed, + +Emanuel Cino ecino@compassion.ch https://github.com/CompassionCH + + +List of contributors: + +Emanuel Cino ecino@compassion.ch https://github.com/ecino diff --git a/doc/cla/corporate/openbig.md b/doc/cla/corporate/openbig.md new file mode 100644 index 00000000000..bcfb0667d9f --- /dev/null +++ b/doc/cla/corporate/openbig.md @@ -0,0 +1,15 @@ +Germany, 9-30-2015 + +Big Consulting GmbH agrees to the terms of the Odoo Corporate Contributor License Agreement v1.0. + +I declare that I am authorized and able to make this agreement and sign this declaration. + +Signed, + +Thorsten Vocks thorsten.vocks@openbig.org https://github.com/tv-openbig + +List of contributors: + +Thorsten Vocks thorsten.vocks@openbig.org https://github.com/tv-openbig +Heike Vocks heike.vocks@openbig.org https://github.com/hv-openbig +Jan Dasenbrock jan.dasenbrock@openbig.org https://github.com/jd-openbig diff --git a/doc/cla/individual/MackZxh.md b/doc/cla/individual/MackZxh.md new file mode 100644 index 00000000000..852e50f5dd1 --- /dev/null +++ b/doc/cla/individual/MackZxh.md @@ -0,0 +1,11 @@ +China, 2015-10-01 + +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, + +钟小华 Zhong Xiaohua mackz@sina.com or mackzxh@gmail.com https://github.com/MackZxh diff --git a/doc/reference/views.rst b/doc/reference/views.rst index 271a4398906..0bf5df327f0 100644 --- a/doc/reference/views.rst +++ b/doc/reference/views.rst @@ -949,7 +949,7 @@ calendar view are: ``date_stop`` is provided records become movable (via drag and drop) directly in the calendar ``date_delay`` - alternative to ``date_end``, provides the duration of the event instead of + alternative to ``date_stop``, provides the duration of the event instead of its end date .. todo:: what's the unit? Does it allow moving the record? diff --git a/openerp/addons/test_new_api/tests/test_new_fields.py b/openerp/addons/test_new_api/tests/test_new_fields.py index 826aa46a245..e3e39ea67c3 100644 --- a/openerp/addons/test_new_api/tests/test_new_fields.py +++ b/openerp/addons/test_new_api/tests/test_new_fields.py @@ -337,6 +337,19 @@ class TestNewFields(common.TransactionCase): self.assertEqual(discussion.name, 'Bar') self.assertEqual(message.discussion_name, 'Bar') + # change discussion name via related field on several records + discussion1 = discussion.create({'name': 'X1'}) + discussion2 = discussion.create({'name': 'X2'}) + discussion1.participants = discussion2.participants = self.env.user + message1 = message.create({'discussion': discussion1.id}) + message2 = message.create({'discussion': discussion2.id}) + self.assertEqual(message1.discussion_name, 'X1') + self.assertEqual(message2.discussion_name, 'X2') + + (message1 + message2).write({'discussion_name': 'X3'}) + self.assertEqual(discussion1.name, 'X3') + self.assertEqual(discussion2.name, 'X3') + # search on related field, and check result search_on_related = self.env['test_new_api.message'].search([('discussion_name', '=', 'Bar')]) search_on_regular = self.env['test_new_api.message'].search([('discussion.name', '=', 'Bar')]) diff --git a/openerp/api.py b/openerp/api.py index 41b63a0d188..a2388081cd8 100644 --- a/openerp/api.py +++ b/openerp/api.py @@ -153,6 +153,15 @@ def onchange(*args): when one of the given fields is modified. The method is invoked on a pseudo-record that contains the values present in the form. Field assignments on that record are automatically sent back to the client. + + The method may return a dictionary for changing field domains and pop up + a warning message, like in the old API:: + + return { + 'domain': {'other_id': [('partner_id', '=', partner_id)]}, + 'warning': {'title': "Warning", 'message': "What is this?"}, + } + """ return lambda method: decorate(method, '_onchange', args) diff --git a/openerp/fields.py b/openerp/fields.py index ec3a1b8d3c3..a39b4de8659 100644 --- a/openerp/fields.py +++ b/openerp/fields.py @@ -566,10 +566,12 @@ class Field(object): def _inverse_related(self, records): """ Inverse the related field ``self`` on ``records``. """ + # store record values, otherwise they may be lost by cache invalidation! + record_value = {record: record[self.name] for record in records} for record in records: other, field = self.traverse_related(record) if other: - other[field.name] = record[self.name] + other[field.name] = record_value[record] def _search_related(self, records, operator, value): """ Determine the domain to search on field ``self``. """