forked from OCA/account-invoicing
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[10.0][IMP] account_invoice_date_required: Add check as optional
- Loading branch information
1 parent
60635b4
commit bb6912f
Showing
11 changed files
with
105 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
from . import account_invoice | ||
from . import res_company | ||
from . import account_config_settings |
15 changes: 15 additions & 0 deletions
15
account_invoice_date_required/models/account_config_settings.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2019 ACSONE SA/NV | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class AccountConfigSettings(models.TransientModel): | ||
|
||
_inherit = 'account.config.settings' | ||
|
||
invoice_date_required = fields.Boolean( | ||
related='company_id.invoice_date_required', | ||
string='Invoice Date is Required', | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2019 ACSONE SA/NV | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class ResCompany(models.Model): | ||
|
||
_inherit = 'res.company' | ||
|
||
invoice_date_required = fields.Boolean( | ||
string='Invoice Date is Required', | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Go to Accounting > Settings > Invoicing & Payments > Date Required | ||
|
||
Check the box if you want to make the invoice date required before | ||
validation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Create an invoice with a void date (Invoicing > Sales > Customer Invoices). | ||
Create an invoice with a void date (Accounting > Sales > Customer Invoices). | ||
|
||
Try to validate it. An error is raised. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
account_invoice_date_required/views/account_config_settings.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Copyright 2016 ACSONE SA/NV | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> | ||
|
||
<odoo> | ||
<record id="view_account_config" model="ir.ui.view"> | ||
<field name="name">account settings (in account_invoice_date_required)</field> | ||
<field name="model">account.config.settings</field> | ||
<field name="inherit_id" ref="account.view_account_config_settings"/> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//group[div[@name='customer_payments']]" position="after"> | ||
<group> | ||
<label for="id" string="Date Required"/> | ||
<div name="date_required"> | ||
<label for="invoice_date_required" string="Invoice Date Required"/> | ||
<field name="invoice_date_required"/> | ||
</div> | ||
</group> | ||
</xpath> | ||
</field> | ||
</record> | ||
</odoo> |