odoo-addon-stock-request 15.0.1.8.0.1__py3-none-any.whl → 15.0.1.8.1__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.
@@ -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:9922750ed65a20a1bf7665de38bf99f1a0ff2254a2106a9cc19980733827ded9
10
+ !! source digest: sha256:3b710a651bfee502956ef3ec54a10bedeef599889b6d6db68852c0df8e2b624d
11
11
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12
12
 
13
13
  .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -4,7 +4,7 @@
4
4
  {
5
5
  "name": "Stock Request",
6
6
  "summary": "Internal request for stock",
7
- "version": "15.0.1.8.0",
7
+ "version": "15.0.1.8.1",
8
8
  "license": "LGPL-3",
9
9
  "website": "https://github.com/OCA/stock-logistics-warehouse",
10
10
  "author": "ForgeFlow, Odoo Community Association (OCA)",
@@ -125,10 +125,21 @@ class StockRequest(models.Model):
125
125
  ("name_uniq", "unique(name, company_id)", "Stock Request name must be unique")
126
126
  ]
127
127
 
128
+ def _get_all_origin_moves(self, move):
129
+ all_moves = move
130
+ if move.move_orig_ids:
131
+ for orig_move in move.move_orig_ids:
132
+ all_moves |= self._get_all_origin_moves(orig_move)
133
+ return all_moves
134
+
128
135
  @api.depends("allocation_ids", "allocation_ids.stock_move_id")
129
136
  def _compute_move_ids(self):
130
137
  for request in self:
131
- request.move_ids = request.allocation_ids.mapped("stock_move_id")
138
+ move_ids = request.allocation_ids.mapped("stock_move_id")
139
+ all_moves = self.env["stock.move"]
140
+ for move in move_ids:
141
+ all_moves |= self._get_all_origin_moves(move)
142
+ request.move_ids = all_moves
132
143
 
133
144
  @api.depends(
134
145
  "allocation_ids",
@@ -8,10 +8,11 @@
8
8
 
9
9
  /*
10
10
  :Author: David Goodger (goodger@python.org)
11
- :Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
11
+ :Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
12
12
  :Copyright: This stylesheet has been placed in the public domain.
13
13
 
14
14
  Default cascading style sheet for the HTML output of Docutils.
15
+ Despite the name, some widely supported CSS2 features are used.
15
16
 
16
17
  See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
17
18
  customize this style sheet.
@@ -274,7 +275,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code {
274
275
  margin-left: 2em ;
275
276
  margin-right: 2em }
276
277
 
277
- pre.code .ln { color: grey; } /* line numbers */
278
+ pre.code .ln { color: gray; } /* line numbers */
278
279
  pre.code, code { background-color: #eeeeee }
279
280
  pre.code .comment, code .comment { color: #5C6576 }
280
281
  pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -300,7 +301,7 @@ span.option {
300
301
  span.pre {
301
302
  white-space: pre }
302
303
 
303
- span.problematic {
304
+ span.problematic, pre.problematic {
304
305
  color: red }
305
306
 
306
307
  span.section-subtitle {
@@ -366,7 +367,7 @@ ul.auto-toc {
366
367
  !! This file is generated by oca-gen-addon-readme !!
367
368
  !! changes will be overwritten. !!
368
369
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
369
- !! source digest: sha256:9922750ed65a20a1bf7665de38bf99f1a0ff2254a2106a9cc19980733827ded9
370
+ !! source digest: sha256:3b710a651bfee502956ef3ec54a10bedeef599889b6d6db68852c0df8e2b624d
370
371
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
371
372
  <p><a class="reference external image-reference" 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 image-reference" 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 image-reference" href="https://github.com/OCA/stock-logistics-warehouse/tree/15.0/stock_request"><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 image-reference" href="https://translation.odoo-community.org/projects/stock-logistics-warehouse-15-0/stock-logistics-warehouse-15-0-stock_request"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-warehouse&amp;target_branch=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
372
373
  <p>This module was written to allow users to request products that are
@@ -467,7 +468,9 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
467
468
  <div class="section" id="maintainers">
468
469
  <h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2>
469
470
  <p>This module is maintained by the OCA.</p>
470
- <a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
471
+ <a class="reference external image-reference" href="https://odoo-community.org">
472
+ <img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
473
+ </a>
471
474
  <p>OCA, or the Odoo Community Association, is a nonprofit organization whose
472
475
  mission is to support the collaborative development of Odoo features and
473
476
  promote its widespread use.</p>
@@ -1562,3 +1562,143 @@ class TestStockRequestOrderState(TestStockRequest):
1562
1562
  self.route.id,
1563
1563
  "Route ID should update on all stock requests on onchange.",
1564
1564
  )
1565
+
1566
+
1567
+ class TestStockRequestOrder(common.TransactionCase):
1568
+ def setUp(self):
1569
+ super().setUp()
1570
+ self.env = self.env(
1571
+ context=dict(
1572
+ self.env.context,
1573
+ mail_create_nolog=True,
1574
+ mail_create_nosubscribe=True,
1575
+ mail_notrack=True,
1576
+ no_reset_password=True,
1577
+ tracking_disable=True,
1578
+ )
1579
+ )
1580
+ self.request_order = self.env["stock.request.order"]
1581
+ self.stock_request = self.env["stock.request"]
1582
+ self.main_company = self.env.ref("base.main_company")
1583
+ self.warehouse = self.env.ref("stock.warehouse0")
1584
+ self.uom_unit = self.env.ref("uom.product_uom_unit")
1585
+ self.uom_dozen = self.env.ref("uom.product_uom_dozen")
1586
+ self.stock_request_user = new_test_user(
1587
+ self.env,
1588
+ login="stock_request_user",
1589
+ groups="stock_request.group_stock_request_user",
1590
+ company_ids=[(6, 0, [self.main_company.id])],
1591
+ )
1592
+ self.stock_request_manager = new_test_user(
1593
+ self.env,
1594
+ login="stock_request_manager",
1595
+ groups="stock_request.group_stock_request_manager",
1596
+ company_ids=[(6, 0, [self.main_company.id])],
1597
+ )
1598
+ self.product_test = self._create_product("PROD", "Product Test")
1599
+ self.stock_loc = self._create_location(
1600
+ name="Backstock",
1601
+ location_id=self.warehouse.view_location_id.id,
1602
+ company_id=self.main_company.id,
1603
+ )
1604
+ self.transit_loc = self._create_location(
1605
+ name="Transit",
1606
+ location_id=self.warehouse.view_location_id.id,
1607
+ company_id=self.main_company.id,
1608
+ )
1609
+ self.manufacturing_loc = self._create_location(
1610
+ name="Manufacturing",
1611
+ location_id=self.warehouse.view_location_id.id,
1612
+ company_id=self.main_company.id,
1613
+ )
1614
+ self.route = self.env["stock.location.route"].create(
1615
+ {
1616
+ "name": "Backstock to Manufacturing (2 steps)",
1617
+ "warehouse_selectable": True,
1618
+ "warehouse_ids": [(6, 0, [self.warehouse.id])],
1619
+ "rule_ids": [
1620
+ (
1621
+ 0,
1622
+ False,
1623
+ {
1624
+ "name": "Stock to Transit",
1625
+ "location_src_id": self.stock_loc.id,
1626
+ "location_id": self.transit_loc.id,
1627
+ "action": "pull",
1628
+ "picking_type_id": self.warehouse.int_type_id.id,
1629
+ "procure_method": "make_to_stock",
1630
+ "warehouse_id": self.warehouse.id,
1631
+ "company_id": self.main_company.id,
1632
+ },
1633
+ ),
1634
+ (
1635
+ 0,
1636
+ False,
1637
+ {
1638
+ "name": "Transit to Manufacturing",
1639
+ "location_src_id": self.transit_loc.id,
1640
+ "location_id": self.manufacturing_loc.id,
1641
+ "action": "pull_push",
1642
+ "picking_type_id": self.warehouse.int_type_id.id,
1643
+ "procure_method": "make_to_order",
1644
+ "warehouse_id": self.warehouse.id,
1645
+ "company_id": self.main_company.id,
1646
+ },
1647
+ ),
1648
+ ],
1649
+ }
1650
+ )
1651
+ self.product_test.route_ids = [(6, 0, [self.route.id])]
1652
+ self._create_stock_quant(self.stock_loc, self.product_test, 5)
1653
+
1654
+ def _create_product(self, default_code, name, **vals):
1655
+ return self.env["product.product"].create(
1656
+ dict(
1657
+ name=name,
1658
+ default_code=default_code,
1659
+ uom_id=self.uom_unit.id,
1660
+ uom_po_id=self.uom_dozen.id,
1661
+ type="product",
1662
+ **vals
1663
+ )
1664
+ )
1665
+
1666
+ def _create_location(self, **vals):
1667
+ return self.env["stock.location"].create(dict(usage="internal", **vals))
1668
+
1669
+ def _create_stock_quant(self, location_id, product_id, qty):
1670
+ self.env["stock.quant"].create(
1671
+ {
1672
+ "location_id": location_id.id,
1673
+ "product_id": product_id.id,
1674
+ "quantity": qty,
1675
+ }
1676
+ )
1677
+
1678
+ def test_two_pickings_related(self):
1679
+ """Test to check that order has two related pickings after confirmation"""
1680
+ expected_date = fields.Datetime.now()
1681
+ vals = {
1682
+ "company_id": self.main_company.id,
1683
+ "warehouse_id": self.warehouse.id,
1684
+ "location_id": self.manufacturing_loc.id,
1685
+ "expected_date": expected_date,
1686
+ "stock_request_ids": [
1687
+ (
1688
+ 0,
1689
+ 0,
1690
+ {
1691
+ "product_id": self.product_test.id,
1692
+ "product_uom_id": self.product_test.uom_id.id,
1693
+ "product_uom_qty": 5.0,
1694
+ "company_id": self.main_company.id,
1695
+ "warehouse_id": self.warehouse.id,
1696
+ "location_id": self.manufacturing_loc.id,
1697
+ "expected_date": expected_date,
1698
+ },
1699
+ )
1700
+ ],
1701
+ }
1702
+ order = self.request_order.with_user(self.stock_request_user).create(vals)
1703
+ order.with_user(self.stock_request_manager).action_confirm()
1704
+ self.assertEqual(len(order.mapped("picking_ids")), 2)
@@ -1,12 +1,11 @@
1
1
  Metadata-Version: 2.1
2
- Name: odoo-addon-stock-request
3
- Version: 15.0.1.8.0.1
2
+ Name: odoo-addon-stock_request
3
+ Version: 15.0.1.8.1
4
4
  Summary: Internal request for stock
5
5
  Home-page: https://github.com/OCA/stock-logistics-warehouse
6
6
  Author: ForgeFlow, Odoo Community Association (OCA)
7
7
  Author-email: support@odoo-community.org
8
8
  License: LGPL-3
9
- Platform: UNKNOWN
10
9
  Classifier: Programming Language :: Python
11
10
  Classifier: Framework :: Odoo
12
11
  Classifier: Framework :: Odoo :: 15.0
@@ -23,7 +22,7 @@ Stock Request
23
22
  !! This file is generated by oca-gen-addon-readme !!
24
23
  !! changes will be overwritten. !!
25
24
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
26
- !! source digest: sha256:9922750ed65a20a1bf7665de38bf99f1a0ff2254a2106a9cc19980733827ded9
25
+ !! source digest: sha256:3b710a651bfee502956ef3ec54a10bedeef599889b6d6db68852c0df8e2b624d
27
26
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
28
27
 
29
28
  .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -155,5 +154,3 @@ promote its widespread use.
155
154
  This module is part of the `OCA/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/15.0/stock_request>`_ project on GitHub.
156
155
 
157
156
  You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
158
-
159
-
@@ -1,6 +1,6 @@
1
- odoo/addons/stock_request/README.rst,sha256=6JHog8hD1gwpvKUj0vx2_uIx4ral1KNfhGOU-M72j5Y,4874
1
+ odoo/addons/stock_request/README.rst,sha256=_DaePadjLCfxiuqpI2K1ynlnGqevkwmAbl6pqSTB-Xc,4874
2
2
  odoo/addons/stock_request/__init__.py,sha256=X9EJGOE2GtZbS0G82PtSXmWSZ_R8jEM0rlJTDliQjp4,21
3
- odoo/addons/stock_request/__manifest__.py,sha256=7Nyl5gsti_k_yHlVmECqjspC0O86K4jD-8p4XKMNStg,951
3
+ odoo/addons/stock_request/__manifest__.py,sha256=UfgFPZoCnGWHOoe4d0FM8ebdYNjb9hZlQyaU9_h2H3s,951
4
4
  odoo/addons/stock_request/data/stock_request_sequence_data.xml,sha256=MKvzK__cH1gecmyqWK6Vj7yJ0o1-oKbqy2ydNoTUhs0,683
5
5
  odoo/addons/stock_request/i18n/ca.po,sha256=xaIpl-ssQ_68GPgUCfeZ4Qpl6G595gopvbhcNworDcE,45732
6
6
  odoo/addons/stock_request/i18n/de.po,sha256=1JhIiiKWVlqlU4mc4vEtbflIBjOKHEdW5drsXsSuu3Y,50700
@@ -41,7 +41,7 @@ odoo/addons/stock_request/models/stock_location_route.py,sha256=ItW4v-ubi1brYvSF
41
41
  odoo/addons/stock_request/models/stock_move.py,sha256=hDQhoO9GHD_-64C0VEcR9csAbldXHI_UtbbEVqVEyfQ,2812
42
42
  odoo/addons/stock_request/models/stock_move_line.py,sha256=yG9lnTjfAdUBdcclnrsB5bzvpItmpV0wrCHIh7hdJDQ,2773
43
43
  odoo/addons/stock_request/models/stock_picking.py,sha256=65XbzhNNeliiaugeI13IxgZkPS5ixHanaXQVds7hhjo,1343
44
- odoo/addons/stock_request/models/stock_request.py,sha256=Qh4TZQrcHNZX41vUSW9_AT7lGw5ZtpWiuOVi6KU9xOU,15928
44
+ odoo/addons/stock_request/models/stock_request.py,sha256=mOUDK7-3oAZxBa7BCtNw0utABMRjWKJigPFuaIJKNJ4,16345
45
45
  odoo/addons/stock_request/models/stock_request_abstract.py,sha256=7IpAbvJB6jYiIn9ynjSphtRCvcdLceENpmSqxWWceKA,9561
46
46
  odoo/addons/stock_request/models/stock_request_allocation.py,sha256=Kqq6VcZgYSbw2OSooeWgzVLBlWyiVJbR71dyKciPzUg,2927
47
47
  odoo/addons/stock_request/models/stock_request_order.py,sha256=NOgMY0jNV6n2pMsBIrI6GSG-IoLkJlTOtaFJQG_pgpM,15449
@@ -56,9 +56,9 @@ odoo/addons/stock_request/security/ir.model.access.csv,sha256=dsUwAR79-qQNVwCZhv
56
56
  odoo/addons/stock_request/security/stock_request_security.xml,sha256=VP0gCObFyM2wl0jcsO_J0vt2_jV0BQWtj4UMSqPellA,5978
57
57
  odoo/addons/stock_request/static/description/icon.png,sha256=HZGM_z7Ta3zNQ2924BUiMfDuVSCWqrEwUQMWXBnK7yk,15218
58
58
  odoo/addons/stock_request/static/description/icon.svg,sha256=e3qo4KGYRy7Mfzhb_bCfVA-73Rk2Lx1z9_kz7tTjdO0,9771
59
- odoo/addons/stock_request/static/description/index.html,sha256=HK-l-ZdO4aMKYUF6RlagtksV6kOxkSjacHfwp7lGtkg,16015
59
+ odoo/addons/stock_request/static/description/index.html,sha256=XM4pIw-CA6OKwMNUPGZoMTKE9t0fSutVsNhYK_h0Hnc,16098
60
60
  odoo/addons/stock_request/tests/__init__.py,sha256=3NQ2fafGprBbsMjR2Y__yzyvFX5Vio1r0j6tT3FTbas,33
61
- odoo/addons/stock_request/tests/test_stock_request.py,sha256=t8yCkIWvr1AHU5560QphbnuQCXmlKhECnAw5nR9Y_ZQ,62828
61
+ odoo/addons/stock_request/tests/test_stock_request.py,sha256=1xgwn7kUE30HvtXucUv6ivwfYtpY84mXqzluMQbyY-c,68502
62
62
  odoo/addons/stock_request/views/product.xml,sha256=CJ6RE5uGQLlIMDCPKxw8nhodb_rR3jaj-mF5ozCFUKI,1517
63
63
  odoo/addons/stock_request/views/res_config_settings_views.xml,sha256=-IJlvPYAXkO3P-QOJZlmaJ3yqdfyHdUg_arTvGm5ECo,8513
64
64
  odoo/addons/stock_request/views/stock_move_views.xml,sha256=Z5pNG0WfYz-CTlxgB-rma0BoT08VQDHnm3J_Ksu9BxA,1072
@@ -67,7 +67,7 @@ odoo/addons/stock_request/views/stock_request_allocation_views.xml,sha256=NhoVR2
67
67
  odoo/addons/stock_request/views/stock_request_menu.xml,sha256=S_3HPkmYcHC_xtPjusHiZX7RUW5CGrJW3w52ScnJFNw,1308
68
68
  odoo/addons/stock_request/views/stock_request_order_views.xml,sha256=YtB8xkt9nxkYN9FexOH1T6e8_FalgQRhA3ZSWMrj1os,10247
69
69
  odoo/addons/stock_request/views/stock_request_views.xml,sha256=k6jts8SJz1WCqaeCod9dHABEC7i3W1fT-zajr-TUWHo,11319
70
- odoo_addon_stock_request-15.0.1.8.0.1.dist-info/METADATA,sha256=qhdpAwyDhhD-e-nntFjosc-E-8MSHVwILPvlAoDHQqg,5431
71
- odoo_addon_stock_request-15.0.1.8.0.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
72
- odoo_addon_stock_request-15.0.1.8.0.1.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
73
- odoo_addon_stock_request-15.0.1.8.0.1.dist-info/RECORD,,
70
+ odoo_addon_stock_request-15.0.1.8.1.dist-info/METADATA,sha256=cWPvW40OkqmHCjxhPrNc1xOy232FvBFKQ2hi8rjBEGw,5409
71
+ odoo_addon_stock_request-15.0.1.8.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
72
+ odoo_addon_stock_request-15.0.1.8.1.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
73
+ odoo_addon_stock_request-15.0.1.8.1.dist-info/RECORD,,