[MERGE] forward port branch saas-14 up to ab8e27382f
This commit is contained in:
@@ -108,7 +108,7 @@ class AccountInvoiceReport(models.Model):
|
||||
1 AS nbr,
|
||||
ai.type, ai.state, pt.categ_id, ai.date_due, ai.account_id, ail.account_id AS account_line_id,
|
||||
ai.partner_bank_id,
|
||||
SUM ((invoice_type.sign * ail.quantity) / u.factor * u2.factor) AS product_qty,
|
||||
SUM ((invoice_type.sign_qty * ail.quantity) / u.factor * u2.factor) AS product_qty,
|
||||
SUM(ail.price_subtotal_signed * invoice_type.sign) AS price_total,
|
||||
SUM(ABS(ail.price_subtotal_signed)) / CASE
|
||||
WHEN SUM(ail.quantity / u.factor * u2.factor) <> 0::numeric
|
||||
@@ -137,7 +137,11 @@ class AccountInvoiceReport(models.Model):
|
||||
WHEN ai.type::text = ANY (ARRAY['in_refund'::character varying::text, 'in_invoice'::character varying::text])
|
||||
THEN -1
|
||||
ELSE 1
|
||||
END) AS sign
|
||||
END) AS sign,(CASE
|
||||
WHEN ai.type::text = ANY (ARRAY['out_refund'::character varying::text, 'in_invoice'::character varying::text])
|
||||
THEN -1
|
||||
ELSE 1
|
||||
END) AS sign_qty
|
||||
FROM account_invoice ai
|
||||
) AS invoice_type ON invoice_type.id = ai.id
|
||||
"""
|
||||
|
||||
@@ -38,10 +38,10 @@ class AccountAnalyticLine(models.Model):
|
||||
return {}
|
||||
unit_amount = values.get('unit_amount', 0.0) or self.unit_amount
|
||||
user_id = values.get('user_id') or self.user_id.id or self._default_user()
|
||||
project = values.get('project_id') and self.env['project.project'].browse([values['project_id']]) or self.project_id
|
||||
emp = self.env['hr.employee'].search([('user_id', '=', user_id)], limit=1)
|
||||
account = values.get('account_id') and self.env['account.analytic.account'].browse([values['account_id']]) or self.account_id or emp.account_id
|
||||
cost = emp and emp.timesheet_cost or 0.0
|
||||
uom = project.company_id.project_time_mode_id
|
||||
uom = account.company_id.sudo().project_time_mode_id
|
||||
# Nominal employee cost = 1 * company project UoM (project_time_mode_id)
|
||||
return {
|
||||
'amount': -unit_amount * cost,
|
||||
|
||||
@@ -1775,6 +1775,13 @@
|
||||
<field name="currency_id" ref="ZWD" />
|
||||
<field eval="263" name="phone_code" />
|
||||
</record>
|
||||
<record id="xk" model="res.country">
|
||||
<field name="name">Kosovo</field>
|
||||
<field name="code">xk</field>
|
||||
<field file="base/static/img/country_flags/xk.png" name="image" type="base64" />
|
||||
<field name="currency_id" ref="EUR" />
|
||||
<field eval="383" name="phone_code" />
|
||||
</record>
|
||||
|
||||
<record id="europe" model="res.country.group">
|
||||
<field name="name">Europe</field>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
Reference in New Issue
Block a user