[FIX] Fix get_default_ method decorator and definition
In sale.config.settings, the method get_default_sale_config has api.multi decorator. However, the method definition should be def get_default_sale_config(self, cr, uid, fields, context) (see https://github.com/odoo/odoo/blob/9.0/openerp/addons/base/res/res_config.py#L534 ). The api.multi decorator results in the model being browsed with fields as ids, which results in that kind of queries: select * from sale_config_settings where id in ('generate_sales_team_alias') This change corrects the method definition to fix that.
This commit is contained in:
committed by
Goffin Simon
parent
7c11d4e70f
commit
7c432c8b65
@@ -28,8 +28,8 @@ class SaleConfiguration(models.TransientModel):
|
||||
], "Order Routing",
|
||||
implied_group='sale_stock.group_route_so_lines')
|
||||
|
||||
@api.multi
|
||||
def get_default_sale_config(self):
|
||||
@api.model
|
||||
def get_default_sale_config(self, fields):
|
||||
default_picking_policy = self.env['ir.values'].get_default('sale.order', 'picking_policy')
|
||||
return {
|
||||
'default_picking_policy': 1 if default_picking_policy == 'one' else 0,
|
||||
|
||||
Reference in New Issue
Block a user