[MERGE] forward port branch saas-11 up to 3cdf429
This commit is contained in:
@@ -1396,7 +1396,7 @@ class AccountPaymentTerm(models.Model):
|
|||||||
class AccountPaymentTermLine(models.Model):
|
class AccountPaymentTermLine(models.Model):
|
||||||
_name = "account.payment.term.line"
|
_name = "account.payment.term.line"
|
||||||
_description = "Payment Term Line"
|
_description = "Payment Term Line"
|
||||||
_order = "sequence"
|
_order = "sequence, id"
|
||||||
|
|
||||||
value = fields.Selection([
|
value = fields.Selection([
|
||||||
('balance', 'Balance'),
|
('balance', 'Balance'),
|
||||||
|
|||||||
@@ -53,6 +53,9 @@ class SaleOrderEventRegistration(models.TransientModel):
|
|||||||
registration_line.registration_id.write(values)
|
registration_line.registration_id.write(values)
|
||||||
else:
|
else:
|
||||||
self.env['event.registration'].create(values)
|
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'}
|
return {'type': 'ir.actions.act_window_close'}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -455,7 +455,7 @@ class product_template(osv.osv):
|
|||||||
names = [names]
|
names = [names]
|
||||||
res = {id: {} for id in ids}
|
res = {id: {} for id in ids}
|
||||||
templates = self.browse(cr, uid, ids, context=context)
|
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 template in templates:
|
||||||
for name in names:
|
for name in names:
|
||||||
res[template.id][name] = getattr(template.product_variant_ids[0], name) if template.id in unique_templates else 0.0
|
res[template.id][name] = getattr(template.product_variant_ids[0], name) if template.id in unique_templates else 0.0
|
||||||
@@ -464,7 +464,7 @@ class product_template(osv.osv):
|
|||||||
def _set_product_template_field(self, cr, uid, product_tmpl_id, name, value, args, context=None):
|
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 '''
|
''' 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)
|
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)
|
variant = self.pool['product.product'].browse(cr, uid, template.product_variant_ids.id, context=context)
|
||||||
return variant.write({name: value})
|
return variant.write({name: value})
|
||||||
return {}
|
return {}
|
||||||
|
|||||||
@@ -381,7 +381,8 @@ class PurchaseOrder(models.Model):
|
|||||||
'date': self.date_order,
|
'date': self.date_order,
|
||||||
'origin': self.name,
|
'origin': self.name,
|
||||||
'location_dest_id': self._get_destination_location(),
|
'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
|
@api.multi
|
||||||
|
|||||||
@@ -1,16 +1,13 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<openerp>
|
<openerp>
|
||||||
<data>
|
<data noupdate="1">
|
||||||
<!-- Sequence and picking type dropship-->
|
<!-- Sequence and picking type dropship-->
|
||||||
|
|
||||||
<record id="seq_picking_type_dropship" model="ir.sequence">
|
<record id="seq_picking_type_dropship" model="ir.sequence">
|
||||||
<field name="name">Dropship</field>
|
<field name="name">Dropship</field>
|
||||||
<field name="prefix">DS</field>
|
<field name="prefix">DS</field>
|
||||||
<field name="padding">5</field>
|
<field name="padding">5</field>
|
||||||
<field name="company_id" eval="False"/>
|
<field name="company_id" eval="False"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|
||||||
<record id="picking_type_dropship" model="stock.picking.type">
|
<record id="picking_type_dropship" model="stock.picking.type">
|
||||||
<field name="name">Dropship</field>
|
<field name="name">Dropship</field>
|
||||||
<field name="sequence_id" ref="seq_picking_type_dropship"/>
|
<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_src_id" ref="stock.stock_location_suppliers"/>
|
||||||
<field name="default_location_dest_id" ref="stock.stock_location_customers"/>
|
<field name="default_location_dest_id" ref="stock.stock_location_customers"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|
||||||
<!-- Drop Shipping-->
|
<!-- Drop Shipping-->
|
||||||
<record id="route_drop_shipping" model='stock.location.route'>
|
<record id="route_drop_shipping" model='stock.location.route'>
|
||||||
<field name="name">Drop Shipping</field>
|
<field name="name">Drop Shipping</field>
|
||||||
|
|||||||
@@ -55,8 +55,9 @@
|
|||||||
|
|
||||||
> .o_form_field {
|
> .o_form_field {
|
||||||
.o-flex(1, 0, 100px);
|
.o-flex(1, 0, 100px);
|
||||||
|
position: initial;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
|
|
||||||
> .o_form_input_dropdown > .o_form_input {
|
> .o_form_input_dropdown > .o_form_input {
|
||||||
border-style: none!important;
|
border-style: none!important;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1075,6 +1075,10 @@ class BaseModel(object):
|
|||||||
if any(message['type'] == 'error' for message in messages):
|
if any(message['type'] == 'error' for message in messages):
|
||||||
cr.execute('ROLLBACK TO SAVEPOINT model_load')
|
cr.execute('ROLLBACK TO SAVEPOINT model_load')
|
||||||
ids = False
|
ids = False
|
||||||
|
|
||||||
|
if ids and self._context.get('defer_parent_store_computation'):
|
||||||
|
self._parent_store_compute()
|
||||||
|
|
||||||
return {'ids': ids, 'messages': messages}
|
return {'ids': ids, 'messages': messages}
|
||||||
|
|
||||||
def _add_fake_fields(self, fields):
|
def _add_fake_fields(self, fields):
|
||||||
|
|||||||
@@ -717,7 +717,7 @@ class expression(object):
|
|||||||
(when available), or as an expanded [(left,in,child_ids)] """
|
(when available), or as an expanded [(left,in,child_ids)] """
|
||||||
if not ids:
|
if not ids:
|
||||||
return FALSE_DOMAIN
|
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:
|
# TODO: Improve where joins are implemented for many with '.', replace by:
|
||||||
# doms += ['&',(prefix+'.parent_left','<',rec.parent_right),(prefix+'.parent_left','>=',rec.parent_left)]
|
# doms += ['&',(prefix+'.parent_left','<',rec.parent_right),(prefix+'.parent_left','>=',rec.parent_left)]
|
||||||
doms = []
|
doms = []
|
||||||
@@ -740,7 +740,7 @@ class expression(object):
|
|||||||
""" Return a domain implementing the parent_of operator for [(left,parent_of,ids)],
|
""" 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
|
either as a range using the parent_left/right tree lookup fields
|
||||||
(when available), or as an expanded [(left,in,parent_ids)] """
|
(when available), or as an expanded [(left,in,parent_ids)] """
|
||||||
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')):
|
||||||
doms = []
|
doms = []
|
||||||
for rec in left_model.browse(ids):
|
for rec in left_model.browse(ids):
|
||||||
if doms:
|
if doms:
|
||||||
|
|||||||
Reference in New Issue
Block a user