mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[13.0][FIX] contract: Impossible to create invoices from contract lines as section
This commit is contained in:
committed by
Francisco Ivan Anton Prieto
parent
3d88528e9d
commit
3f7449159f
@@ -543,6 +543,9 @@ class ContractLine(models.Model):
|
|||||||
name = self._insert_markers(dates[0], dates[1])
|
name = self._insert_markers(dates[0], dates[1])
|
||||||
invoice_line_vals.update(
|
invoice_line_vals.update(
|
||||||
{
|
{
|
||||||
|
"account_id": invoice_line_vals["account_id"]
|
||||||
|
if "account_id" in invoice_line_vals and not self.display_type
|
||||||
|
else False,
|
||||||
"quantity": self._get_quantity_to_invoice(*dates),
|
"quantity": self._get_quantity_to_invoice(*dates),
|
||||||
"product_uom_id": self.uom_id.id,
|
"product_uom_id": self.uom_id.id,
|
||||||
"discount": self.discount,
|
"discount": self.discount,
|
||||||
@@ -1060,4 +1063,4 @@ class ContractLine(models.Model):
|
|||||||
self, period_first_date, period_last_date, invoice_date
|
self, period_first_date, period_last_date, invoice_date
|
||||||
):
|
):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
return self.quantity
|
return self.quantity if not self.display_type else 0.0
|
||||||
|
|||||||
@@ -135,6 +135,15 @@ class TestContractBase(common.SavepointCase):
|
|||||||
"recurring_rule_type": "monthly",
|
"recurring_rule_type": "monthly",
|
||||||
"date_start": "2018-02-15",
|
"date_start": "2018-02-15",
|
||||||
"contract_line_ids": [
|
"contract_line_ids": [
|
||||||
|
(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
{
|
||||||
|
"product_id": False,
|
||||||
|
"name": "Header for Services",
|
||||||
|
"display_type": "line_section",
|
||||||
|
},
|
||||||
|
),
|
||||||
(
|
(
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
|
|||||||
Reference in New Issue
Block a user