[IMP]pms: New company config check to avoid max amount restriction in downpayments simplified invoice

This commit is contained in:
Darío Lodeiros
2022-11-17 07:35:25 +01:00
parent 7f3747e0aa
commit 95a585c69d
3 changed files with 11 additions and 1 deletions

View File

@@ -344,6 +344,10 @@ class AccountMove(models.Model):
if ( if (
self.pms_property_id self.pms_property_id
and self.amount_total > self.pms_property_id.max_amount_simplified_invoice and self.amount_total > self.pms_property_id.max_amount_simplified_invoice
and (
not self.pms_property_id.avoid_simplified_max_amount_downpayment
or not self._is_downpayment()
)
): ):
mens = _( mens = _(
"The total amount of the simplified invoice is higher than the " "The total amount of the simplified invoice is higher than the "

View File

@@ -194,6 +194,11 @@ class PmsProperty(models.Model):
help="Maximum amount to create the simplified invoice", help="Maximum amount to create the simplified invoice",
default=400.0, default=400.0,
) )
avoid_simplified_max_amount_downpayment = fields.Boolean(
string="Downpayment Invoive without limit amount",
help="Avoid simplified invoice max amount downpayment",
default=True,
)
user_id = fields.Many2one( user_id = fields.Many2one(
string="Team Leader", string="Team Leader",
copy=False, copy=False,
@@ -821,6 +826,6 @@ class PmsProperty(models.Model):
result.append((record.id, record.name)) result.append((record.id, record.name))
else: else:
result.append( result.append(
(record.id, record.name + " (" + record.pms_property_code + ")") (record.id, "[" + record.pms_property_code + "] " + record.name)
) )
return result return result

View File

@@ -117,6 +117,7 @@
]" ]"
/> />
<field name="max_amount_simplified_invoice" /> <field name="max_amount_simplified_invoice" />
<field name="avoid_simplified_max_amount_downpayment" />
</group> </group>
</page> </page>
<page string="Email Configuration"> <page string="Email Configuration">