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 (
|
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 "
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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">
|
||||||
|
|||||||
Reference in New Issue
Block a user