mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[IMP] agreement_rebate: Improvements
This commit is contained in:
@@ -14,6 +14,9 @@
|
|||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
<group string="Invoice data">
|
<group string="Invoice data">
|
||||||
|
<group>
|
||||||
|
<field name="domain" />
|
||||||
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<field name="invoice_type" />
|
<field name="invoice_type" />
|
||||||
</group>
|
</group>
|
||||||
@@ -30,7 +33,6 @@
|
|||||||
<field name="invoice_group" />
|
<field name="invoice_group" />
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
<field name="domain" invisible="1" />
|
|
||||||
<group string="Agreement types">
|
<group string="Agreement types">
|
||||||
<field
|
<field
|
||||||
name="agreement_type_ids"
|
name="agreement_type_ids"
|
||||||
|
|||||||
@@ -130,9 +130,10 @@ class AgreementSettlementCreateWiz(models.TransientModel):
|
|||||||
def _prepare_settlement_line(
|
def _prepare_settlement_line(
|
||||||
self, domain, group, agreement, line=False, section=False
|
self, domain, group, agreement, line=False, section=False
|
||||||
):
|
):
|
||||||
amount = (
|
amount = group[self._get_amount_field()] or 0.0
|
||||||
group[self._get_amount_field()] or 0.0 + agreement.additional_consumption
|
if self.domain == "purchase":
|
||||||
)
|
amount = -amount
|
||||||
|
amount += agreement.additional_consumption
|
||||||
amount_section = 0.0
|
amount_section = 0.0
|
||||||
vals = {
|
vals = {
|
||||||
"agreement_id": agreement.id,
|
"agreement_id": agreement.id,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
<form string="Create settlements">
|
<form string="Create settlements">
|
||||||
<group>
|
<group>
|
||||||
<field name="date" required="1" />
|
<field name="date" required="1" />
|
||||||
|
<field name="domain" />
|
||||||
</group>
|
</group>
|
||||||
<group string="Dates filter">
|
<group string="Dates filter">
|
||||||
<group>
|
<group>
|
||||||
@@ -20,7 +21,6 @@
|
|||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
<group string="Journals">
|
<group string="Journals">
|
||||||
<field name="domain" invisible="1" />
|
|
||||||
<field
|
<field
|
||||||
name="journal_ids"
|
name="journal_ids"
|
||||||
widget="many2many_tags"
|
widget="many2many_tags"
|
||||||
|
|||||||
Reference in New Issue
Block a user