[MIG] stock_request_submit: Migration to 13.0

[UPD] Update stock_request_submit.pot
This commit is contained in:
ps-tubtim
2020-10-16 18:15:54 +07:00
committed by Patrick Wilson
parent 1f54d6088e
commit 9f92167b65
11 changed files with 57 additions and 47 deletions

View File

@@ -14,13 +14,13 @@ Stock Request Submit
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github
:target: https://github.com/OCA/stock-logistics-warehouse/tree/12.0/stock_request_submit
:target: https://github.com/OCA/stock-logistics-warehouse/tree/13.0/stock_request_submit
:alt: OCA/stock-logistics-warehouse
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-12-0/stock-logistics-warehouse-12-0-stock_request_submit
:target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-13-0/stock-logistics-warehouse-13-0-stock_request_submit
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/153/12.0
:target: https://runbot.odoo-community.org/runbot/153/13.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -41,7 +41,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-warehouse/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/stock-logistics-warehouse/issues/new?body=module:%20stock_request_submit%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_request_submit%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.
@@ -62,7 +62,7 @@ Contributors
* Steve Campbell <scampbell@opensourceintegrators.com>
* Héctor Villarreal Ortega <hector.villarreal@eficent.com>
* Pimolnat Suntian <pimolnats@ecosoft.co.th>
Maintainers
~~~~~~~~~~~
@@ -77,6 +77,6 @@ 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/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/12.0/stock_request_submit>`_ project on GitHub.
This module is part of the `OCA/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/13.0/stock_request_submit>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@@ -1,5 +1,5 @@
# Copyright 2019 Open Source Integrators
# Copyright 2019 Eficent Business and IT Consulting Services, S.L.
# Copyright 2019-2020 ForgeFlow S.L. (https://www.forgeflow.com)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
@@ -8,7 +8,7 @@
"version": "13.0.1.0.0",
"license": "LGPL-3",
"website": "https://github.com/stock-logistics-warehouse",
"author": "Open Source Integrators, " "Odoo Community Association (OCA)",
"author": "Open Source Integrators, Odoo Community Association (OCA)",
"category": "Warehouse Management",
"depends": ["stock_request"],
"data": ["views/stock_request_order_views.xml", "views/stock_request_views.xml"],

View File

@@ -1,12 +1,12 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_request_submit
# * stock_request_submit
#
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"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -33,4 +33,3 @@ msgstr ""
#: model_terms:ir.ui.view,arch_db:stock_request_submit.view_stock_request_form
msgid "Submit"
msgstr ""

View File

@@ -1,7 +1,7 @@
# Copyright 2019 Open Source Integrators
# Copyright 2019 Eficent Business and IT Consulting Services, S.L.
# Copyright 2019-2020 ForgeFlow S.L. (https://www.forgeflow.com)
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from odoo import api, fields, models
from odoo import fields, models
class StockRequest(models.Model):
@@ -19,17 +19,15 @@ class StockRequest(models.Model):
states={"draft": [("readonly", False)], "submitted": [("readonly", False)]}
)
@api.multi
def action_submit(self):
self._action_submit()
@api.multi
def _action_submit(self):
self.state = "submitted"
def _skip_procurement(self):
return (
super(StockRequest, self)._skip_procurement()
super()._skip_procurement()
and self.state != "submitted"
or self.product_id.type not in ("consu", "product")
)

View File

@@ -1,13 +1,12 @@
# Copyright 2019 Open Source Integrators
# Copyright 2019 Eficent Business and IT Consulting Services, S.L.
# Copyright 2019-2020 ForgeFlow S.L. (https://www.forgeflow.com)
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from odoo import api, models
from odoo import models
class StockRequestOrder(models.Model):
_inherit = "stock.request.order"
@api.multi
def action_submit(self):
for line in self.stock_request_ids:
line.action_submit()

View File

@@ -4,3 +4,4 @@
* Steve Campbell <scampbell@opensourceintegrators.com>
* Héctor Villarreal Ortega <hector.villarreal@eficent.com>
* Pimolnat Suntian <pimolnats@ecosoft.co.th>

View File

@@ -367,7 +367,7 @@ ul.auto-toc {
!! 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/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/12.0/stock_request_submit"><img alt="OCA/stock-logistics-warehouse" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/stock-logistics-warehouse-12-0/stock-logistics-warehouse-12-0-stock_request_submit"><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/153/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/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/13.0/stock_request_submit"><img alt="OCA/stock-logistics-warehouse" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/stock-logistics-warehouse-13-0/stock-logistics-warehouse-13-0-stock_request_submit"><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/153/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module adds a new state Submitted to Stock Request.</p>
<p>The porpose of this state is to allow Supervisors to validate the submitted
request enabling them to correct Routes if required.</p>
@@ -388,7 +388,7 @@ request enabling them to correct Routes if required.</p>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/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/stock-logistics-warehouse/issues/new?body=module:%20stock_request_submit%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/stock-logistics-warehouse/issues/new?body=module:%20stock_request_submit%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">
@@ -408,6 +408,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
</ul>
</li>
<li>Héctor Villarreal Ortega &lt;<a class="reference external" href="mailto:hector.villarreal&#64;eficent.com">hector.villarreal&#64;eficent.com</a>&gt;</li>
<li>Pimolnat Suntian &lt;<a class="reference external" href="mailto:pimolnats&#64;ecosoft.co.th">pimolnats&#64;ecosoft.co.th</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
@@ -417,7 +418,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/12.0/stock_request_submit">OCA/stock-logistics-warehouse</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/13.0/stock_request_submit">OCA/stock-logistics-warehouse</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>

View File

@@ -1,4 +1,4 @@
# Copyright 2017 Eficent Business and IT Consulting Services S.L.
# Copyright 2017-2020 ForgeFlow S.L. (https://www.forgeflow.com)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0).
from odoo import fields
@@ -7,7 +7,7 @@ from odoo.addons.stock_request.tests import test_stock_request
class TestStockRequestSubmit(test_stock_request.TestStockRequest):
def setUp(self):
super(TestStockRequestSubmit, self).setUp()
super().setUp()
def test_stock_request_submit(self):
expected_date = fields.Datetime.now()
@@ -33,7 +33,7 @@ class TestStockRequestSubmit(test_stock_request.TestStockRequest):
],
}
order = self.request_order.sudo(self.stock_request_user).create(vals)
order = self.request_order.with_user(self.stock_request_user).create(vals)
stock_request = order.stock_request_ids

View File

@@ -1,4 +1,4 @@
# Copyright 2019 Eficent Business and IT Consulting Services, S.L.
# Copyright 2019-2020 ForgeFlow S.L. (https://www.forgeflow.com)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import SUPERUSER_ID, api

View File

@@ -1,20 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!-- Copyright 2019 Open Source Integrators
Copyright 2019 Eficent Business and IT Consulting Services, S.L.
License LGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<!-- Copyright 2019 Open Source Integrators
Copyright 2019-2020 ForgeFlow S.L. (https://www.forgeflow.com)
License LGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<record model="ir.ui.view" id="stock_request_order_form">
<field name="name">stock.request.order.form</field>
<field name="model">stock.request.order</field>
<field name="inherit_id" ref="stock_request.stock_request_order_form"/>
<field name="inherit_id" ref="stock_request.stock_request_order_form" />
<field name="arch" type="xml">
<button name="action_confirm" position="after">
<button name="action_submit"
string="Submit" type="object"
attrs="{'invisible': [('state', '!=', 'draft')]}"/>
<button
name="action_submit"
string="Submit"
type="object"
attrs="{'invisible': [('state', '!=', 'draft')]}"
/>
</button>
<button name="action_confirm" position="attributes">
<attribute name="attrs">{'invisible': [('state', '!=', 'submitted')]}</attribute>
<attribute
name="attrs"
>{'invisible': [('state', '!=', 'submitted')]}</attribute>
</button>
<button name="action_draft" position="attributes">
<attribute name="states">submitted,cancel</attribute>
@@ -23,12 +28,15 @@
<attribute name="states">draft,submitted,open</attribute>
</button>
<field name="stock_request_ids" position="attributes">
<attribute name="attrs">{'readonly': [('state', 'not in', ['draft', 'submitted'])]}</attribute>
<attribute
name="attrs"
>{'readonly': [('state', 'not in', ['draft', 'submitted'])]}</attribute>
</field>
<field name="route_id" position="attributes">
<attribute name="attrs">{'readonly': [('state', 'not in', ['draft', 'submitted'])]}</attribute>
<attribute
name="attrs"
>{'readonly': [('state', 'not in', ['draft', 'submitted'])]}</attribute>
</field>
</field>
</record>
</odoo>

View File

@@ -1,20 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!-- Copyright 2019 Open Source Integrators
Copyright 2019 Eficent Business and IT Consulting Services, S.L.
Copyright 2019-2020 ForgeFlow S.L. (https://www.forgeflow.com)
License LGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<record id="view_stock_request_form" model="ir.ui.view">
<field name="name">stock.request.form</field>
<field name="model">stock.request</field>
<field name="inherit_id" ref="stock_request.view_stock_request_form"/>
<field name="inherit_id" ref="stock_request.view_stock_request_form" />
<field name="arch" type="xml">
<button name="action_confirm" position="after">
<button name="action_submit"
string="Submit" type="object"
attrs="{'invisible': [('state', '!=', 'draft')]}"/>
<button
name="action_submit"
string="Submit"
type="object"
attrs="{'invisible': [('state', '!=', 'draft')]}"
/>
</button>
<button name="action_confirm" position="attributes">
<attribute name="attrs">{'invisible': [('state', '!=', 'submitted')]}</attribute>
<attribute
name="attrs"
>{'invisible': [('state', '!=', 'submitted')]}</attribute>
</button>
<button name="action_draft" position="attributes">
<attribute name="states">submitted,cancel</attribute>
@@ -24,5 +29,4 @@
</button>
</field>
</record>
</odoo>