odoo-addon-stock-request 16.0.1.0.0.2__py3-none-any.whl → 17.0.1.0.0.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. odoo/addons/stock_request/README.rst +41 -41
  2. odoo/addons/stock_request/__manifest__.py +1 -1
  3. odoo/addons/stock_request/i18n/de.po +48 -0
  4. odoo/addons/stock_request/i18n/es.po +3 -0
  5. odoo/addons/stock_request/i18n/stock_request.pot +14 -31
  6. odoo/addons/stock_request/i18n/zh_CN.po +48 -0
  7. odoo/addons/stock_request/models/stock_move.py +2 -2
  8. odoo/addons/stock_request/models/stock_move_line.py +4 -4
  9. odoo/addons/stock_request/models/stock_request.py +50 -43
  10. odoo/addons/stock_request/models/stock_request_abstract.py +2 -1
  11. odoo/addons/stock_request/models/stock_request_order.py +0 -13
  12. odoo/addons/stock_request/models/stock_rule.py +1 -1
  13. odoo/addons/stock_request/readme/CONFIGURE.md +16 -0
  14. odoo/addons/stock_request/readme/CONTRIBUTORS.md +13 -0
  15. odoo/addons/stock_request/readme/{DESCRIPTION.rst → DESCRIPTION.md} +2 -1
  16. odoo/addons/stock_request/readme/{ROADMAP.rst → ROADMAP.md} +3 -3
  17. odoo/addons/stock_request/readme/USAGE.md +16 -0
  18. odoo/addons/stock_request/security/stock_request_security.xml +5 -1
  19. odoo/addons/stock_request/static/description/index.html +17 -17
  20. odoo/addons/stock_request/tests/test_stock_request.py +171 -149
  21. odoo/addons/stock_request/views/res_config_settings_views.xml +72 -108
  22. odoo/addons/stock_request/views/stock_picking_views.xml +1 -1
  23. odoo/addons/stock_request/views/stock_request_order_views.xml +40 -36
  24. odoo/addons/stock_request/views/stock_request_views.xml +40 -39
  25. {odoo_addon_stock_request-16.0.1.0.0.2.dist-info → odoo_addon_stock_request-17.0.1.0.0.2.dist-info}/METADATA +47 -50
  26. {odoo_addon_stock_request-16.0.1.0.0.2.dist-info → odoo_addon_stock_request-17.0.1.0.0.2.dist-info}/RECORD +28 -28
  27. {odoo_addon_stock_request-16.0.1.0.0.2.dist-info → odoo_addon_stock_request-17.0.1.0.0.2.dist-info}/WHEEL +1 -1
  28. odoo_addon_stock_request-17.0.1.0.0.2.dist-info/top_level.txt +1 -0
  29. odoo/addons/stock_request/readme/CONFIGURE.rst +0 -17
  30. odoo/addons/stock_request/readme/CONTRIBUTORS.rst +0 -15
  31. odoo/addons/stock_request/readme/USAGE.rst +0 -16
  32. odoo_addon_stock_request-16.0.1.0.0.2.dist-info/top_level.txt +0 -1
@@ -7,7 +7,7 @@ Stock Request
7
7
  !! This file is generated by oca-gen-addon-readme !!
8
8
  !! changes will be overwritten. !!
9
9
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10
- !! source digest: sha256:a466d45b459fb5887294de33e31dfbd31db3dcedb0f5b44560203bdfe27da502
10
+ !! source digest: sha256:a6ad00aa5c7750ab61a1779781df12ad36dd4d825a469e9171796efb048ede46
11
11
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12
12
 
13
13
  .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -17,19 +17,20 @@ Stock Request
17
17
  :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
18
18
  :alt: License: LGPL-3
19
19
  .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--request-lightgray.png?logo=github
20
- :target: https://github.com/OCA/stock-logistics-request/tree/16.0/stock_request
20
+ :target: https://github.com/OCA/stock-logistics-request/tree/17.0/stock_request
21
21
  :alt: OCA/stock-logistics-request
22
22
  .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23
- :target: https://translation.odoo-community.org/projects/stock-logistics-request-16-0/stock-logistics-request-16-0-stock_request
23
+ :target: https://translation.odoo-community.org/projects/stock-logistics-request-17-0/stock-logistics-request-17-0-stock_request
24
24
  :alt: Translate me on Weblate
25
25
  .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26
- :target: https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-request&target_branch=16.0
26
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-request&target_branch=17.0
27
27
  :alt: Try me on Runboat
28
28
 
29
29
  |badge1| |badge2| |badge3| |badge4| |badge5|
30
30
 
31
31
  This module was written to allow users to request products that are
32
- frequently stocked by the company, to be transferred to their chosen location.
32
+ frequently stocked by the company, to be transferred to their chosen
33
+ location.
33
34
 
34
35
  **Table of contents**
35
36
 
@@ -41,48 +42,47 @@ Configuration
41
42
 
42
43
  To configure this module:
43
44
 
44
- * Go to Stock Requests > Settings
45
+ - Go to Stock Requests > Settings
45
46
 
46
47
  Users should be assigned to the groups 'Stock Request / User' or 'Stock
47
48
  Request / Manager'.
48
49
 
49
50
  ## Group Stock Request / User
50
51
 
51
- * Can see her/his own Stock Requests, and others that she/he's been granted
52
- permission to follow.
53
-
54
- * Can create/update only her/his Stock Requests.
52
+ - Can see her/his own Stock Requests, and others that she/he's been
53
+ granted permission to follow.
54
+ - Can create/update only her/his Stock Requests.
55
55
 
56
56
  ## Group Stock Request / Manager
57
57
 
58
- * Can fully manage all Stock Requests
58
+ - Can fully manage all Stock Requests
59
59
 
60
60
  Usage
61
61
  =====
62
62
 
63
63
  ## Creation
64
64
 
65
- * Go to 'Stock Requests / Stock Requests' and create a new Request.
66
- * Indicate a product, quantity and location.
67
- * Press 'Confirm'.
65
+ - Go to 'Stock Requests / Stock Requests' and create a new Request.
66
+ - Indicate a product, quantity and location.
67
+ - Press 'Confirm'.
68
68
 
69
- Upon confirmation the request will be evaluated using the procurement rules
70
- for the selected location.
69
+ Upon confirmation the request will be evaluated using the procurement
70
+ rules for the selected location.
71
71
 
72
- In case that transfers are created, the user will be able to access to them
73
- from the button 'Transfers' available in the Stock Request.
72
+ In case that transfers are created, the user will be able to access to
73
+ them from the button 'Transfers' available in the Stock Request.
74
74
 
75
75
  ## Cancel
76
76
 
77
- When the user cancels a Stock Request, the related pending stock moves will be
78
- also cancelled.
77
+ When the user cancels a Stock Request, the related pending stock moves
78
+ will be also cancelled.
79
79
 
80
80
  Known issues / Roadmap
81
81
  ======================
82
82
 
83
- There is no way to achieve Storck Request and Stock Request Orders.
84
- It should be developed taking into account that only Cancel and Done
85
- stock request can be archived.
83
+ There is no way to achieve Storck Request and Stock Request Orders. It
84
+ should be developed taking into account that only Cancel and Done stock
85
+ request can be archived.
86
86
 
87
87
  It is also required to manage active field logically from Orders to SRs.
88
88
 
@@ -92,7 +92,7 @@ Bug Tracker
92
92
  Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-request/issues>`_.
93
93
  In case of trouble, please check there if your issue has already been reported.
94
94
  If you spotted it first, help us to smash it by providing a detailed and welcomed
95
- `feedback <https://github.com/OCA/stock-logistics-request/issues/new?body=module:%20stock_request%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
95
+ `feedback <https://github.com/OCA/stock-logistics-request/issues/new?body=module:%20stock_request%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
96
96
 
97
97
  Do not contact contributors directly about support or help with technical issues.
98
98
 
@@ -100,31 +100,31 @@ Credits
100
100
  =======
101
101
 
102
102
  Authors
103
- ~~~~~~~
103
+ -------
104
104
 
105
105
  * ForgeFlow
106
106
 
107
107
  Contributors
108
- ~~~~~~~~~~~~
108
+ ------------
109
109
 
110
- * Jordi Ballester (EFICENT) <jordi.ballester@forgeflow.com>.
111
- * Enric Tobella <etobella@creublanca.es>
112
- * Atte Isopuro <atte.isopuro@avoin.systems>
113
- * Lois Rilo <lois.rilo@forgeflow.com>
114
- * Raul Martin <raul.martin@braintec-group.com>
115
- * Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com>
116
- * `Open Source Integrators <https://www.opensourceintegrators.com>`_
110
+ - Jordi Ballester (EFICENT) <jordi.ballester@forgeflow.com>.
111
+ - Enric Tobella <etobella@creublanca.es>
112
+ - Atte Isopuro <atte.isopuro@avoin.systems>
113
+ - Lois Rilo <lois.rilo@forgeflow.com>
114
+ - Raul Martin <raul.martin@braintec-group.com>
115
+ - Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com>
116
+ - `Open Source Integrators <https://www.opensourceintegrators.com>`__
117
117
 
118
- * Maxime Chambreuil <mchambreuil@opensourceintegrators.com>
119
- * Steve Campbell <scampbell@opensourceintegrators.com>
118
+ - Maxime Chambreuil <mchambreuil@opensourceintegrators.com>
119
+ - Steve Campbell <scampbell@opensourceintegrators.com>
120
120
 
121
- * Héctor Villarreal <hector.villarreal@forgeflow.com>
122
- * Kitti U. <kittiu@ecosoft.co.th>
123
- * Bernat Puig <bernat.puig@forgeflow.com>
124
- * Oriol Miranda <oriol.miranda@forgeflow.com>
121
+ - Héctor Villarreal <hector.villarreal@forgeflow.com>
122
+ - Kitti U. <kittiu@ecosoft.co.th>
123
+ - Bernat Puig <bernat.puig@forgeflow.com>
124
+ - Oriol Miranda <oriol.miranda@forgeflow.com>
125
125
 
126
126
  Maintainers
127
- ~~~~~~~~~~~
127
+ -----------
128
128
 
129
129
  This module is maintained by the OCA.
130
130
 
@@ -136,6 +136,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
136
136
  mission is to support the collaborative development of Odoo features and
137
137
  promote its widespread use.
138
138
 
139
- This module is part of the `OCA/stock-logistics-request <https://github.com/OCA/stock-logistics-request/tree/16.0/stock_request>`_ project on GitHub.
139
+ This module is part of the `OCA/stock-logistics-request <https://github.com/OCA/stock-logistics-request/tree/17.0/stock_request>`_ project on GitHub.
140
140
 
141
141
  You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
@@ -4,7 +4,7 @@
4
4
  {
5
5
  "name": "Stock Request",
6
6
  "summary": "Internal request for stock",
7
- "version": "16.0.1.0.0",
7
+ "version": "17.0.1.0.0",
8
8
  "license": "LGPL-3",
9
9
  "website": "https://github.com/OCA/stock-logistics-request",
10
10
  "author": "ForgeFlow, Odoo Community Association (OCA)",
@@ -1163,3 +1163,51 @@ msgid ""
1163
1163
  msgstr ""
1164
1164
  "Sie müssen eine Produktmengeneinheit aus der gleichen Kategorie, wie die "
1165
1165
  "Basismengeneinheit des Produkts, verwenden"
1166
+
1167
+ #, fuzzy
1168
+ #~ msgid "SMS Delivery error"
1169
+ #~ msgstr "Meldungszustellfehler"
1170
+
1171
+ #, fuzzy
1172
+ #~ msgid "Stock request"
1173
+ #~ msgstr "Bestandsanforderung"
1174
+
1175
+ #, python-format
1176
+ #~ msgid "<li><b>%s</b>: Transferred quantity %s %s</li>"
1177
+ #~ msgstr "<li><b>%s</b>: Umgelagerte Menge %s %s</li>"
1178
+
1179
+ #~ msgid "Followers (Channels)"
1180
+ #~ msgstr "Follower (Kanäle)"
1181
+
1182
+ #, python-format
1183
+ #~ msgid "Receipt confirmation %s for your Request %s"
1184
+ #~ msgstr "Bestätigungsbeleg %s zu Ihrer Anforderung %s"
1185
+
1186
+ #~ msgid "Requested by"
1187
+ #~ msgstr "Angefordert durch"
1188
+
1189
+ #, python-format
1190
+ #~ msgid ""
1191
+ #~ "The following requested items from Stock Request %s have now been "
1192
+ #~ "received in %s using Picking %s:"
1193
+ #~ msgstr ""
1194
+ #~ "Die folgenden Posten aus Anforderung %s sind nun eingegangen in %s unter "
1195
+ #~ "Kommissionierung %s:"
1196
+
1197
+ #~ msgid "Archived"
1198
+ #~ msgstr "Archiviert"
1199
+
1200
+ #~ msgid "If checked new messages require your attention."
1201
+ #~ msgstr "Wenn angehakt, erfordern Meldungen Ihre Aufmerksamkeit."
1202
+
1203
+ #~ msgid "Overdue"
1204
+ #~ msgstr "Überfällig"
1205
+
1206
+ #~ msgid "Planned"
1207
+ #~ msgstr "Geplant"
1208
+
1209
+ #~ msgid "Packing Operation"
1210
+ #~ msgstr "Packvorgang"
1211
+
1212
+ #~ msgid "Procurement Rule"
1213
+ #~ msgstr "Beschaffungsregel"
@@ -1176,3 +1176,6 @@ msgid ""
1176
1176
  msgstr ""
1177
1177
  "Debe seleccionada una unidad de medida de producto de la misma categoría que "
1178
1178
  "la unidad de medida por defecto del producto"
1179
+
1180
+ #~ msgid "SMS Delivery error"
1181
+ #~ msgstr "Error de entrega de SMS"
@@ -4,7 +4,7 @@
4
4
  #
5
5
  msgid ""
6
6
  msgstr ""
7
- "Project-Id-Version: Odoo Server 16.0\n"
7
+ "Project-Id-Version: Odoo Server 17.0\n"
8
8
  "Report-Msgid-Bugs-To: \n"
9
9
  "Last-Translator: \n"
10
10
  "Language-Team: \n"
@@ -64,9 +64,7 @@ msgstr ""
64
64
 
65
65
  #. module: stock_request
66
66
  #: model_terms:ir.ui.view,arch_db:stock_request.res_config_settings_view_form
67
- msgid ""
68
- "Add State to Stock Request and Stock Request Orders if\n"
69
- " activated."
67
+ msgid "Add State to Stock Request and Stock Request Orders if activated."
70
68
  msgstr ""
71
69
 
72
70
  #. module: stock_request
@@ -108,8 +106,8 @@ msgstr ""
108
106
  #. module: stock_request
109
107
  #: model_terms:ir.ui.view,arch_db:stock_request.res_config_settings_view_form
110
108
  msgid ""
111
- "By default only internal and transit locations are allowed in\n"
112
- " Stock Request and Orders."
109
+ "By default only internal and transit locations are allowed in Stock Request "
110
+ "and Orders."
113
111
  msgstr ""
114
112
 
115
113
  #. module: stock_request
@@ -356,8 +354,11 @@ msgstr ""
356
354
 
357
355
  #. module: stock_request
358
356
  #: model:ir.model.fields,help:stock_request.field_stock_request__message_has_error
357
+ #: model:ir.model.fields,help:stock_request.field_stock_request__message_has_sms_error
359
358
  #: model:ir.model.fields,help:stock_request.field_stock_request_abstract__message_has_error
359
+ #: model:ir.model.fields,help:stock_request.field_stock_request_abstract__message_has_sms_error
360
360
  #: model:ir.model.fields,help:stock_request.field_stock_request_order__message_has_error
361
+ #: model:ir.model.fields,help:stock_request.field_stock_request_order__message_has_sms_error
361
362
  msgid "If checked, some messages have a delivery error."
362
363
  msgstr ""
363
364
 
@@ -399,13 +400,6 @@ msgstr ""
399
400
  msgid "Kanban"
400
401
  msgstr ""
401
402
 
402
- #. module: stock_request
403
- #: model:ir.model.fields,field_description:stock_request.field_stock_request____last_update
404
- #: model:ir.model.fields,field_description:stock_request.field_stock_request_allocation____last_update
405
- #: model:ir.model.fields,field_description:stock_request.field_stock_request_order____last_update
406
- msgid "Last Modified on"
407
- msgstr ""
408
-
409
403
  #. module: stock_request
410
404
  #: model:ir.model.fields,field_description:stock_request.field_stock_request__write_uid
411
405
  #: model:ir.model.fields,field_description:stock_request.field_stock_request_allocation__write_uid
@@ -436,13 +430,6 @@ msgstr ""
436
430
  msgid "Location must be equal to the order"
437
431
  msgstr ""
438
432
 
439
- #. module: stock_request
440
- #: model:ir.model.fields,field_description:stock_request.field_stock_request__message_main_attachment_id
441
- #: model:ir.model.fields,field_description:stock_request.field_stock_request_abstract__message_main_attachment_id
442
- #: model:ir.model.fields,field_description:stock_request.field_stock_request_order__message_main_attachment_id
443
- msgid "Main Attachment"
444
- msgstr ""
445
-
446
433
  #. module: stock_request
447
434
  #: model_terms:ir.ui.view,arch_db:stock_request.res_config_settings_view_form
448
435
  msgid "Manufacturing"
@@ -762,6 +749,13 @@ msgstr ""
762
749
  msgid "Routes"
763
750
  msgstr ""
764
751
 
752
+ #. module: stock_request
753
+ #: model:ir.model.fields,field_description:stock_request.field_stock_request__message_has_sms_error
754
+ #: model:ir.model.fields,field_description:stock_request.field_stock_request_abstract__message_has_sms_error
755
+ #: model:ir.model.fields,field_description:stock_request.field_stock_request_order__message_has_sms_error
756
+ msgid "SMS Delivery error"
757
+ msgstr ""
758
+
765
759
  #. module: stock_request
766
760
  #: model_terms:ir.ui.view,arch_db:stock_request.stock_request_order_form
767
761
  #: model_terms:ir.ui.view,arch_db:stock_request.view_stock_request_form
@@ -893,7 +887,6 @@ msgstr ""
893
887
  #: model_terms:ir.ui.view,arch_db:stock_request.stock_request_order_form
894
888
  #: model_terms:ir.ui.view,arch_db:stock_request.stock_request_search
895
889
  #: model_terms:ir.ui.view,arch_db:stock_request.view_picking_form
896
- #: model_terms:ir.ui.view,arch_db:stock_request.view_stock_request_form
897
890
  msgid "Stock Requests"
898
891
  msgstr ""
899
892
 
@@ -907,16 +900,6 @@ msgstr ""
907
900
  msgid "Stock Requests Kanban integration"
908
901
  msgstr ""
909
902
 
910
- #. module: stock_request
911
- #: model_terms:ir.ui.view,arch_db:stock_request.stock_request_order_search
912
- msgid "Stock Requests Order Search"
913
- msgstr ""
914
-
915
- #. module: stock_request
916
- #: model_terms:ir.ui.view,arch_db:stock_request.stock_request_search
917
- msgid "Stock Requests Search"
918
- msgstr ""
919
-
920
903
  #. module: stock_request
921
904
  #: model:ir.model.fields,field_description:stock_request.field_res_config_settings__module_stock_request_purchase
922
905
  msgid "Stock Requests for Purchases"
@@ -1148,3 +1148,51 @@ msgid ""
1148
1148
  "You have to select a product unit of measure in the same category than the "
1149
1149
  "default unit of measure of the product"
1150
1150
  msgstr "您必须选择与产品默认计量单位相同类别的产品计量单位"
1151
+
1152
+ #, fuzzy
1153
+ #~ msgid "SMS Delivery error"
1154
+ #~ msgstr "消息递送错误"
1155
+
1156
+ #~ msgid "Stock request"
1157
+ #~ msgstr "库存请求"
1158
+
1159
+ #, python-format
1160
+ #~ msgid "<li><b>%s</b>: Transferred quantity %s %s</li>"
1161
+ #~ msgstr "<li><b>%s</b>: 调拨数量%s %s</li>"
1162
+
1163
+ #~ msgid "Followers (Channels)"
1164
+ #~ msgstr "关注者(频道)"
1165
+
1166
+ #, python-format
1167
+ #~ msgid "Receipt confirmation %s for your Request %s"
1168
+ #~ msgstr "您的请求%s的收据确认%s"
1169
+
1170
+ #~ msgid "Requested by"
1171
+ #~ msgstr "请求者"
1172
+
1173
+ #, python-format
1174
+ #~ msgid ""
1175
+ #~ "The following requested items from Stock Request %s have now been "
1176
+ #~ "received in %s using Picking %s:"
1177
+ #~ msgstr "从库存请求%s中请求的下列项目现在已在使用领料%s的%s中收到:"
1178
+
1179
+ #, python-format
1180
+ #~ msgid ""
1181
+ #~ "Unfortunately it seems you do not have the necessary rights for creating "
1182
+ #~ "stock requests. Please contact your administrator."
1183
+ #~ msgstr "不幸的是,您似乎没有创建库存请求的必要权限。请与管理员联系。"
1184
+
1185
+ #~ msgid "Archived"
1186
+ #~ msgstr "已归档"
1187
+
1188
+ #~ msgid "If checked new messages require your attention."
1189
+ #~ msgstr ".如果勾选此项,将会收到新消息提醒。"
1190
+
1191
+ #~ msgid "Overdue"
1192
+ #~ msgstr "逾期"
1193
+
1194
+ #~ msgid "Planned"
1195
+ #~ msgstr "计划"
1196
+
1197
+ #~ msgid "Today"
1198
+ #~ msgstr "今天"
@@ -26,7 +26,7 @@ class StockMove(models.Model):
26
26
  rec.stock_request_ids = rec.allocation_ids.mapped("stock_request_id")
27
27
 
28
28
  def _merge_moves_fields(self):
29
- res = super(StockMove, self)._merge_moves_fields()
29
+ res = super()._merge_moves_fields()
30
30
  res["allocation_ids"] = [(4, m.id) for m in self.mapped("allocation_ids")]
31
31
  return res
32
32
 
@@ -65,7 +65,7 @@ class StockMove(models.Model):
65
65
  },
66
66
  )
67
67
  )
68
- return super(StockMove, self).copy_data(default)
68
+ return super().copy_data(default)
69
69
 
70
70
  def _action_cancel(self):
71
71
  """Apply sudo to prevent requests ACL errors if the user does not have
@@ -36,17 +36,17 @@ class StockMoveLine(models.Model):
36
36
  return {
37
37
  "request_name": request.name,
38
38
  "picking_name": ml.picking_id.name,
39
- "product_name": ml.product_id.name_get()[0][1],
39
+ "product_name": ml.product_id.display_name,
40
40
  "product_qty": allocated_qty,
41
41
  "product_uom": ml.product_uom_id.name,
42
- "location_name": ml.location_dest_id.name_get()[0][1],
42
+ "location_name": ml.location_dest_id.display_name,
43
43
  }
44
44
 
45
45
  def _action_done(self):
46
- res = super(StockMoveLine, self)._action_done()
46
+ res = super()._action_done()
47
47
  for ml in self.filtered(lambda m: m.exists() and m.move_id.allocation_ids):
48
48
  qty_done = ml.product_uom_id._compute_quantity(
49
- ml.qty_done, ml.product_id.uom_id
49
+ ml.quantity, ml.product_id.uom_id
50
50
  )
51
51
 
52
52
  # We do sudo because potentially the user that completes the move
@@ -19,7 +19,7 @@ class StockRequest(models.Model):
19
19
  def _get_expected_date():
20
20
  return fields.Datetime.now()
21
21
 
22
- name = fields.Char(states={"draft": [("readonly", False)]})
22
+ name = fields.Char()
23
23
  state = fields.Selection(
24
24
  selection=[
25
25
  ("draft", "Draft"),
@@ -43,8 +43,6 @@ class StockRequest(models.Model):
43
43
  expected_date = fields.Datetime(
44
44
  index=True,
45
45
  required=True,
46
- readonly=True,
47
- states={"draft": [("readonly", False)]},
48
46
  help="Date when you expect to receive the goods.",
49
47
  )
50
48
  picking_policy = fields.Selection(
@@ -54,8 +52,6 @@ class StockRequest(models.Model):
54
52
  ],
55
53
  string="Shipping Policy",
56
54
  required=True,
57
- readonly=True,
58
- states={"draft": [("readonly", False)]},
59
55
  default="direct",
60
56
  )
61
57
  move_ids = fields.One2many(
@@ -102,24 +98,14 @@ class StockRequest(models.Model):
102
98
  string="Stock Request Allocation",
103
99
  )
104
100
  order_id = fields.Many2one("stock.request.order", readonly=True)
105
- warehouse_id = fields.Many2one(
106
- states={"draft": [("readonly", False)]}, readonly=True
107
- )
108
- location_id = fields.Many2one(
109
- states={"draft": [("readonly", False)]}, readonly=True
110
- )
111
- product_id = fields.Many2one(states={"draft": [("readonly", False)]}, readonly=True)
112
- product_uom_id = fields.Many2one(
113
- states={"draft": [("readonly", False)]}, readonly=True
114
- )
115
- product_uom_qty = fields.Float(
116
- states={"draft": [("readonly", False)]}, readonly=True
117
- )
118
- procurement_group_id = fields.Many2one(
119
- states={"draft": [("readonly", False)]}, readonly=True
120
- )
121
- company_id = fields.Many2one(states={"draft": [("readonly", False)]}, readonly=True)
122
- route_id = fields.Many2one(states={"draft": [("readonly", False)]}, readonly=True)
101
+ warehouse_id = fields.Many2one()
102
+ location_id = fields.Many2one()
103
+ product_id = fields.Many2one()
104
+ product_uom_id = fields.Many2one()
105
+ product_uom_qty = fields.Float()
106
+ procurement_group_id = fields.Many2one()
107
+ company_id = fields.Many2one()
108
+ route_id = fields.Many2one()
123
109
 
124
110
  _sql_constraints = [
125
111
  ("name_uniq", "unique(name, company_id)", "Stock Request name must be unique")
@@ -148,7 +134,7 @@ class StockRequest(models.Model):
148
134
  "allocation_ids",
149
135
  "allocation_ids.stock_move_id.state",
150
136
  "allocation_ids.stock_move_id.move_line_ids",
151
- "allocation_ids.stock_move_id.move_line_ids.qty_done",
137
+ "allocation_ids.stock_move_id.move_line_ids.quantity",
152
138
  )
153
139
  def _compute_qty(self):
154
140
  for request in self:
@@ -180,47 +166,67 @@ class StockRequest(models.Model):
180
166
 
181
167
  @api.constrains("order_id", "requested_by")
182
168
  def check_order_requested_by(self):
183
- for rec in self:
184
- if rec.order_id and rec.order_id.requested_by != rec.requested_by:
169
+ for stock_request in self:
170
+ if (
171
+ stock_request.order_id
172
+ and stock_request.order_id.requested_by != stock_request.requested_by
173
+ ):
185
174
  raise ValidationError(_("Requested by must be equal to the order"))
186
175
 
187
176
  @api.constrains("order_id", "warehouse_id")
188
177
  def check_order_warehouse_id(self):
189
- for rec in self:
190
- if rec.order_id and rec.order_id.warehouse_id != rec.warehouse_id:
178
+ for stock_request in self:
179
+ if (
180
+ stock_request.order_id
181
+ and stock_request.order_id.warehouse_id != stock_request.warehouse_id
182
+ ):
191
183
  raise ValidationError(_("Warehouse must be equal to the order"))
192
184
 
193
185
  @api.constrains("order_id", "location_id")
194
186
  def check_order_location(self):
195
- for rec in self:
196
- if rec.order_id and rec.order_id.location_id != rec.location_id:
187
+ for stock_request in self:
188
+ if (
189
+ stock_request.order_id
190
+ and stock_request.order_id.location_id != stock_request.location_id
191
+ ):
197
192
  raise ValidationError(_("Location must be equal to the order"))
198
193
 
199
194
  @api.constrains("order_id", "procurement_group_id")
200
195
  def check_order_procurement_group(self):
201
- for rec in self:
196
+ for stock_request in self:
202
197
  if (
203
- rec.order_id
204
- and rec.order_id.procurement_group_id != rec.procurement_group_id
198
+ stock_request.order_id
199
+ and stock_request.order_id.procurement_group_id
200
+ != stock_request.procurement_group_id
205
201
  ):
206
202
  raise ValidationError(_("Procurement group must be equal to the order"))
207
203
 
208
204
  @api.constrains("order_id", "company_id")
209
205
  def check_order_company(self):
210
- for rec in self:
211
- if rec.order_id and rec.order_id.company_id != rec.company_id:
206
+ for stock_request in self:
207
+ if (
208
+ stock_request.order_id
209
+ and stock_request.order_id.company_id != stock_request.company_id
210
+ ):
212
211
  raise ValidationError(_("Company must be equal to the order"))
213
212
 
214
213
  @api.constrains("order_id", "expected_date")
215
214
  def check_order_expected_date(self):
216
- for rec in self:
217
- if rec.order_id and rec.order_id.expected_date != rec.expected_date:
215
+ for stock_request in self:
216
+ if (
217
+ stock_request.order_id
218
+ and stock_request.order_id.expected_date != stock_request.expected_date
219
+ ):
218
220
  raise ValidationError(_("Expected date must be equal to the order"))
219
221
 
220
222
  @api.constrains("order_id", "picking_policy")
221
223
  def check_order_picking_policy(self):
222
- for rec in self:
223
- if rec.order_id and rec.order_id.picking_policy != rec.picking_policy:
224
+ for stock_request in self:
225
+ if (
226
+ stock_request.order_id
227
+ and stock_request.order_id.picking_policy
228
+ != stock_request.picking_policy
229
+ ):
224
230
  raise ValidationError(
225
231
  _("The picking policy must be equal to the order")
226
232
  )
@@ -338,7 +344,8 @@ class StockRequest(models.Model):
338
344
  pending_qty -= qty_move
339
345
  # Create allocation + done move
340
346
  allocation_model.create(self._prepare_stock_request_allocation(move))
341
- move.quantity_done = move.product_uom_qty
347
+ move.quantity = move.product_uom_qty
348
+ move.picked = True
342
349
  move._action_done()
343
350
 
344
351
  def _action_launch_procurement_rule(self):
@@ -422,8 +429,8 @@ class StockRequest(models.Model):
422
429
  if upd_vals.get("name", "/") == "/":
423
430
  upd_vals["name"] = self.env["ir.sequence"].next_by_code("stock.request")
424
431
  if "order_id" in upd_vals:
425
- order = self.env["stock.request.order"].browse(upd_vals["order_id"])
426
- upd_vals["expected_date"] = order.expected_date
432
+ order_id = self.env["stock.request.order"].browse(upd_vals["order_id"])
433
+ upd_vals["expected_date"] = order_id.expected_date
427
434
  else:
428
435
  upd_vals["expected_date"] = self._get_expected_date()
429
436
  vals_list_upd.append(upd_vals)
@@ -432,4 +439,4 @@ class StockRequest(models.Model):
432
439
  def unlink(self):
433
440
  if self.filtered(lambda r: r.state != "draft"):
434
441
  raise UserError(_("Only requests on draft state can be unlinked"))
435
- return super(StockRequest, self).unlink()
442
+ return super().unlink()
@@ -12,7 +12,7 @@ class StockRequest(models.AbstractModel):
12
12
 
13
13
  @api.model
14
14
  def default_get(self, fields):
15
- res = super(StockRequest, self).default_get(fields)
15
+ res = super().default_get(fields)
16
16
  warehouse = None
17
17
  if "warehouse_id" not in res and res.get("company_id"):
18
18
  warehouse = self.env["stock.warehouse"].search(
@@ -131,6 +131,7 @@ class StockRequest(models.AbstractModel):
131
131
  if record.warehouse_id and routes_by_warehouse.get(record.warehouse_id.id):
132
132
  routes |= routes_by_warehouse[record.warehouse_id.id]
133
133
  parents = record.get_parents().ids
134
+ # ruff: noqa: B023
134
135
  record.route_ids = routes.filtered(
135
136
  lambda r: any(p.location_dest_id.id in parents for p in r.rule_ids)
136
137
  )