[MERGE] forward port branch saas-15 up to 0ae300e9e6

This commit is contained in:
Christophe Simonis
2018-03-08 13:22:28 +01:00
5 changed files with 7 additions and 5 deletions
+2 -1
View File
@@ -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
@@ -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()
+1 -1
View File
@@ -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
-
@@ -19,7 +19,7 @@
<field name="inherit_id" ref="stock.view_inventory_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='date']" position="after">
<field name="accounting_date"/>
<field name="accounting_date" attrs="{'readonly':[('state','!=', 'draft')]}"/>
</xpath>
</field>
</record>
@@ -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'
assert self.move_lines.value == -1400.0, 'Stock move value should have been 1400 euro'