-
-
Notifications
You must be signed in to change notification settings - Fork 746
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by dreispt
- Loading branch information
Showing
29 changed files
with
1,337 additions
and
0 deletions.
There are no files selected for viewing
86 changes: 86 additions & 0 deletions
86
account_fiscal_position_allowed_journal_purchase/README.rst
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,86 @@ | ||
================================================ | ||
Account Fiscal Position Allowed Journal Purchase | ||
================================================ | ||
|
||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! 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-OCA%2Fpurchase--workflow-lightgray.png?logo=github | ||
:target: https://github.com/OCA/purchase-workflow/tree/13.0/account_fiscal_position_allowed_journal_purchase | ||
:alt: OCA/purchase-workflow | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/purchase-workflow-13-0/purchase-workflow-13-0-account_fiscal_position_allowed_journal_purchase | ||
:alt: Translate me on Weblate | ||
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png | ||
:target: https://runbot.odoo-community.org/runbot/142/13.0 | ||
:alt: Try me on Runbot | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
When creating an invoice from a purchase order, take the allowed purchase journal on the fiscal position, if there is exactly one on it. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Configuration | ||
============= | ||
|
||
See configuration of Account Fiscal Position Allowed Journal. | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/purchase-workflow/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/OCA/purchase-workflow/issues/new?body=module:%20account_fiscal_position_allowed_journal_purchase%0Aversion:%2013.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 | ||
~~~~~~~ | ||
|
||
* ACSONE SA/NV | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* Thomas Binsfeld <thomas.binsfeld@acsone.eu> (https://www.acsone.eu/) | ||
|
||
Maintainers | ||
~~~~~~~~~~~ | ||
|
||
This module is maintained by the OCA. | ||
|
||
.. image:: https://odoo-community.org/logo.png | ||
:alt: Odoo Community Association | ||
:target: https://odoo-community.org | ||
|
||
OCA, or the Odoo Community Association, is a nonprofit organization whose | ||
mission is to support the collaborative development of Odoo features and | ||
promote its widespread use. | ||
|
||
.. |maintainer-ThomasBinsfeld| image:: https://github.com/ThomasBinsfeld.png?size=40px | ||
:target: https://github.com/ThomasBinsfeld | ||
:alt: ThomasBinsfeld | ||
|
||
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__: | ||
|
||
|maintainer-ThomasBinsfeld| | ||
|
||
This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/13.0/account_fiscal_position_allowed_journal_purchase>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/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 |
17 changes: 17 additions & 0 deletions
17
account_fiscal_position_allowed_journal_purchase/__manifest__.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,17 @@ | ||
# Copyright 2020 ACSONE SA/NV | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "Account Fiscal Position Allowed Journal Purchase", | ||
"summary": """ | ||
Use an allowed journal when creating an invoice from a purchase order.""", | ||
"version": "13.0.1.0.0", | ||
"development_status": "Beta", | ||
"license": "AGPL-3", | ||
"author": "ACSONE SA/NV,Odoo Community Association (OCA)", | ||
"maintainers": ["ThomasBinsfeld"], | ||
"website": "https://github.com/OCA/purchase-workflow", | ||
"depends": ["purchase", "account_fiscal_position_allowed_journal"], | ||
"data": [], | ||
"demo": [], | ||
} |
1 change: 1 addition & 0 deletions
1
account_fiscal_position_allowed_journal_purchase/models/__init__.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 @@ | ||
from . import account_move |
32 changes: 32 additions & 0 deletions
32
account_fiscal_position_allowed_journal_purchase/models/account_move.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,32 @@ | ||
# Copyright 2020 ACSONE SA/NV | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import api, models | ||
|
||
|
||
class AccountMove(models.Model): | ||
_inherit = "account.move" | ||
|
||
@api.onchange("purchase_vendor_bill_id", "purchase_id") | ||
def _onchange_purchase_auto_complete(self): | ||
""" | ||
If there is a purchase order and a fiscal position on it which have exactly | ||
one purchase journal allowed, set this journal on the invoice. | ||
""" | ||
# We need to save de PO because the origin method unset it | ||
purchase_order = self.purchase_id | ||
res = super()._onchange_purchase_auto_complete() | ||
fiscal_position = purchase_order.fiscal_position_id | ||
if fiscal_position: | ||
purchase_journal = fiscal_position._get_allowed_journal("purchase") | ||
if purchase_journal: | ||
self.journal_id = purchase_journal | ||
return res | ||
|
||
@api.onchange("partner_id", "company_id") | ||
def _onchange_partner_id(self): | ||
journal = self.journal_id | ||
res = super()._onchange_partner_id() | ||
self.journal_id = journal | ||
self._onchange_fiscal_position_allowed_journal() | ||
return res |
1 change: 1 addition & 0 deletions
1
account_fiscal_position_allowed_journal_purchase/readme/CONFIGURE.rst
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 @@ | ||
See configuration of Account Fiscal Position Allowed Journal. |
1 change: 1 addition & 0 deletions
1
account_fiscal_position_allowed_journal_purchase/readme/CONTRIBUTORS.rst
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 @@ | ||
* Thomas Binsfeld <thomas.binsfeld@acsone.eu> (https://www.acsone.eu/) |
1 change: 1 addition & 0 deletions
1
account_fiscal_position_allowed_journal_purchase/readme/DESCRIPTION.rst
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 @@ | ||
When creating an invoice from a purchase order, take the allowed purchase journal on the fiscal position, if there is exactly one on it. |
Binary file added
BIN
+9.23 KB
account_fiscal_position_allowed_journal_purchase/static/description/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.