Skip to content

Commit 27dc061

Browse files
committed
[MERGE] forward port branch saas-11 up to a73cd57
2 parents dd9cbcf + a73cd57 commit 27dc061

File tree

11 files changed

+32
-14
lines changed

11 files changed

+32
-14
lines changed

addons/account/models/account.py

+7
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,13 @@ def write(self, vals):
160160
for account in self:
161161
if (account.company_id.id <> vals['company_id']) and move_lines:
162162
raise UserError(_('You cannot change the owner company of an account that already contains journal items.'))
163+
# If user change the reconcile flag, all aml should be recomputed for that account and this is very costly.
164+
# So to prevent some bugs we add a constraint saying that you cannot change the reconcile field if there is any aml existing
165+
# for that account.
166+
if vals.get('reconcile'):
167+
move_lines = self.env['account.move.line'].search([('account_id', 'in', self.ids)], limit=1)
168+
if len(move_lines):
169+
raise UserError(_('You cannot change the value of the reconciliation on this account as it already has some moves'))
163170
return super(AccountAccount, self).write(vals)
164171

165172
@api.multi

addons/account/models/account_journal_dashboard.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def open_action(self):
314314
})
315315
ir_model_obj = self.pool['ir.model.data']
316316
model, action_id = ir_model_obj.get_object_reference(self._cr, self._uid, 'account', action_name)
317-
action = self.pool[model].read(self._cr, self._uid, action_id, context=self._context)
317+
action = self.pool[model].read(self._cr, self._uid, [action_id], context=self._context)[0]
318318
action['context'] = ctx
319319
action['domain'] = self._context.get('use_domain', [])
320320
return action
@@ -357,7 +357,7 @@ def open_action_with_context(self):
357357
ctx.pop('group_by', None)
358358
ir_model_obj = self.pool['ir.model.data']
359359
model, action_id = ir_model_obj.get_object_reference(self._cr, self._uid, 'account', action_name)
360-
action = self.pool[model].read(self._cr, self._uid, action_id, context=self._context)
360+
action = self.pool[model].read(self._cr, self._uid, [action_id], context=self._context)[0]
361361
action['context'] = ctx
362362
if ctx.get('use_domain', False):
363363
action['domain'] = ['|', ('journal_id', '=', self.id), ('journal_id', '=', False)]

addons/account_bank_statement_import/account_journal.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def import_statement(self):
1414
action_name = 'action_account_bank_statement_import'
1515
ir_model_obj = self.pool['ir.model.data']
1616
model, action_id = ir_model_obj.get_object_reference(self._cr, self._uid, 'account_bank_statement_import', action_name)
17-
action = self.pool[model].read(self._cr, self._uid, action_id, context=self.env.context)
17+
action = self.pool[model].read(self._cr, self._uid, [action_id], context=self.env.context)[0]
1818
# Note: this drops action['context'], which is a dict stored as a string, which is not easy to update
1919
action.update({'context': (u"{'journal_id': " + str(self.id) + u"}")})
2020
return action

addons/point_of_sale/static/src/js/models.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1924,7 +1924,7 @@ exports.Order = Backbone.Model.extend({
19241924
},
19251925

19261926
initialize_validation_date: function () {
1927-
this.validation_date = this.validation_date || new Date();
1927+
this.validation_date = new Date();
19281928
},
19291929

19301930
set_tip: function(tip) {

addons/purchase_requisition/views/purchase_requisition_views.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@
139139
<field name="ordering_date" attrs="{'readonly': [('state','not in',('draft','in_progress','open'))]}"/>
140140
<field name="schedule_date" attrs="{'readonly': [('state','not in',('draft','in_progress','open'))]}"/>
141141
<field name="origin" placeholder="e.g. PO0025" attrs="{'readonly': [('state', '!=', 'draft')]}"/>
142-
<field name="picking_type_id" widget="selection" groups="stock.group_stock_adv_location" attrs="{'readonly': [('state', '!=', 'draft')]}"/>
142+
<field name="picking_type_id" widget="selection" groups="stock.group_adv_location" attrs="{'readonly': [('state', '!=', 'draft')]}"/>
143143
<field name="company_id" groups="base.group_multi_company" options="{'no_create': True}" attrs="{'readonly': [('state','not in',('draft'))]}"/>
144144
</group>
145145
</group>

addons/sale_margin/views/sale_margin_view.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<field name="inherit_id" ref="sale.view_order_form"/>
2121
<field name="arch" type="xml">
2222
<xpath expr="//field[@name='order_line']/form//field[@name='price_unit']" position="after">
23-
<field name="purchase_price" groups="base.group_user" invisible="True"/>
23+
<field name="purchase_price" groups="base.group_user"/>
2424
</xpath>
2525
</field>
2626
</record>

doc/cla/individual/tiangolo.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Colombia, 2016-10-04
2+
3+
I hereby agree to the terms of the Odoo Individual Contributor License
4+
Agreement v1.0.
5+
6+
I declare that I am authorized and able to make this agreement and sign this
7+
declaration.
8+
9+
Signed,
10+
11+
Sebastián Ramírez [email protected] https://github.com/tiangolo

doc/howtos/backend.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ overridden by setting :attr:`~openerp.models.Model._rec_name`.
211211

212212
.. only:: solutions
213213

214-
Edit the file ``openacademy/models.py`` to include a *Course* class.
214+
Edit the file ``openacademy/models/models.py`` to include a *Course* class.
215215

216216
.. patch::
217217

@@ -255,7 +255,7 @@ be declared in the ``'data'`` list (always loaded) or in the ``'demo'`` list
255255

256256
.. only:: solutions
257257

258-
Edit the file ``openacademy/demo.xml`` to include some data.
258+
Edit the file ``openacademy/demo/demo.xml`` to include some data.
259259

260260
.. patch::
261261

@@ -484,7 +484,7 @@ client data; it is also related to its sale order line records.
484484

485485
.. only:: solutions
486486

487-
#. Create the class *Session* in ``openacademy/models.py``.
487+
#. Create the class *Session* in ``openacademy/models/models.py``.
488488
#. Add access to the session object in ``openacademy/view/openacademy.xml``.
489489

490490
.. patch::
@@ -684,7 +684,7 @@ instead of a single view its ``arch`` field is composed of any number of
684684
inspect the view, find its external ID and the place to put the
685685
new field.
686686

687-
#. Create a file ``openacademy/partner.py`` and import it in
687+
#. Create a file ``openacademy/models/partner.py`` and import it in
688688
``__init__.py``
689689
#. Create a file ``openacademy/views/partner.xml`` and add it to
690690
``__openerp__.py``

openerp/addons/base/ir/ir_model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1187,7 +1187,7 @@ def unlink_if_refcount(to_unlink):
11871187

11881188
self._cr.commit()
11891189

1190-
self.unlink()
1190+
datas.unlink()
11911191

11921192
@api.model
11931193
def _process_end(self, modules):

openerp/models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1910,7 +1910,7 @@ def _read_group_prepare(self, orderby, aggregated_fields, annotated_groupbys, qu
19101910
for order_part in orderby.split(','):
19111911
order_split = order_part.split()
19121912
order_field = order_split[0]
1913-
if order_field in groupby_fields:
1913+
if order_field == 'id' or order_field in groupby_fields:
19141914

19151915
if self._fields[order_field.split(':')[0]].type == 'many2one':
19161916
order_clause = self._generate_order_by(order_part, query).replace('ORDER BY ', '')

openerp/tools/misc.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -340,13 +340,13 @@ def visit(n):
340340
# add some sanitizations to respect the excel sheet name restrictions
341341
# as the sheet name is often translatable, can not control the input
342342
class PatchedWorkbook(xlwt.Workbook):
343-
def add_sheet(self, name):
343+
def add_sheet(self, name, cell_overwrite_ok=False):
344344
# invalid Excel character: []:*?/\
345345
name = re.sub(r'[\[\]:*?/\\]', '', name)
346346

347347
# maximum size is 31 characters
348348
name = name[:31]
349-
return super(PatchedWorkbook, self).add_sheet(name)
349+
return super(PatchedWorkbook, self).add_sheet(name, cell_overwrite_ok=cell_overwrite_ok)
350350

351351
xlwt.Workbook = PatchedWorkbook
352352

0 commit comments

Comments
 (0)