-
-
Notifications
You must be signed in to change notification settings - Fork 931
[15.0][MIG] purchase_force_invoiced: Migration to 15.0 #1485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
6703614
[11.0][add][purchase_force_invoiced]
JordiBForgeFlow 70e3b46
Apply suggestions from code review
HviorForgeFlow b5f7889
[UPD] Update purchase_force_invoiced.pot
oca-travis 69afca7
[UPD] README.rst
OCA-git-bot 860e84a
[MIG] purchase_force_invoiced: Migration to 12.0
MiquelRForgeFlow c700ee2
[UPD] Update purchase_force_invoiced.pot
oca-travis 11989bc
[UPD] README.rst
OCA-git-bot df9ff51
Added translation using Weblate (Chinese (Simplified))
liweijie0812 da85b8f
Translated using Weblate (Chinese (Simplified))
liweijie0812 0fe4a31
[IMP] purchase_force_invoiced: black, isort
kongrattapong c913856
[MIG] purchase_force_invoiced: Migration to 13.0
kongrattapong c8a1227
[UPD] Update purchase_force_invoiced.pot
oca-travis eeb31d1
[UPD] README.rst
OCA-git-bot 9d33e7d
Update translation files
oca-transbot 015ad76
[14.0][MIG] purchase_force_invoiced: Migration to 14.0
Reyes4711-S73 022981a
[UPD] Update purchase_force_invoiced.pot
oca-travis 32b5c63
[UPD] README.rst
OCA-git-bot b42b0af
[MIG] purchase_force_invoiced black, isort, prettier
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,96 @@ | ||
| ======================= | ||
| Purchase Force Invoiced | ||
| ======================= | ||
|
|
||
| .. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
| !! 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/14.0/purchase_force_invoiced | ||
| :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-14-0/purchase-workflow-14-0-purchase_force_invoiced | ||
| :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/14.0 | ||
| :alt: Try me on Runbot | ||
|
|
||
| |badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
|
||
| This module adds the possibility for users to force the invoice status of the | ||
| purchase orders to 'No Bill to Receive', even when not all the | ||
| quantities, ordered or delivered, have been invoiced. | ||
|
|
||
| This feature is useful in the following scenario: | ||
|
|
||
| * The supplier disputes the quantities to be billed for, after the | ||
| products have been delivered to her/him, and you agree to reduce the | ||
| quantity to invoice (without expecting a refund). | ||
|
|
||
| * When migrating from a previous Odoo version, in some cases there is less | ||
| quantity billed to what was delivered, and you don't want these old purchase | ||
| orders to appear in your 'Waiting Bills' list. | ||
|
|
||
| **Table of contents** | ||
|
|
||
| .. contents:: | ||
| :local: | ||
|
|
||
| Usage | ||
| ===== | ||
|
|
||
| #. Create a purchase order and confirm it. | ||
| #. Receive the products/services. | ||
| #. Create a vendor bill and reduce the invoiced quantity. The purchase order | ||
| invoicing status is 'Waiting Bills'. | ||
| #. Lock the Purchase Order and change its status to 'Done'. | ||
| #. Check the field 'Force Invoiced'. | ||
|
|
||
| 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:%20purchase_force_invoiced%0Aversion:%2014.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 | ||
| ~~~~~~~ | ||
|
|
||
| * Forgeflow | ||
|
|
||
| Contributors | ||
| ~~~~~~~~~~~~ | ||
|
|
||
| * Jordi Ballester <jordi.ballester@eficent.com> | ||
| * Rattapong Chokmasermkul <rattapongc@ecosoft.co.th> | ||
|
|
||
| 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. | ||
|
|
||
| This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/14.0/purchase_force_invoiced>`_ project on GitHub. | ||
|
|
||
| You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains hidden or 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,3 @@ | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) | ||
|
|
||
| from . import model |
This file contains hidden or 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 2019 Eficent Business and IT Consulting Services S.L. | ||
| # Copyright 2019 Aleph Objects, Inc. | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) | ||
|
|
||
| { | ||
| "name": "Purchase Force Invoiced", | ||
| "summary": "Allows to force the billing status of the purchase order to " | ||
| '"Invoiced"', | ||
| "version": "15.0.1.0.0", | ||
| "author": "Forgeflow, Odoo Community Association (OCA)", | ||
| "category": "Purchase Management", | ||
| "license": "AGPL-3", | ||
| "website": "https://github.com/OCA/purchase-workflow", | ||
| "depends": ["purchase"], | ||
| "data": ["view/purchase_view.xml"], | ||
| "installable": True, | ||
| } | ||
This file contains hidden or 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,47 @@ | ||
| # Translation of Odoo Server. | ||
| # This file contains the translation of the following modules: | ||
| # * purchase_force_invoiced | ||
| # | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: Odoo Server 14.0\n" | ||
| "Report-Msgid-Bugs-To: \n" | ||
| "Last-Translator: \n" | ||
| "Language-Team: \n" | ||
| "MIME-Version: 1.0\n" | ||
| "Content-Type: text/plain; charset=UTF-8\n" | ||
| "Content-Transfer-Encoding: \n" | ||
| "Plural-Forms: \n" | ||
|
|
||
| #. module: purchase_force_invoiced | ||
| #: model:ir.model.fields,field_description:purchase_force_invoiced.field_purchase_order__display_name | ||
| msgid "Display Name" | ||
| msgstr "" | ||
|
|
||
| #. module: purchase_force_invoiced | ||
| #: model:ir.model.fields,field_description:purchase_force_invoiced.field_purchase_order__force_invoiced | ||
| msgid "Force invoiced" | ||
| msgstr "" | ||
|
|
||
| #. module: purchase_force_invoiced | ||
| #: model:ir.model.fields,field_description:purchase_force_invoiced.field_purchase_order__id | ||
| msgid "ID" | ||
| msgstr "" | ||
|
|
||
| #. module: purchase_force_invoiced | ||
| #: model:ir.model.fields,field_description:purchase_force_invoiced.field_purchase_order____last_update | ||
| msgid "Last Modified on" | ||
| msgstr "" | ||
|
|
||
| #. module: purchase_force_invoiced | ||
| #: model:ir.model,name:purchase_force_invoiced.model_purchase_order | ||
| msgid "Purchase Order" | ||
| msgstr "" | ||
|
|
||
| #. module: purchase_force_invoiced | ||
| #: model:ir.model.fields,help:purchase_force_invoiced.field_purchase_order__force_invoiced | ||
| msgid "" | ||
| "When you set this field, the purchase order will be considered as fully " | ||
| "billed, even when there may be ordered or delivered quantities pending to " | ||
| "bill. To use this field, the order must be in 'Locked' state" | ||
| msgstr "" |
This file contains hidden or 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,44 @@ | ||
| # Translation of Odoo Server. | ||
| # This file contains the translation of the following modules: | ||
| # * purchase_force_invoiced | ||
| # | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: Odoo Server 12.0\n" | ||
| "Report-Msgid-Bugs-To: \n" | ||
| "PO-Revision-Date: 2019-09-02 14:40+0000\n" | ||
| "Last-Translator: 黎伟杰 <674416404@qq.com>\n" | ||
| "Language-Team: none\n" | ||
| "Language: zh_CN\n" | ||
| "MIME-Version: 1.0\n" | ||
| "Content-Type: text/plain; charset=UTF-8\n" | ||
| "Content-Transfer-Encoding: \n" | ||
| "Plural-Forms: nplurals=1; plural=0;\n" | ||
| "X-Generator: Weblate 3.8\n" | ||
|
|
||
| #. module: purchase_force_invoiced | ||
| #: model:ir.model.fields,field_description:purchase_force_invoiced.field_purchase_order__force_invoiced | ||
| msgid "Force invoiced" | ||
| msgstr "强制开具发票" | ||
|
|
||
| #. module: purchase_force_invoiced | ||
| #: model:ir.model,name:purchase_force_invoiced.model_purchase_order | ||
| msgid "Purchase Order" | ||
| msgstr "采购订单" | ||
|
|
||
| #. module: purchase_force_invoiced | ||
| #: model:ir.model,name:purchase_force_invoiced.model_purchase_order_line | ||
| msgid "Purchase Order Line" | ||
| msgstr "" | ||
|
|
||
| #. module: purchase_force_invoiced | ||
| #: model:ir.model.fields,help:purchase_force_invoiced.field_purchase_order__force_invoiced | ||
| msgid "" | ||
| "When you set this field, the purchase order will be considered as fully " | ||
| "billed, even when there may be ordered or delivered quantities pending to " | ||
| "bill." | ||
| msgstr "" | ||
| "设置此字段时,即使订单或已交付的数量待处理,也会将采购订单视为已完成开票。" | ||
|
|
||
| #~ msgid "Invoice" | ||
| #~ msgstr "发票" |
This file contains hidden or 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,3 @@ | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) | ||
|
|
||
| from . import purchase |
This file contains hidden or 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,26 @@ | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) | ||
|
|
||
| from odoo import api, fields, models | ||
|
|
||
|
|
||
| class PurchaseOrder(models.Model): | ||
| _inherit = "purchase.order" | ||
|
|
||
| force_invoiced = fields.Boolean( | ||
| readonly=True, | ||
| states={"done": [("readonly", False)]}, | ||
| copy=False, | ||
| help="When you set this field, the purchase order will be " | ||
| "considered as fully billed, even when there may be ordered " | ||
| "or delivered quantities pending to bill. To use this field, " | ||
| "the order must be in 'Locked' state", | ||
| ) | ||
|
|
||
| @api.depends("force_invoiced") | ||
| def _get_invoiced(self): | ||
| res = super(PurchaseOrder, self)._get_invoiced() | ||
| for order in self.filtered( | ||
| lambda po: po.force_invoiced and po.invoice_status == "to invoice" | ||
| ): | ||
| order.invoice_status = "invoiced" | ||
| return res |
This file contains hidden or 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 @@ | ||||||
| * Jordi Ballester <jordi.ballester@eficent.com> | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| * Rattapong Chokmasermkul <rattapongc@ecosoft.co.th> | ||||||
This file contains hidden or 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,13 @@ | ||
| This module adds the possibility for users to force the invoice status of the | ||
| purchase orders to 'No Bill to Receive', even when not all the | ||
| quantities, ordered or delivered, have been invoiced. | ||
|
|
||
| This feature is useful in the following scenario: | ||
|
|
||
| * The supplier disputes the quantities to be billed for, after the | ||
| products have been delivered to her/him, and you agree to reduce the | ||
| quantity to invoice (without expecting a refund). | ||
|
|
||
| * When migrating from a previous Odoo version, in some cases there is less | ||
| quantity billed to what was delivered, and you don't want these old purchase | ||
| orders to appear in your 'Waiting Bills' list. |
This file contains hidden or 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,6 @@ | ||
| #. Create a purchase order and confirm it. | ||
| #. Receive the products/services. | ||
| #. Create a vendor bill and reduce the invoiced quantity. The purchase order | ||
| invoicing status is 'Waiting Bills'. | ||
| #. Lock the Purchase Order and change its status to 'Done'. | ||
| #. Check the field 'Force Invoiced'. |
Loading
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.