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 string="Invoice data">
|
||||
<group>
|
||||
<field name="domain" />
|
||||
</group>
|
||||
<group>
|
||||
<field name="invoice_type" />
|
||||
</group>
|
||||
@@ -30,7 +33,6 @@
|
||||
<field name="invoice_group" />
|
||||
</group>
|
||||
</group>
|
||||
<field name="domain" invisible="1" />
|
||||
<group string="Agreement types">
|
||||
<field
|
||||
name="agreement_type_ids"
|
||||
|
||||
@@ -130,9 +130,10 @@ class AgreementSettlementCreateWiz(models.TransientModel):
|
||||
def _prepare_settlement_line(
|
||||
self, domain, group, agreement, line=False, section=False
|
||||
):
|
||||
amount = (
|
||||
group[self._get_amount_field()] or 0.0 + agreement.additional_consumption
|
||||
)
|
||||
amount = group[self._get_amount_field()] or 0.0
|
||||
if self.domain == "purchase":
|
||||
amount = -amount
|
||||
amount += agreement.additional_consumption
|
||||
amount_section = 0.0
|
||||
vals = {
|
||||
"agreement_id": agreement.id,
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<form string="Create settlements">
|
||||
<group>
|
||||
<field name="date" required="1" />
|
||||
<field name="domain" />
|
||||
</group>
|
||||
<group string="Dates filter">
|
||||
<group>
|
||||
@@ -20,7 +21,6 @@
|
||||
</group>
|
||||
</group>
|
||||
<group string="Journals">
|
||||
<field name="domain" invisible="1" />
|
||||
<field
|
||||
name="journal_ids"
|
||||
widget="many2many_tags"
|
||||
|
||||
Reference in New Issue
Block a user