odoo-addon-stock-move-location 15.0.1.3.4__py3-none-any.whl → 15.0.1.4.0__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 @@ Move Stock Location
7
7
  !! This file is generated by oca-gen-addon-readme !!
8
8
  !! changes will be overwritten. !!
9
9
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10
- !! source digest: sha256:cbb3ddaaf3f033fa78193497c0e75c1dd22033897a89e39f04124f5e5b12cb3d
10
+ !! source digest: sha256:c14a0ed61aa5338addefd5256e2ae84612bf0b7885e828a0735092d6145a11fd
11
11
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12
12
 
13
13
  .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -5,7 +5,7 @@
5
5
 
6
6
  {
7
7
  "name": "Move Stock Location",
8
- "version": "15.0.1.3.4",
8
+ "version": "15.0.1.4.0",
9
9
  "author": "Julius Network Solutions, "
10
10
  "BCIM,"
11
11
  "Camptocamp,"
@@ -366,7 +366,7 @@ ul.auto-toc {
366
366
  !! This file is generated by oca-gen-addon-readme !!
367
367
  !! changes will be overwritten. !!
368
368
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
369
- !! source digest: sha256:cbb3ddaaf3f033fa78193497c0e75c1dd22033897a89e39f04124f5e5b12cb3d
369
+ !! source digest: sha256:c14a0ed61aa5338addefd5256e2ae84612bf0b7885e828a0735092d6145a11fd
370
370
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
371
371
  <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/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 image-reference" href="https://github.com/OCA/stock-logistics-warehouse/tree/15.0/stock_move_location"><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_move_location"><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
372
  <p>This module allows to move entire location of products from one place to
@@ -8,26 +8,13 @@ from itertools import groupby
8
8
 
9
9
  from odoo import api, fields, models
10
10
  from odoo.fields import first
11
+ from odoo.osv import expression
11
12
 
12
13
 
13
14
  class StockMoveLocationWizard(models.TransientModel):
14
15
  _name = "wiz.stock.move.location"
15
16
  _description = "Wizard move location"
16
17
 
17
- def _get_default_picking_type_id(self):
18
- company_id = self.env.context.get("company_id") or self.env.user.company_id.id
19
- return (
20
- self.env["stock.picking.type"]
21
- .search(
22
- [
23
- ("code", "=", "internal"),
24
- ("warehouse_id.company_id", "=", company_id),
25
- ],
26
- limit=1,
27
- )
28
- .id
29
- )
30
-
31
18
  origin_location_disable = fields.Boolean(
32
19
  compute="_compute_readonly_locations",
33
20
  help="technical field to disable the edition of origin location.",
@@ -54,7 +41,9 @@ class StockMoveLocationWizard(models.TransientModel):
54
41
  string="Move Location lines",
55
42
  )
56
43
  picking_type_id = fields.Many2one(
57
- comodel_name="stock.picking.type", default=_get_default_picking_type_id
44
+ compute="_compute_picking_type_id",
45
+ comodel_name="stock.picking.type",
46
+ readonly=False,
58
47
  )
59
48
  picking_id = fields.Many2one(
60
49
  string="Connected Picking", comodel_name="stock.picking"
@@ -75,6 +64,28 @@ class StockMoveLocationWizard(models.TransientModel):
75
64
  rec.origin_location_disable = True
76
65
  rec.destination_location_disable = True
77
66
 
67
+ @api.depends_context("company")
68
+ @api.depends("origin_location_id")
69
+ def _compute_picking_type_id(self):
70
+ company_id = self.env.context.get("company_id") or self.env.user.company_id.id
71
+ for rec in self:
72
+ picking_type = self.env["stock.picking.type"]
73
+ base_domain = [
74
+ ("code", "=", "internal"),
75
+ ("warehouse_id.company_id", "=", company_id),
76
+ ]
77
+ if rec.origin_location_id:
78
+ location_id = rec.origin_location_id
79
+ while location_id and not picking_type:
80
+ domain = [("default_location_src_id", "=", location_id.id)]
81
+ domain = expression.AND([base_domain, domain])
82
+ picking_type = picking_type.search(domain, limit=1)
83
+ # Move up to the parent location if no picking type found
84
+ location_id = not picking_type and location_id.location_id or False
85
+ if not picking_type:
86
+ picking_type = picking_type.search(base_domain, limit=1)
87
+ rec.picking_type_id = picking_type.id
88
+
78
89
  @api.model
79
90
  def default_get(self, fields):
80
91
  res = super().default_get(fields)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: odoo-addon-stock-move-location
3
- Version: 15.0.1.3.4
3
+ Version: 15.0.1.4.0
4
4
  Summary: This module allows to move all stock in a stock location to an other one.
5
5
  Home-page: https://github.com/OCA/stock-logistics-warehouse
6
6
  Author: Julius Network Solutions, BCIM,Camptocamp,Odoo Community Association (OCA)
@@ -23,7 +23,7 @@ Move Stock Location
23
23
  !! This file is generated by oca-gen-addon-readme !!
24
24
  !! changes will be overwritten. !!
25
25
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
26
- !! source digest: sha256:cbb3ddaaf3f033fa78193497c0e75c1dd22033897a89e39f04124f5e5b12cb3d
26
+ !! source digest: sha256:c14a0ed61aa5338addefd5256e2ae84612bf0b7885e828a0735092d6145a11fd
27
27
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
28
28
 
29
29
  .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -1,6 +1,6 @@
1
- odoo/addons/stock_move_location/README.rst,sha256=Xbol9FNV-aeYeXW9fd6HoGnZheUlP6UVEmnVpdbx3X0,5725
1
+ odoo/addons/stock_move_location/README.rst,sha256=Y1_uSxkWja18iEbVSf8augWnT81eZjH18d9PxeYy_Bo,5725
2
2
  odoo/addons/stock_move_location/__init__.py,sha256=a529MU97ndMyMZsToYJmFXUHanvFmTyIZL9lmHsflPM,88
3
- odoo/addons/stock_move_location/__manifest__.py,sha256=r_OKA99B_CGA5YdRQXgR_deAttdVOgAk_db3ZmLsBEE,901
3
+ odoo/addons/stock_move_location/__manifest__.py,sha256=97GPNgrex1Ro2ZqgcoYTe3hjyLTyFm0abU2N99Q5WD8,901
4
4
  odoo/addons/stock_move_location/init_hook.py,sha256=iIIjLsKG3z1Esn7A_tiIQZ9jXPvVs6EIhtNICdv-FQA,419
5
5
  odoo/addons/stock_move_location/data/stock_quant_view.xml,sha256=g7KS13Q9jEIZTKiNHjWrFcggfYyfK2ZW2VONnCLSZaI,635
6
6
  odoo/addons/stock_move_location/i18n/de.po,sha256=Ax60atxl9wQXRn5D8N3pJScDGUCNwkbmjTSGVEmaMk4,11151
@@ -23,7 +23,7 @@ odoo/addons/stock_move_location/readme/ROADMAP.rst,sha256=3ISYpvtqVfZFuaIw26oMSr
23
23
  odoo/addons/stock_move_location/readme/USAGE.rst,sha256=pgj-r1O-Mq7GYKmCYem9IuKzKXPVntO5j1LUlbB37Hc,1654
24
24
  odoo/addons/stock_move_location/security/ir.model.access.csv,sha256=sLpkI9b3t8YdWBbYPjzlQrCbmv-_C0bUwzd10cMF14M,338
25
25
  odoo/addons/stock_move_location/static/description/icon.png,sha256=6xBPJauaFOF0KDHfHgQopSc28kKvxMaeoQFQWZtfZDo,9455
26
- odoo/addons/stock_move_location/static/description/index.html,sha256=yd3CSe4_R2DoFVihebw9ukflge5NaJutAJPkk2ZFB-E,16474
26
+ odoo/addons/stock_move_location/static/description/index.html,sha256=wQGZd5qX6DNnX0l87jiMrW8KIXjU2q6ajBn5AiRg7g0,16474
27
27
  odoo/addons/stock_move_location/tests/__init__.py,sha256=gDGhCnhTYQONkRkGhPtOhgWTJ8sj6zs-sl2YRRvqGvQ,98
28
28
  odoo/addons/stock_move_location/tests/test_common.py,sha256=tVu5r4Y8E4vLF-BcoPwVX7nAIVKWwewkOF14oSYLYaM,6150
29
29
  odoo/addons/stock_move_location/tests/test_move_location.py,sha256=tsZi_kMtd3oKqLRqh06CHwwZZ5YVasCblqJJqnbRpAE,12101
@@ -31,10 +31,10 @@ odoo/addons/stock_move_location/tests/test_stock_fillwithstock.py,sha256=D-OzeNh
31
31
  odoo/addons/stock_move_location/views/stock_picking.xml,sha256=isH25PIq7A2rfCUzk9_HFYA8WIoGm5HNDu-N3CJazRQ,730
32
32
  odoo/addons/stock_move_location/views/stock_picking_type_views.xml,sha256=V8_fzqt7ga3O8U81JNbb8NOuT0JHsXwC2bG1jqJvmAk,1483
33
33
  odoo/addons/stock_move_location/wizard/__init__.py,sha256=0YXi68VJIkwZDO1-ZFirM2ANY3Mi7PEPdYW0Gg46lmY,239
34
- odoo/addons/stock_move_location/wizard/stock_move_location.py,sha256=l8-m18hyh8Jh2VwSaza7lG6HFzgK8a7fX6oqIx7sQ_4,13660
34
+ odoo/addons/stock_move_location/wizard/stock_move_location.py,sha256=XUGfmMBYpKyKeSX94DQbWSsC0tc5rcV3OtG3tlvD6NI,14417
35
35
  odoo/addons/stock_move_location/wizard/stock_move_location.xml,sha256=V0OTO0QRolPTesymqg78Q2UotTsYMrq4v_WtkhvV9mU,7646
36
36
  odoo/addons/stock_move_location/wizard/stock_move_location_line.py,sha256=0p9cZqGSF35vAdsaVTWuYp7O5ax-U9F5JoVI7hyxNzI,6375
37
- odoo_addon_stock_move_location-15.0.1.3.4.dist-info/METADATA,sha256=DMfh1XuYjVAKhjYBdw3pF5sqNQnp9g-SAk1U-2980qg,6355
38
- odoo_addon_stock_move_location-15.0.1.3.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
39
- odoo_addon_stock_move_location-15.0.1.3.4.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
40
- odoo_addon_stock_move_location-15.0.1.3.4.dist-info/RECORD,,
37
+ odoo_addon_stock_move_location-15.0.1.4.0.dist-info/METADATA,sha256=urMcg4zugrNUNqwtTxfS-QCiXMUJgSRAXwHb6_Igyik,6355
38
+ odoo_addon_stock_move_location-15.0.1.4.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
39
+ odoo_addon_stock_move_location-15.0.1.4.0.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
40
+ odoo_addon_stock_move_location-15.0.1.4.0.dist-info/RECORD,,