mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP]pms: New company config check to avoid max amount restriction in downpayments simplified invoice
This commit is contained in:
@@ -344,6 +344,10 @@ class AccountMove(models.Model):
|
||||
if (
|
||||
self.pms_property_id
|
||||
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 = _(
|
||||
"The total amount of the simplified invoice is higher than the "
|
||||
|
||||
@@ -194,6 +194,11 @@ class PmsProperty(models.Model):
|
||||
help="Maximum amount to create the simplified invoice",
|
||||
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(
|
||||
string="Team Leader",
|
||||
copy=False,
|
||||
@@ -821,6 +826,6 @@ class PmsProperty(models.Model):
|
||||
result.append((record.id, record.name))
|
||||
else:
|
||||
result.append(
|
||||
(record.id, record.name + " (" + record.pms_property_code + ")")
|
||||
(record.id, "[" + record.pms_property_code + "] " + record.name)
|
||||
)
|
||||
return result
|
||||
|
||||
@@ -117,6 +117,7 @@
|
||||
]"
|
||||
/>
|
||||
<field name="max_amount_simplified_invoice" />
|
||||
<field name="avoid_simplified_max_amount_downpayment" />
|
||||
</group>
|
||||
</page>
|
||||
<page string="Email Configuration">
|
||||
|
||||
Reference in New Issue
Block a user