mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[IMP] Simplify inheritance of states
[UPD] Update stock_request_submit.pot [UPD] README.rst
This commit is contained in:
committed by
Patrick Wilson
parent
c68d04fedb
commit
ee5ba721c7
49
stock_request_submit/i18n/stock_request_submit.pot
Normal file
49
stock_request_submit/i18n/stock_request_submit.pot
Normal file
@@ -0,0 +1,49 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * stock_request_submit
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 12.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: stock_request_submit
|
||||
#: code:addons/stock_request_submit/models/stock_request.py:14
|
||||
#, python-format
|
||||
msgid "Draft"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_request_submit
|
||||
#: model:ir.model.fields,field_description:stock_request_submit.field_stock_request__route_id
|
||||
msgid "Route"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_request_submit
|
||||
#: model:ir.model,name:stock_request_submit.model_stock_request
|
||||
msgid "Stock Request"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_request_submit
|
||||
#: model:ir.model,name:stock_request_submit.model_stock_request_order
|
||||
msgid "Stock Request Order"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_request_submit
|
||||
#: model_terms:ir.ui.view,arch_db:stock_request_submit.stock_request_order_form
|
||||
#: model_terms:ir.ui.view,arch_db:stock_request_submit.view_stock_request_form
|
||||
msgid "Submit"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_request_submit
|
||||
#: code:addons/stock_request_submit/models/stock_request.py:12
|
||||
#: code:addons/stock_request_submit/models/stock_request.py:15
|
||||
#, python-format
|
||||
msgid "Submitted"
|
||||
msgstr ""
|
||||
|
||||
@@ -1,26 +1,22 @@
|
||||
# Copyright 2019 Open Source Integrators
|
||||
# Copyright 2019 Eficent Business and IT Consulting Services, S.L.
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
|
||||
from odoo import api, fields, models
|
||||
|
||||
REQUEST_STATES = [
|
||||
('draft', 'Draft'),
|
||||
('submitted', 'Submitted'),
|
||||
('open', 'In progress'),
|
||||
('done', 'Done'),
|
||||
('cancel', 'Cancelled')]
|
||||
from odoo import api, fields, models, _
|
||||
|
||||
|
||||
class StockRequest(models.Model):
|
||||
_inherit = 'stock.request'
|
||||
|
||||
state = fields.Selection(selection=REQUEST_STATES, string='Status',
|
||||
copy=False, default='draft', index=True,
|
||||
readonly=True, track_visibility='onchange',
|
||||
)
|
||||
def __get_request_states(self):
|
||||
states = super().__get_request_states()
|
||||
if not ('submitted', _('Submitted')) in states:
|
||||
states.insert(
|
||||
states.index(('draft', _('Draft'))) + 1,
|
||||
('submitted', _('Submitted')))
|
||||
return states
|
||||
|
||||
route_id = fields.Many2one(states={'draft': [('readonly', False)],
|
||||
'submitted': [('readonly', False)]},
|
||||
readonly=True)
|
||||
'submitted': [('readonly', False)]})
|
||||
|
||||
@api.multi
|
||||
def action_submit(self):
|
||||
|
||||
@@ -1,24 +1,12 @@
|
||||
# Copyright 2019 Open Source Integrators
|
||||
# Copyright 2019 Eficent Business and IT Consulting Services, S.L.
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
|
||||
from odoo import api, fields, models
|
||||
|
||||
REQUEST_STATES = [
|
||||
('draft', 'Draft'),
|
||||
('submitted', 'Submitted'),
|
||||
('open', 'In progress'),
|
||||
('done', 'Done'),
|
||||
('cancel', 'Cancelled')]
|
||||
from odoo import api, models
|
||||
|
||||
|
||||
class StockRequestOrder(models.Model):
|
||||
_inherit = 'stock.request.order'
|
||||
|
||||
state = fields.Selection(selection=REQUEST_STATES, string='Status',
|
||||
copy=False, default='draft', index=True,
|
||||
readonly=True, track_visibility='onchange',
|
||||
)
|
||||
|
||||
@api.multi
|
||||
def action_submit(self):
|
||||
for line in self.stock_request_ids:
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils 0.13.1: http://docutils.sourceforge.net/" />
|
||||
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
|
||||
<title>Stock Request Submit</title>
|
||||
<style type="text/css">
|
||||
|
||||
|
||||
Reference in New Issue
Block a user