-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #135 from coopiteasy/12.0-mig-invoice_default_acco…
…unt_date [12.0][MIG] invoice_default_account_date >> account_invoice_default_account_date
- Loading branch information
Showing
9 changed files
with
530 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
============================ | ||
Invoice Default Account Date | ||
============================ | ||
|
||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png | ||
:target: https://odoo-community.org/page/development-status | ||
:alt: Beta | ||
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png | ||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
.. |badge3| image:: https://img.shields.io/badge/github-coopiteasy%2Faddons-lightgray.png?logo=github | ||
:target: https://github.com/coopiteasy/addons/tree/12.0/account_invoice_default_account_date | ||
:alt: coopiteasy/addons | ||
|
||
|badge1| |badge2| |badge3| | ||
|
||
On a Vendor Bill, sets Accounting Date (date) | ||
to the invoice validation date instead of Bill Date (date_invoice). | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Known issues / Roadmap | ||
====================== | ||
|
||
This module will set `date` as `context_today()` at any `write` (even if still in `draft`). | ||
We should set the date either when the invoice is validated or switches to 'open'. | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/coopiteasy/addons/issues>`_. | ||
In case of trouble, please check there if your issue has already been reported. | ||
If you spotted it first, help us smashing it by providing a detailed and welcomed | ||
`feedback <https://github.com/coopiteasy/addons/issues/new?body=module:%20account_invoice_default_account_date%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
||
Do not contact contributors directly about support or help with technical issues. | ||
|
||
Credits | ||
======= | ||
|
||
Authors | ||
~~~~~~~ | ||
|
||
* Coop IT Easy SCRLfs | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* Robin Keunen <[email protected]> | ||
* Vincent Van Rossem <[email protected]> | ||
|
||
Maintainers | ||
~~~~~~~~~~~ | ||
|
||
This module is part of the `coopiteasy/addons <https://github.com/coopiteasy/addons/tree/12.0/account_invoice_default_account_date>`_ project on GitHub. | ||
|
||
You are welcome to contribute. |
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 @@ | ||
from . import models |
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,17 @@ | ||
# Copyright 2017 - Today Coop IT Easy SCRLfs (<http://www.coopiteasy.be>) | ||
# - Robin Keunen <[email protected]> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
{ | ||
"name": "Invoice Default Account Date", | ||
"version": "12.0.1.0.0", | ||
"depends": ["account"], | ||
"author": "Coop IT Easy SCRLfs", | ||
"license": "AGPL-3", | ||
"category": "Invoice", | ||
"website": "https://coopiteasy.be", | ||
"summary": """ | ||
Sets the accounting date to the invoice date by default. | ||
""", | ||
"data": [], | ||
"installable": True, | ||
} |
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 @@ | ||
from . import account_invoice |
18 changes: 18 additions & 0 deletions
18
account_invoice_default_account_date/models/account_invoice.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,18 @@ | ||
from odoo import api, fields, models | ||
|
||
|
||
class AccountInvoice(models.Model): | ||
_inherit = "account.invoice" | ||
|
||
@api.multi | ||
def write(self, vals): | ||
# vendor bills | ||
if ( | ||
not self.date | ||
and "date" not in vals | ||
and self.type in ("in_invoice", "in_refund") | ||
): | ||
|
||
vals["date"] = fields.Date.context_today(self) | ||
|
||
return super(AccountInvoice, self).write(vals) |
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,2 @@ | ||
* Robin Keunen <[email protected]> | ||
* Vincent Van Rossem <[email protected]> |
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,2 @@ | ||
On a Vendor Bill, sets Accounting Date (date) | ||
to the invoice validation date instead of Bill Date (date_invoice). |
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,2 @@ | ||
This module will set `date` as `context_today()` at any `write` (even if still in `draft`). | ||
We should set the date either when the invoice is validated or switches to 'open'. |
Oops, something went wrong.