odoo-addon-stock-move-location 16.0.1.2.3__py3-none-any.whl → 16.0.1.3.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 @@ 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:5d1857ebd6292836d01db07aed52de57c609bb0cca0125c4fd97b567d2d04477
10
+ !! source digest: sha256:1bbc0d0f6cd9c8298d132633b14522ed340f1f669c6fec8170f9f5347c3138e5
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": "16.0.1.2.3",
8
+ "version": "16.0.1.3.1",
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:5d1857ebd6292836d01db07aed52de57c609bb0cca0125c4fd97b567d2d04477
369
+ !! source digest: sha256:1bbc0d0f6cd9c8298d132633b14522ed340f1f669c6fec8170f9f5347c3138e5
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/16.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-16-0/stock-logistics-warehouse-16-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=16.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
@@ -7,26 +7,13 @@ from itertools import groupby
7
7
 
8
8
  from odoo import api, fields, models
9
9
  from odoo.fields import first
10
+ from odoo.osv import expression
10
11
 
11
12
 
12
13
  class StockMoveLocationWizard(models.TransientModel):
13
14
  _name = "wiz.stock.move.location"
14
15
  _description = "Wizard move location"
15
16
 
16
- def _get_default_picking_type_id(self):
17
- company_id = self.env.context.get("company_id") or self.env.user.company_id.id
18
- return (
19
- self.env["stock.picking.type"]
20
- .search(
21
- [
22
- ("code", "=", "internal"),
23
- ("warehouse_id.company_id", "=", company_id),
24
- ],
25
- limit=1,
26
- )
27
- .id
28
- )
29
-
30
17
  origin_location_disable = fields.Boolean(
31
18
  compute="_compute_readonly_locations",
32
19
  help="technical field to disable the edition of origin location.",
@@ -53,7 +40,10 @@ class StockMoveLocationWizard(models.TransientModel):
53
40
  string="Move Location lines",
54
41
  )
55
42
  picking_type_id = fields.Many2one(
56
- comodel_name="stock.picking.type", default=_get_default_picking_type_id
43
+ compute="_compute_picking_type_id",
44
+ comodel_name="stock.picking.type",
45
+ readonly=False,
46
+ store=True,
57
47
  )
58
48
  picking_id = fields.Many2one(
59
49
  string="Connected Picking", comodel_name="stock.picking"
@@ -74,6 +64,28 @@ class StockMoveLocationWizard(models.TransientModel):
74
64
  rec.origin_location_disable = True
75
65
  rec.destination_location_disable = True
76
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.company.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
+
77
89
  @api.model
78
90
  def default_get(self, fields):
79
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: 16.0.1.2.3
3
+ Version: 16.0.1.3.1
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:5d1857ebd6292836d01db07aed52de57c609bb0cca0125c4fd97b567d2d04477
26
+ !! source digest: sha256:1bbc0d0f6cd9c8298d132633b14522ed340f1f669c6fec8170f9f5347c3138e5
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=VG2TIc7j12zSbzdx1kFSB1BofNWoFtC9wMiYdypm1D0,6280
1
+ odoo/addons/stock_move_location/README.rst,sha256=IW0eY6yncuvUhCA3zgtPonbaL3hKuSnOH6JZCKrdy_c,6280
2
2
  odoo/addons/stock_move_location/__init__.py,sha256=a529MU97ndMyMZsToYJmFXUHanvFmTyIZL9lmHsflPM,88
3
- odoo/addons/stock_move_location/__manifest__.py,sha256=16Cs8poOU4GcFFJW8N3z9K7znJH1Rf1lqQmC-3668Vw,901
3
+ odoo/addons/stock_move_location/__manifest__.py,sha256=wRHqVHvgT0At-KfVivpAJvjVLqhcFcALTIwe5cSBq7c,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=fS9Z6po8XinTgKYyVhcPgld_LU8F4U-86YxWLqj7610,11196
@@ -23,7 +23,7 @@ odoo/addons/stock_move_location/readme/ROADMAP.md,sha256=HW9tNWBGh6oAjRj8qWMlXPc
23
23
  odoo/addons/stock_move_location/readme/USAGE.md,sha256=sT_tcsfaJ6sG7y1ogNpTQzTBh8qzx2t5vbgjV_zW_Cw,2055
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=Yq1tSzzBHF752JPbKZkdt3KuCnK5VnWYBwPv8WQhNbw,17050
26
+ odoo/addons/stock_move_location/static/description/index.html,sha256=vS96Uj9zpXoOTG5dMt_Ewv8CDJdyNj_iAJN20_zJVwg,17050
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=YiCuKwGt6Tt5vli0Iiwgv3gmGb2xU0irK87K1hCimQQ,6112
29
29
  odoo/addons/stock_move_location/tests/test_move_location.py,sha256=_HjZ0Gy4UXPNUlG-SJAG4WQpc_zvTitkOv1LitWHDNE,12447
@@ -31,10 +31,10 @@ odoo/addons/stock_move_location/tests/test_stock_fillwithstock.py,sha256=BvMF_7n
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=OAoLF_rCzsYKAZwqWx1TThbi0qGnT7zG-q_LfnQwheo,14338
34
+ odoo/addons/stock_move_location/wizard/stock_move_location.py,sha256=zwd6wJeJzQH4ZVyf6-z2oMoSpsSotj2mUMb2VR3AWe8,15107
35
35
  odoo/addons/stock_move_location/wizard/stock_move_location.xml,sha256=6DjFtlJJuJM31rrPjpu1hGrRdrj2iHGvDbRnUozRiSg,7878
36
36
  odoo/addons/stock_move_location/wizard/stock_move_location_line.py,sha256=7ORteDfC0RzWBEYuzlr6yn7_XN__VdyfJ31OkJ_mIwM,6323
37
- odoo_addon_stock_move_location-16.0.1.2.3.dist-info/METADATA,sha256=Qh0KvExOMrs1VTAGcx00hWeSUYzcuC4ol4l_oupaWpE,6911
38
- odoo_addon_stock_move_location-16.0.1.2.3.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
39
- odoo_addon_stock_move_location-16.0.1.2.3.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
40
- odoo_addon_stock_move_location-16.0.1.2.3.dist-info/RECORD,,
37
+ odoo_addon_stock_move_location-16.0.1.3.1.dist-info/METADATA,sha256=jR13cpc4odETqTHt1LPikkfgHbnsB2fMVVTDVj5zAVs,6911
38
+ odoo_addon_stock_move_location-16.0.1.3.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
39
+ odoo_addon_stock_move_location-16.0.1.3.1.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
40
+ odoo_addon_stock_move_location-16.0.1.3.1.dist-info/RECORD,,