mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[IMP] account_banking_mandate: black, isort, etc...
This commit is contained in:
committed by
Stefan Rijnhart
parent
49ee4bd41a
commit
bd2d666e59
@@ -64,7 +64,8 @@ class AccountBankingMandate(models.Model):
|
||||
string="Unique Mandate Reference", tracking=10, copy=False
|
||||
)
|
||||
signature_date = fields.Date(
|
||||
string="Date of Signature of the Mandate", tracking=50,
|
||||
string="Date of Signature of the Mandate",
|
||||
tracking=50,
|
||||
)
|
||||
scan = fields.Binary(string="Scan of the Mandate")
|
||||
last_debit_date = fields.Date(string="Date of the Last Debit", readonly=True)
|
||||
@@ -135,10 +136,7 @@ class AccountBankingMandate(models.Model):
|
||||
def _check_dates(self):
|
||||
today = fields.Date.context_today(self)
|
||||
for mandate in self:
|
||||
if (
|
||||
mandate.signature_date
|
||||
and mandate.signature_date > today
|
||||
):
|
||||
if mandate.signature_date and mandate.signature_date > today:
|
||||
raise ValidationError(
|
||||
_("The date of signature of mandate '%s' " "is in the future!")
|
||||
% mandate.unique_mandate_reference
|
||||
|
||||
@@ -10,7 +10,9 @@ class AccountMoveLine(models.Model):
|
||||
_inherit = "account.move.line"
|
||||
|
||||
mandate_id = fields.Many2one(
|
||||
"account.banking.mandate", string="Direct Debit Mandate", ondelete="restrict",
|
||||
"account.banking.mandate",
|
||||
string="Direct Debit Mandate",
|
||||
ondelete="restrict",
|
||||
check_company=True,
|
||||
)
|
||||
|
||||
|
||||
@@ -230,8 +230,10 @@ class TestInvoiceMandate(TransactionCase):
|
||||
bank_journal = self.env["account.journal"].search(
|
||||
[
|
||||
("type", "=", "bank"),
|
||||
('company_id', '=', self.company.id),
|
||||
], limit=1)
|
||||
("company_id", "=", self.company.id),
|
||||
],
|
||||
limit=1,
|
||||
)
|
||||
self.mode_inbound_acme.variable_journal_ids = bank_journal
|
||||
self.mode_inbound_acme.payment_method_id.mandate_required = True
|
||||
self.mode_inbound_acme.payment_order_ok = True
|
||||
@@ -284,9 +286,10 @@ class TestInvoiceMandate(TransactionCase):
|
||||
"move_type": "out_invoice",
|
||||
"company_id": self.company.id,
|
||||
"journal_id": self.env["account.journal"]
|
||||
.search([
|
||||
("type", "=", "sale"),
|
||||
('company_id', '=', self.company.id)], limit=1)
|
||||
.search(
|
||||
[("type", "=", "sale"), ("company_id", "=", self.company.id)],
|
||||
limit=1,
|
||||
)
|
||||
.id,
|
||||
"invoice_line_ids": invoice_vals,
|
||||
}
|
||||
|
||||
@@ -37,7 +37,11 @@
|
||||
confirm="You should set a mandate back to draft only if you cancelled it by mistake. Do you want to continue?"
|
||||
invisible="context.get('mandate_bank_partner_view')"
|
||||
/>
|
||||
<field name="state" widget="statusbar" statusbar_visible="draft,valid,expired"/>
|
||||
<field
|
||||
name="state"
|
||||
widget="statusbar"
|
||||
statusbar_visible="draft,valid,expired"
|
||||
/>
|
||||
</header>
|
||||
<sheet>
|
||||
<div class="oe_button_box" name="button_box" />
|
||||
@@ -64,15 +68,17 @@
|
||||
invisible="context.get('mandate_bank_partner_view')"
|
||||
readonly="True"
|
||||
/>
|
||||
<field name="signature_date"
|
||||
options="{'datepicker': {'warn_future': true}}"/>
|
||||
<field
|
||||
name="signature_date"
|
||||
options="{'datepicker': {'warn_future': true}}"
|
||||
/>
|
||||
<field name="scan" />
|
||||
<field name="last_debit_date" />
|
||||
</group>
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids" widget="mail_followers" />
|
||||
<field name="activity_ids" widget="mail_activity"/>
|
||||
<field name="activity_ids" widget="mail_activity" />
|
||||
<field name="message_ids" widget="mail_thread" />
|
||||
</div>
|
||||
</form>
|
||||
@@ -148,11 +154,14 @@
|
||||
groups="account_payment_order.group_account_payment"
|
||||
attrs="{'invisible': ['|', ('id', '=', False), ('state', '!=', 'cancel')]}"
|
||||
/>
|
||||
<field name="state" widget="badge"
|
||||
<field
|
||||
name="state"
|
||||
widget="badge"
|
||||
decoration-info="state == 'draft'"
|
||||
decoration-success="state == 'valid'"
|
||||
decoration-muted="state == 'cancel'"
|
||||
decoration-warning="state == 'expired'"/>
|
||||
decoration-warning="state == 'expired'"
|
||||
/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
../../../../account_banking_mandate
|
||||
6
setup/account_banking_mandate/setup.py
Normal file
6
setup/account_banking_mandate/setup.py
Normal file
@@ -0,0 +1,6 @@
|
||||
import setuptools
|
||||
|
||||
setuptools.setup(
|
||||
setup_requires=['setuptools-odoo'],
|
||||
odoo_addon=True,
|
||||
)
|
||||
Reference in New Issue
Block a user