diff options
| author | Denis Ledoux <dle@odoo.com> | 2015-10-01 16:47:28 +0200 |
|---|---|---|
| committer | Denis Ledoux <dle@odoo.com> | 2015-10-01 16:47:28 +0200 |
| commit | 0b678c63a905fdc63feff43e3e54d3132e34af1e (patch) | |
| tree | bc40da44aca797b7f47c7790878c6858579121dd | |
| parent | e9f1ee4d4a49c383040007ce42e8a6bc2bed9c41 (diff) | |
| parent | 34ce3e36e18fe3250afe89be2aac212baa8adeaf (diff) | |
[MERGE] forward port of branch 8.0 up to 34ce3e3
| -rw-r--r-- | addons/account/account_bank_statement.py | 4 | ||||
| -rw-r--r-- | addons/account/wizard/account_reconcile.py | 2 | ||||
| -rw-r--r-- | addons/payment_transfer/i18n/payment_transfer.pot | 10 | ||||
| -rw-r--r-- | addons/payment_transfer/models/payment_acquirer.py | 2 | ||||
| -rw-r--r-- | addons/sale/sale.py | 8 | ||||
| -rw-r--r-- | doc/cla/corporate/compassionCH.md | 16 | ||||
| -rw-r--r-- | doc/cla/corporate/openbig.md | 15 | ||||
| -rw-r--r-- | doc/cla/individual/MackZxh.md | 11 | ||||
| -rw-r--r-- | doc/reference/views.rst | 2 | ||||
| -rw-r--r-- | openerp/addons/base/ir/ir_model.py | 49 |
10 files changed, 70 insertions, 49 deletions
diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 01a4bf9e7e6..e557b98876e 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -600,9 +600,9 @@ class account_bank_statement_line(osv.osv): domain += [('reconcile_partial_id', '=', False)] domain += [('account_id.type', 'in', ((amount > 0 and 'receivable' or 'payable'), 'liquidity'))] # Make sure we can't mix receivable and payable if amount_field == 'amount_currency' and amount < 0: - domain += [(amount_field, '<', 0), (amount_field, '>', (sign * amount))] + domain += [(amount_field, '<', 0), (amount_field, '>=', (sign * amount))] else: - domain += [(amount_field, '>', 0), (amount_field, '<', (sign * amount))] + domain += [(amount_field, '>', 0), (amount_field, '<=', (sign * amount))] mv_lines = self.get_move_lines_for_reconciliation(cr, uid, st_line, excluded_ids=excluded_ids, limit=5, additional_domain=domain, context=context) ret = [] total = 0 diff --git a/addons/account/wizard/account_reconcile.py b/addons/account/wizard/account_reconcile.py index 075ddc84200..3b11c593dee 100644 --- a/addons/account/wizard/account_reconcile.py +++ b/addons/account/wizard/account_reconcile.py @@ -108,7 +108,7 @@ class account_move_line_reconcile_writeoff(osv.osv_memory): 'writeoff_acc_id': fields.many2one('account.account','Write-Off account', required=True), 'date_p': fields.date('Date'), 'comment': fields.char('Comment', required=True), - 'analytic_id': fields.many2one('account.analytic.account', 'Analytic Account', domain=[('parent_id', '!=', False)]), + 'analytic_id': fields.many2one('account.analytic.account', 'Analytic Account', domain=[('type', '!=', 'view')]), } _defaults = { 'date_p': lambda *a: time.strftime('%Y-%m-%d'), diff --git a/addons/payment_transfer/i18n/payment_transfer.pot b/addons/payment_transfer/i18n/payment_transfer.pot index 05f400b2ddc..c7576b07d9b 100644 --- a/addons/payment_transfer/i18n/payment_transfer.pot +++ b/addons/payment_transfer/i18n/payment_transfer.pot @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 8.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-01-21 14:08+0000\n" -"PO-Revision-Date: 2015-01-21 14:08+0000\n" +"POT-Creation-Date: 2015-09-05 12:00+0000\n" +"PO-Revision-Date: 2015-09-05 12:00+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -43,3 +43,9 @@ msgstr "" msgid "Payment Transaction" 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 b55fb055ab7..92b9fc9c70e 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 4a1eb8fb1ed..2c3f3451a5a 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -371,10 +371,8 @@ class sale_order(osv.osv): """ if context is None: context = {} - journal_ids = self.pool.get('account.journal').search(cr, uid, - [('type', '=', 'sale'), ('company_id', '=', order.company_id.id)], - limit=1) - if not journal_ids: + journal_id = self.pool['account.invoice'].default_get(cr, uid, ['journal_id'], context=context)['journal_id'] + if not journal_id: raise UserError(_('Please define sales journal for this company: "%s" (id:%d).') % (order.company_id.name, order.company_id.id)) invoice_vals = { 'name': order.client_order_ref or '', @@ -383,7 +381,7 @@ class sale_order(osv.osv): 'reference': order.client_order_ref or order.name, 'account_id': order.partner_invoice_id.property_account_receivable.id, 'partner_id': order.partner_invoice_id.id, - 'journal_id': journal_ids[0], + 'journal_id': journal_id, 'invoice_line': [(6, 0, lines)], 'currency_id': order.pricelist_id.currency_id.id, 'comment': order.note, 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 b1cc0255520..1667b731b08 100644 --- a/doc/reference/views.rst +++ b/doc/reference/views.rst @@ -942,7 +942,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/base/ir/ir_model.py b/openerp/addons/base/ir/ir_model.py index 4d32c0bfa13..8e2f1cccc1f 100644 --- a/openerp/addons/base/ir/ir_model.py +++ b/openerp/addons/base/ir/ir_model.py @@ -422,21 +422,8 @@ class ir_model_fields(osv.osv): # if set, *one* column can be renamed here column_rename = None - # field patches {model: {field_name: {prop_name: prop_value, ...}, ...}, ...} - patches = defaultdict(lambda: defaultdict(dict)) - - # static table of properties - model_props = [ # (our-name, fields.prop, set_fn) - ('field_description', 'string', tools.ustr), - ('required', 'required', bool), - ('readonly', 'readonly', bool), - ('domain', 'domain', eval), - ('size', 'size', int), - ('on_delete', 'ondelete', str), - ('translate', 'translate', bool), - ('select_level', 'index', lambda x: bool(int(x))), - ('selection', 'selection', eval), - ] + # names of the models to patch + patched_models = set() if vals and ids: checked_selection = False # need only check it once, so defer @@ -478,12 +465,7 @@ class ir_model_fields(osv.osv): # We don't check the 'state', because it might come from the context # (thus be set for multiple fields) and will be ignored anyway. if obj is not None and field is not None: - # find out which properties (per model) we need to update - for field_name, prop_name, func in model_props: - if field_name in vals: - prop_value = func(vals[field_name]) - if getattr(field, prop_name) != prop_value: - patches[obj][final_name][prop_name] = prop_value + patched_models.add(obj._name) # These shall never be written (modified) for column_name in ('model_id', 'model', 'state'): @@ -492,16 +474,17 @@ class ir_model_fields(osv.osv): res = super(ir_model_fields,self).write(cr, user, ids, vals, context=context) + self.pool.clear_manual_fields() + if column_rename: obj, rename = column_rename cr.execute('ALTER TABLE "%s" RENAME COLUMN "%s" TO "%s"' % rename) - # This is VERY risky, but let us have this feature: - # we want to change the key of field in obj._fields and obj._columns - field = obj._pop_field(rename[1]) - obj._add_field(rename[2], field) + + if column_rename or patched_models: + # setup models, this will reload all manual fields in registry self.pool.setup_models(cr, partial=(not self.pool.ready)) - if patches: + if patched_models: # We have to update _columns of the model(s) and then call their # _auto_init to sync the db with the model. Hopefully, since write() # was called earlier, they will be in-sync before the _auto_init. @@ -511,20 +494,12 @@ class ir_model_fields(osv.osv): select=vals.get('select_level', '0'), update_custom_fields=True, ) - - for obj, model_patches in patches.iteritems(): - for field_name, field_patches in model_patches.iteritems(): - # update field properties, and adapt corresponding column - field = obj._fields[field_name] - attrs = dict(field._attrs, **field_patches) - obj._add_field(field_name, field.new(**attrs)) - - # update database schema - self.pool.setup_models(cr, partial=(not self.pool.ready)) + for model_name in patched_models: + obj = self.pool[model_name] obj._auto_init(cr, ctx) obj._auto_end(cr, ctx) # actually create FKs! - if column_rename or patches: + if column_rename or patched_models: RegistryManager.signal_registry_change(cr.dbname) return res |
