Skip to content

Commit

Permalink
[MIG] fieldservice_stock_account: Migration to 13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
baimont committed May 21, 2021
1 parent ef8e2b8 commit 79def90
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 27 deletions.
14 changes: 7 additions & 7 deletions fieldservice_stock_account/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ Field Service - Stock Account
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Ffield--service-lightgray.png?logo=github
:target: https://github.com/OCA/field-service/tree/12.0/fieldservice_stock_account
:target: https://github.com/OCA/field-service/tree/13.0/fieldservice_stock_account
:alt: OCA/field-service
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/field-service-12-0/field-service-12-0-fieldservice_stock_account
:target: https://translation.odoo-community.org/projects/field-service-13-0/field-service-13-0-fieldservice_stock_account
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/264/12.0
:target: https://runbot.odoo-community.org/runbot/264/13.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|
|badge1| |badge2| |badge3| |badge4| |badge5|

If inventory items were delivered to a customer location, the delivery will generate an accounting entry in the stock output account. The balance of that account will keep increasing as those inventory items will not get invoiced.

Expand Down Expand Up @@ -63,7 +63,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/field-service/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/field-service/issues/new?body=module:%20fieldservice_stock_account%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/field-service/issues/new?body=module:%20fieldservice_stock_account%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.

Expand Down Expand Up @@ -109,8 +109,8 @@ promote its widespread use.

Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-bodedra| |maintainer-max3903|
|maintainer-bodedra| |maintainer-max3903|

This module is part of the `OCA/field-service <https://github.com/OCA/field-service/tree/12.0/fieldservice_stock_account>`_ project on GitHub.
This module is part of the `OCA/field-service <https://github.com/OCA/field-service/tree/13.0/fieldservice_stock_account>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
6 changes: 3 additions & 3 deletions fieldservice_stock_account/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

{
"name": "Field Service - Stock Account",
"version": "12.0.2.0.0",
"version": "13.0.1.0.0",
"category": "Field Service",
"summary": "Invoice inventory items delivered with Field Service orders",
"author": "Open Source Integrators, " "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/field-service",
"depends": [
"fieldservice_account",
"fieldservice_stock_request",
"fieldservice_isp_account",
"fieldservice_stock",
"account_invoice_report_hide_line",
],
"data": [],
Expand Down
2 changes: 1 addition & 1 deletion fieldservice_stock_account/i18n/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2019-11-26 11:58+0000\n"
"Last-Translator: Maria Sparenberg <[email protected]>\n"
Expand Down
4 changes: 2 additions & 2 deletions fieldservice_stock_account/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2019-12-14 16:05+0000\n"
"PO-Revision-Date: 2019-13-14 16:05+0000\n"
"Last-Translator: Nelson Ramírez Sánchez <[email protected]>\n"
"Language-Team: none\n"
"Language: es\n"
Expand Down
4 changes: 2 additions & 2 deletions fieldservice_stock_account/i18n/es_CL.po
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2019-12-14 16:05+0000\n"
"PO-Revision-Date: 2019-13-14 16:05+0000\n"
"Last-Translator: Nelson Ramírez Sánchez <[email protected]>\n"
"Language-Team: none\n"
"Language: es_CL\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: <>\n"
"Language-Team: \n"
Expand Down
2 changes: 1 addition & 1 deletion fieldservice_stock_account/i18n/pt_BR.po
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2020-05-20 09:19+0000\n"
"Last-Translator: Marcel Savegnago <[email protected]>\n"
Expand Down
14 changes: 7 additions & 7 deletions fieldservice_stock_account/models/fsm_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,30 @@ def _prepare_inv_line_for_stock_request(self, stock_request, invoice=False):
"price_unit": 0,
"show_in_report": False,
"account_id": account.id,
"invoice_id": invoice.id,
"move_id": invoice.id,
}
return vals

def _create_inv_line_for_stock_requests(self, invoice=False):
for stock_request in self.stock_request_ids:
vals = self._prepare_inv_line_for_stock_request(stock_request, invoice)
self.env["account.invoice.line"].create(vals)
self.env["account.move.line"].create(vals)

def account_create_invoice(self):
invoice = super().account_create_invoice()
invoice = super(FSMOrder, self).account_create_invoice()
if self.location_id.inventory_location_id.usage == "customer":
self._create_inv_line_for_stock_requests(invoice)
return invoice

def account_no_invoice(self):
res = super().account_no_invoice()
res = super(FSMOrder, self).account_no_invoice()
if (
self.stock_request_ids
and self.location_id.inventory_location_id.usage == "customer"
):
jrnl = self.env["account.journal"].search(
[
("company_id", "=", self.env.user.company_id.id),
("company_id", "=", self.env.company_id.id),
("type", "=", "sale"),
("active", "=", True),
],
Expand All @@ -58,7 +58,7 @@ def account_no_invoice(self):
"fiscal_position_id": fpos.id or False,
"fsm_order_id": self.id,
}
invoice = self.env["account.invoice"].sudo().create(vals)
invoice = self.env["account.move"].sudo().create(vals)
else:
fpos = self.location_id.customer_id.property_account_position_id
vals = {
Expand All @@ -68,7 +68,7 @@ def account_no_invoice(self):
"fiscal_position_id": fpos.id or False,
"fsm_order_id": self.id,
}
invoice = self.env["account.invoice"].sudo().create(vals)
invoice = self.env["account.move"].sudo().create(vals)
self._create_inv_line_for_stock_requests(invoice)
# Validate and paid invoice
invoice.action_invoice_open()
Expand Down
6 changes: 3 additions & 3 deletions fieldservice_stock_account/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Field Service - Stock Account</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/field-service/tree/12.0/fieldservice_stock_account"><img alt="OCA/field-service" src="https://img.shields.io/badge/github-OCA%2Ffield--service-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/field-service-12-0/field-service-12-0-fieldservice_stock_account"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/264/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/field-service/tree/13.0/fieldservice_stock_account"><img alt="OCA/field-service" src="https://img.shields.io/badge/github-OCA%2Ffield--service-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/field-service-13-0/field-service-13-0-fieldservice_stock_account"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/264/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>If inventory items were delivered to a customer location, the delivery will generate an accounting entry in the stock output account. The balance of that account will keep increasing as those inventory items will not get invoiced.</p>
<p>This module allows you to automatically adds inventory items delivered as part of the field service order to a customer invoice to account for their value as a cost of goods (or service) sold.</p>
<p><strong>Table of contents</strong></p>
Expand Down Expand Up @@ -424,7 +424,7 @@ <h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/field-service/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/field-service/issues/new?body=module:%20fieldservice_stock_account%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/field-service/issues/new?body=module:%20fieldservice_stock_account%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand Down Expand Up @@ -457,7 +457,7 @@ <h2><a class="toc-backref" href="#id7">Maintainers</a></h2>
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p>
<p><a class="reference external" href="https://github.com/bodedra"><img alt="bodedra" src="https://github.com/bodedra.png?size=40px" /></a> <a class="reference external" href="https://github.com/max3903"><img alt="max3903" src="https://github.com/max3903.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/field-service/tree/12.0/fieldservice_stock_account">OCA/field-service</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/field-service/tree/13.0/fieldservice_stock_account">OCA/field-service</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down

0 comments on commit 79def90

Please sign in to comment.