Skip to content

Commit

Permalink
[IMP] account_payment_promissory_note: pre-commit execution
Browse files Browse the repository at this point in the history
  • Loading branch information
unaiberis committed Dec 5, 2024
1 parent bc5ffc5 commit 100ca6c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ class AccountAbstractPayment(models.AbstractModel):
_name = "account.promissory.note.mixin"
_description = "Promissory Note Mixin"

promissory_note = fields.Boolean(string="Promissory Note",)
date_due = fields.Date(string="Due Date",)
promissory_note = fields.Boolean(
string="Promissory Note",
)
date_due = fields.Date(
string="Due Date",
)

@api.onchange("promissory_note")
def _onchange_promissory_note(self):
Expand Down
8 changes: 6 additions & 2 deletions account_payment_promissory_note/models/account_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ class AccountPayment(models.Model):
_inherit = ["account.payment", "account.promissory.note.mixin"]

promissory_note = fields.Boolean(
readonly=True, states={"draft": [("readonly", False)]},
readonly=True,
states={"draft": [("readonly", False)]},
)
date_due = fields.Date(
readonly=True,
states={"draft": [("readonly", False)]},
)
date_due = fields.Date(readonly=True, states={"draft": [("readonly", False)]},)

def _prepare_payment_moves(self):
res = super()._prepare_payment_moves()
Expand Down
6 changes: 6 additions & 0 deletions setup/account_payment_promissory_note/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

0 comments on commit 100ca6c

Please sign in to comment.