diff --git a/addons/hr_expense/models/hr_expense.py b/addons/hr_expense/models/hr_expense.py
index ee9740a969b..0dbdd5c1c68 100644
--- a/addons/hr_expense/models/hr_expense.py
+++ b/addons/hr_expense/models/hr_expense.py
@@ -370,7 +370,8 @@ class HrExpense(models.Model):
product = default_product
else:
expense_description = expense_description.replace(product_code.group(), '')
- product = self.env['product.product'].search([('default_code', 'ilike', product_code.group(1))]) or default_product
+ products = self.env['product.product'].search([('default_code', 'ilike', product_code.group(1))]) or default_product
+ product = products.filtered(lambda p: p.default_code == product_code.group(1)) or products[0]
pattern = '[-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?'
# Match the last occurence of a float in the string
diff --git a/addons/hr_payroll/wizard/hr_payroll_payslips_by_employees.py b/addons/hr_payroll/wizard/hr_payroll_payslips_by_employees.py
index 73a304daa2e..d9a59cba3a0 100644
--- a/addons/hr_payroll/wizard/hr_payroll_payslips_by_employees.py
+++ b/addons/hr_payroll/wizard/hr_payroll_payslips_by_employees.py
@@ -35,6 +35,7 @@ class HrPayslipEmployees(models.TransientModel):
'date_from': from_date,
'date_to': to_date,
'credit_note': run_data.get('credit_note'),
+ 'company_id': employee.company_id.id,
}
payslips += self.env['hr.payslip'].create(res)
payslips.compute_sheet()
diff --git a/addons/purchase/test/fifo_price.yml b/addons/purchase/test/fifo_price.yml
index 0042d136542..7be91bd1e3a 100644
--- a/addons/purchase/test/fifo_price.yml
+++ b/addons/purchase/test/fifo_price.yml
@@ -3,7 +3,7 @@
-
!python {model: res.company}: |
company = self.env.ref('base.main_company')
- company.currency_id = self.env.ref('base.EUR')
+ self.env.cr.execute("UPDATE res_company SET currency_id = %s WHERE id = %s", [self.env.ref("base.EUR").id, company.id])
-
Set a product as using fifo price
-
diff --git a/addons/stock_account/views/stock_account_views.xml b/addons/stock_account/views/stock_account_views.xml
index bd9f7f523f8..70c1d04e9da 100644
--- a/addons/stock_account/views/stock_account_views.xml
+++ b/addons/stock_account/views/stock_account_views.xml
@@ -19,7 +19,7 @@
-
+
diff --git a/addons/stock_dropshipping/test/lifo_price.yml b/addons/stock_dropshipping/test/lifo_price.yml
index a9c6e18962d..9c3c5f4154e 100644
--- a/addons/stock_dropshipping/test/lifo_price.yml
+++ b/addons/stock_dropshipping/test/lifo_price.yml
@@ -2,7 +2,7 @@
Set the company currency as EURO for the sake of repeatibility
-
!python {model: res.company, id: base.main_company}: |
- self.write({'currency_id':ref('base.EUR')})
+ self.env.cr.execute("UPDATE res_company SET currency_id = %s WHERE id = %s", [self.env.ref("base.EUR").id, self.id])
-
Set product category removal strategy as LIFO
@@ -109,4 +109,4 @@
Check if the move value correctly reflects the fifo costing method
-
!python {model: stock.picking, id: outgoing_lifo_shipment}: |
- assert self.move_lines.value == -1400.0, 'Stock move value should have been 1400 euro'
\ No newline at end of file
+ assert self.move_lines.value == -1400.0, 'Stock move value should have been 1400 euro'