diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index 6e5cd510913384b11080abb62d3cdc6ee6aa693d..c9a2f8ef50bb810ffba7c8f203cfa6b4c5ec0fa6 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -1383,7 +1383,7 @@ class AccountPaymentTerm(models.Model): class AccountPaymentTermLine(models.Model): _name = "account.payment.term.line" _description = "Payment Term Line" - _order = "sequence" + _order = "sequence, id" value = fields.Selection([ ('balance', 'Balance'), diff --git a/addons/event_sale/wizard/event_edit_registration.py b/addons/event_sale/wizard/event_edit_registration.py index bce6f86dde03fafa72c57a946aa290bb86ccf8ae..000709033832cabeb866a4862e34a67fb27e1db4 100644 --- a/addons/event_sale/wizard/event_edit_registration.py +++ b/addons/event_sale/wizard/event_edit_registration.py @@ -53,6 +53,9 @@ class SaleOrderEventRegistration(models.TransientModel): registration_line.registration_id.write(values) else: self.env['event.registration'].create(values) + if self.env.context.get('active_model') == 'sale.order': + for order in self.env['sale.order'].browse(self.env.context.get('active_ids', [])): + order.order_line._update_registrations(confirm=True) return {'type': 'ir.actions.act_window_close'} diff --git a/addons/product/product.py b/addons/product/product.py index 4224e329f72f01e8e0e82a58ac99523b424c954b..825ec1873a80e201e499b7507ac517b3e55b8c71 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -448,7 +448,7 @@ class product_template(osv.osv): names = [names] res = {id: {} for id in ids} templates = self.browse(cr, uid, ids, context=context) - unique_templates = [template.id for template in templates if template.product_variant_count == 1] + unique_templates = [template.id for template in templates if len(template.product_variant_ids) == 1] for template in templates: for name in names: res[template.id][name] = getattr(template.product_variant_ids[0], name) if template.id in unique_templates else 0.0 @@ -457,7 +457,7 @@ class product_template(osv.osv): def _set_product_template_field(self, cr, uid, product_tmpl_id, name, value, args, context=None): ''' Set the standard price modification on the variant if there is only one variant ''' template = self.pool['product.template'].browse(cr, uid, product_tmpl_id, context=context) - if template.product_variant_count == 1: + if len(template.product_variant_ids) == 1: variant = self.pool['product.product'].browse(cr, uid, template.product_variant_ids.id, context=context) return variant.write({name: value}) return {} diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 490df521f77703fccba8896d3172696748c6bf76..8919d0bba6ff7cc9d14149a0d6dc07d44fccf5c7 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -378,7 +378,8 @@ class PurchaseOrder(models.Model): 'date': self.date_order, 'origin': self.name, 'location_dest_id': self._get_destination_location(), - 'location_id': self.partner_id.property_stock_supplier.id + 'location_id': self.partner_id.property_stock_supplier.id, + 'company_id': self.company_id.id, } @api.multi diff --git a/addons/stock_dropshipping/stock_dropshipping.xml b/addons/stock_dropshipping/stock_dropshipping.xml index 7637e4fe26034d9825f893a91b3fad60b4280271..7714e26fca3b090167800393d490288798552845 100644 --- a/addons/stock_dropshipping/stock_dropshipping.xml +++ b/addons/stock_dropshipping/stock_dropshipping.xml @@ -1,16 +1,13 @@ <?xml version="1.0"?> <openerp> - <data> + <data noupdate="1"> <!-- Sequence and picking type dropship--> - <record id="seq_picking_type_dropship" model="ir.sequence"> <field name="name">Dropship</field> <field name="prefix">DS</field> <field name="padding">5</field> <field name="company_id" eval="False"/> </record> - - <record id="picking_type_dropship" model="stock.picking.type"> <field name="name">Dropship</field> <field name="sequence_id" ref="seq_picking_type_dropship"/> @@ -19,8 +16,7 @@ <field name="default_location_src_id" ref="stock.stock_location_suppliers"/> <field name="default_location_dest_id" ref="stock.stock_location_customers"/> </record> - - + <!-- Drop Shipping--> <record id="route_drop_shipping" model='stock.location.route'> <field name="name">Drop Shipping</field> diff --git a/addons/web/static/src/less/form_view.less b/addons/web/static/src/less/form_view.less index 97d8dcccccd9433dabff9420ac2087042bddb4bb..ef0bcb44be4ff826186d2d4f561b246539d355b0 100644 --- a/addons/web/static/src/less/form_view.less +++ b/addons/web/static/src/less/form_view.less @@ -55,8 +55,9 @@ > .o_form_field { .o-flex(1, 0, 100px); + position: initial; max-width: 100%; - + > .o_form_input_dropdown > .o_form_input { border-style: none!important; } diff --git a/openerp/addons/base/module/module.py b/openerp/addons/base/module/module.py index d1adf9ad9a3eee5931c0f21ce67fcf86285e2bf0..5be5fbf2cad6d2b450ed08229766cd17fed9f735 100644 --- a/openerp/addons/base/module/module.py +++ b/openerp/addons/base/module/module.py @@ -498,6 +498,7 @@ class module(osv.osv): known_dep_ids, exclude_states, context)) return list(known_dep_ids) + @api.returns('self') def upstream_dependencies(self, cr, uid, ids, known_dep_ids=None, exclude_states=['installed', 'uninstallable', 'to remove'], context=None): diff --git a/openerp/models.py b/openerp/models.py index 2b94a3bff5fba0b6723261c00cddbd518c42ec67..ca182955c095724866b8412688b61f9ff77901e9 100644 --- a/openerp/models.py +++ b/openerp/models.py @@ -1126,6 +1126,8 @@ class BaseModel(object): :param dict context: :returns: {ids: list(int)|False, messages: [Message]} """ + if context is None: + context = {} cr.execute('SAVEPOINT model_load') messages = [] @@ -1180,6 +1182,10 @@ class BaseModel(object): if any(message['type'] == 'error' for message in messages): cr.execute('ROLLBACK TO SAVEPOINT model_load') ids = False + + if ids and context.get('defer_parent_store_computation'): + self._parent_store_compute(cr) + return {'ids': ids, 'messages': messages} def _add_fake_fields(self, cr, uid, fields, context=None): diff --git a/openerp/osv/expression.py b/openerp/osv/expression.py index 13413f2fbf5aa6879bcb4d107ea55958eb2bac57..71d5c4303c8e2222926396545953143eee506340 100644 --- a/openerp/osv/expression.py +++ b/openerp/osv/expression.py @@ -711,9 +711,11 @@ class expression(object): """ Return a domain implementing the child_of operator for [(left,child_of,ids)], either as a range using the parent_left/right tree lookup fields (when available), or as an expanded [(left,in,child_ids)] """ + if context is None: + context = {} if not ids: return FALSE_DOMAIN - if left_model._parent_store and (not left_model.pool._init): + if left_model._parent_store and (not left_model.pool._init) and (not context.get('defer_parent_store_computation')): # TODO: Improve where joins are implemented for many with '.', replace by: # doms += ['&',(prefix+'.parent_left','<',o.parent_right),(prefix+'.parent_left','>=',o.parent_left)] doms = [] @@ -736,7 +738,9 @@ class expression(object): """ Return a domain implementing the parent_of operator for [(left,parent_of,ids)], either as a range using the parent_left/right tree lookup fields (when available), or as an expanded [(left,in,parent_ids)] """ - if left_model._parent_store and (not left_model.pool._init): + if context is None: + context = {} + if left_model._parent_store and (not left_model.pool._init) and (not context.get('defer_parent_store_computation')): doms = [] for node in left_model.browse(cr, uid, ids, context=context): if doms: @@ -828,7 +832,7 @@ class expression(object): elif left == 'id' and operator in HIERARCHY_FUNCS: ids2 = to_ids(right, model, context) - dom = HIERARCHY_FUNCS[operator](left, ids2, model) + dom = HIERARCHY_FUNCS[operator](left, ids2, model, context=context) for dom_leaf in reversed(dom): new_leaf = create_substitution_leaf(leaf, dom_leaf, model) push(new_leaf) @@ -949,9 +953,9 @@ class expression(object): elif column._type == 'one2many' and operator in HIERARCHY_FUNCS: ids2 = to_ids(right, comodel, context) if column._obj != model._name: - dom = HIERARCHY_FUNCS[operator](left, ids2, comodel, prefix=column._obj) + dom = HIERARCHY_FUNCS[operator](left, ids2, comodel, prefix=column._obj, context=context) else: - dom = HIERARCHY_FUNCS[operator]('id', ids2, model, parent=left) + dom = HIERARCHY_FUNCS[operator]('id', ids2, model, parent=left, context=context) for dom_leaf in reversed(dom): push(create_substitution_leaf(leaf, dom_leaf, model)) @@ -1007,7 +1011,7 @@ class expression(object): return select_from_where(cr, rel_id1, rel_table, rel_id2, ids, operator) ids2 = to_ids(right, comodel, context) - dom = HIERARCHY_FUNCS[operator]('id', ids2, comodel) + dom = HIERARCHY_FUNCS[operator]('id', ids2, comodel, context=context) ids2 = comodel.search(cr, uid, dom, context=context) push(create_substitution_leaf(leaf, ('id', 'in', _rec_convert(ids2)), model)) else: @@ -1046,9 +1050,9 @@ class expression(object): if operator in HIERARCHY_FUNCS: ids2 = to_ids(right, comodel, context) if column._obj != model._name: - dom = HIERARCHY_FUNCS[operator](left, ids2, comodel, prefix=column._obj) + dom = HIERARCHY_FUNCS[operator](left, ids2, comodel, prefix=column._obj, context=context) else: - dom = HIERARCHY_FUNCS[operator]('id', ids2, model, parent=left) + dom = HIERARCHY_FUNCS[operator]('id', ids2, model, parent=left, context=context) for dom_leaf in reversed(dom): push(create_substitution_leaf(leaf, dom_leaf, model)) else: