odoo-addon-rma 17.0.2.2.1__py3-none-any.whl → 18.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 (45) hide show
  1. odoo/addons/rma/README.rst +6 -6
  2. odoo/addons/rma/__manifest__.py +1 -1
  3. odoo/addons/rma/controllers/main.py +4 -7
  4. odoo/addons/rma/data/mail_data.xml +12 -13
  5. odoo/addons/rma/i18n/de.po +32 -316
  6. odoo/addons/rma/i18n/de_AT.po +32 -75
  7. odoo/addons/rma/i18n/es.po +32 -336
  8. odoo/addons/rma/i18n/fr.po +32 -118
  9. odoo/addons/rma/i18n/it.po +35 -380
  10. odoo/addons/rma/i18n/nl.po +32 -75
  11. odoo/addons/rma/i18n/pt.po +32 -234
  12. odoo/addons/rma/i18n/pt_BR.po +32 -232
  13. odoo/addons/rma/i18n/rma.pot +65 -96
  14. odoo/addons/rma/i18n/ro.po +32 -209
  15. odoo/addons/rma/i18n/zh_CN.po +32 -75
  16. odoo/addons/rma/models/account_move.py +2 -2
  17. odoo/addons/rma/models/res_company.py +2 -2
  18. odoo/addons/rma/models/res_config_settings.py +3 -0
  19. odoo/addons/rma/models/rma.py +40 -39
  20. odoo/addons/rma/models/rma_team.py +12 -13
  21. odoo/addons/rma/models/stock_move.py +2 -2
  22. odoo/addons/rma/models/stock_picking.py +0 -12
  23. odoo/addons/rma/models/stock_warehouse.py +20 -14
  24. odoo/addons/rma/security/rma_security.xml +3 -9
  25. odoo/addons/rma/static/description/index.html +4 -4
  26. odoo/addons/rma/tests/test_rma.py +58 -16
  27. odoo/addons/rma/views/report_rma.xml +9 -3
  28. odoo/addons/rma/views/res_config_settings_views.xml +8 -11
  29. odoo/addons/rma/views/rma_finalization_views.xml +2 -2
  30. odoo/addons/rma/views/rma_portal_templates.xml +303 -361
  31. odoo/addons/rma/views/rma_tag_views.xml +2 -2
  32. odoo/addons/rma/views/rma_team_views.xml +35 -36
  33. odoo/addons/rma/views/rma_views.xml +7 -29
  34. odoo/addons/rma/wizard/rma_delivery.py +2 -2
  35. odoo/addons/rma/wizard/rma_delivery_views.xml +0 -3
  36. odoo/addons/rma/wizard/rma_split.py +2 -2
  37. odoo/addons/rma/wizard/rma_split_views.xml +0 -1
  38. odoo/addons/rma/wizard/stock_picking_return.py +12 -42
  39. odoo/addons/rma/wizard/stock_picking_return_views.xml +1 -5
  40. {odoo_addon_rma-17.0.2.2.1.dist-info → odoo_addon_rma-18.0.1.0.0.2.dist-info}/METADATA +9 -9
  41. odoo_addon_rma-18.0.1.0.0.2.dist-info/RECORD +70 -0
  42. odoo/addons/rma/migrations/17.0.1.2.0/post-migration.py +0 -17
  43. odoo_addon_rma-17.0.2.2.1.dist-info/RECORD +0 -71
  44. {odoo_addon_rma-17.0.2.2.1.dist-info → odoo_addon_rma-18.0.1.0.0.2.dist-info}/WHEEL +0 -0
  45. {odoo_addon_rma-17.0.2.2.1.dist-info → odoo_addon_rma-18.0.1.0.0.2.dist-info}/top_level.txt +0 -0
@@ -1,5 +1,6 @@
1
1
  # Copyright 2020 Tecnativa - Ernesto Tejeda
2
2
  # Copyright 2023 Michael Tietz (MT Software) <mtietz@mt-software.de>
3
+ # Copyright 2025 Tecnativa - Víctor Martínez
3
4
  # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
4
5
 
5
6
  from odoo.exceptions import UserError, ValidationError
@@ -28,7 +29,7 @@ class TestRma(BaseCommon):
28
29
  )
29
30
  cls.rma_loc = cls.warehouse_company.rma_loc_id
30
31
  cls.product = cls.product_product.create(
31
- {"name": "Product test 1", "type": "product"}
32
+ {"name": "Product test 1", "type": "consu", "is_storable": True}
32
33
  )
33
34
  cls.account_receiv = cls.env["account.account"].create(
34
35
  {
@@ -123,7 +124,7 @@ class TestRma(BaseCommon):
123
124
  move.product_uom_qty = 10
124
125
  with picking_form.move_ids_without_package.new() as move:
125
126
  move.product_id = self.product_product.create(
126
- {"name": "Product 2 test", "type": "product"}
127
+ {"name": "Product 2 test", "type": "consu", "is_storable": True}
127
128
  )
128
129
  move.product_uom_qty = 20
129
130
  picking = picking_form.save()
@@ -169,14 +170,44 @@ class TestRmaCase(TestRma):
169
170
  wizard_form.product_uom_qty = rma.product_uom_qty
170
171
  wizard = wizard_form.save()
171
172
  wizard.action_deliver()
172
- self.assertEqual(rma.delivery_picking_count, 2)
173
- out_pickings = rma.mapped("delivery_move_ids.picking_id")
174
- self.assertIn(
175
- self.warehouse.pick_type_id, out_pickings.mapped("picking_type_id")
176
- )
177
- self.assertIn(
178
- self.warehouse.out_type_id, out_pickings.mapped("picking_type_id")
173
+ out_picking = rma.delivery_move_ids.picking_id
174
+ out_picking.move_ids.quantity = 1
175
+ out_picking.button_validate()
176
+ self.assertEqual(out_picking.state, "done")
177
+ self.assertEqual(out_picking.picking_type_id, self.warehouse.pick_type_id)
178
+ next_transfer = out_picking._get_next_transfers()
179
+ self.assertEqual(next_transfer.picking_type_id, self.warehouse.out_type_id)
180
+ self.assertEqual(rma.delivery_picking_count, 1)
181
+
182
+ def test_rma_replace_pick_pack_ship(self):
183
+ self.warehouse.write({"delivery_steps": "pick_pack_ship"})
184
+ rma = self._create_rma(self.partner, self.product, 1, self.rma_loc)
185
+ rma.action_confirm()
186
+ rma.reception_move_id.quantity = 1
187
+ rma.reception_move_id.picking_id.button_validate()
188
+ self.assertEqual(rma.reception_move_id.picking_id.state, "done")
189
+ self.assertEqual(rma.state, "received")
190
+ res = rma.action_replace()
191
+ wizard_form = Form(self.env[res["res_model"]].with_context(**res["context"]))
192
+ wizard_form.product_id = self.product
193
+ wizard_form.product_uom_qty = rma.product_uom_qty
194
+ wizard = wizard_form.save()
195
+ wizard.action_deliver()
196
+ out_picking = rma.delivery_move_ids.picking_id
197
+ out_picking.move_ids.quantity = 1
198
+ out_picking.button_validate()
199
+ self.assertEqual(out_picking.state, "done")
200
+ self.assertEqual(out_picking.picking_type_id, self.warehouse.pick_type_id)
201
+ next_transfer = out_picking._get_next_transfers()
202
+ self.assertEqual(next_transfer.picking_type_id, self.warehouse.pack_type_id)
203
+ next_transfer.move_ids.quantity = 1
204
+ next_transfer.button_validate()
205
+ self.assertEqual(next_transfer.state, "done")
206
+ next_transfer_extra = next_transfer._get_next_transfers()
207
+ self.assertEqual(
208
+ next_transfer_extra.picking_type_id, self.warehouse.out_type_id
179
209
  )
210
+ self.assertEqual(rma.delivery_picking_count, 1)
180
211
 
181
212
  def test_computed(self):
182
213
  # If partner changes, the invoice address is set
@@ -193,7 +224,12 @@ class TestRmaCase(TestRma):
193
224
  }
194
225
  )
195
226
  product_2 = self.product_product.create(
196
- {"name": "Product test 2", "type": "product", "uom_id": uom_ten.id}
227
+ {
228
+ "name": "Product test 2",
229
+ "type": "consu",
230
+ "is_storable": True,
231
+ "uom_id": uom_ten.id,
232
+ }
197
233
  )
198
234
  outgoing_picking_type = self.env["stock.picking.type"].search(
199
235
  [
@@ -305,6 +341,7 @@ class TestRmaCase(TestRma):
305
341
  self.assertEqual(rma_2.state, "received")
306
342
 
307
343
  @users("__system__", "user_rma")
344
+ @mute_logger("odoo.models.unlink")
308
345
  def test_action_refund(self):
309
346
  rma = self._create_confirm_receive(self.partner, self.product, 10, self.rma_loc)
310
347
  self.assertEqual(rma.state, "received")
@@ -339,6 +376,7 @@ class TestRmaCase(TestRma):
339
376
  self.assertFalse(rma.can_be_returned)
340
377
  self.assertFalse(rma.can_be_replaced)
341
378
 
379
+ @mute_logger("odoo.models.unlink")
342
380
  def test_mass_refund(self):
343
381
  # Create, confirm and receive rma_1
344
382
  rma_1 = self._create_confirm_receive(
@@ -351,7 +389,7 @@ class TestRmaCase(TestRma):
351
389
  )
352
390
  # rma_3: Same partner and different product than rma_1
353
391
  product = self.product_product.create(
354
- {"name": "Product 2 test", "type": "product"}
392
+ {"name": "Product 2 test", "type": "consu", "is_storable": True}
355
393
  )
356
394
  rma_3 = self._create_confirm_receive(self.partner, product, 20, self.rma_loc)
357
395
  # rma_4: Different partner and same product as rma_1
@@ -424,7 +462,7 @@ class TestRmaCase(TestRma):
424
462
  rma = self._create_confirm_receive(self.partner, self.product, 10, self.rma_loc)
425
463
  # Replace with another product with quantity 2.
426
464
  product_2 = self.product_product.create(
427
- {"name": "Product 2 test", "type": "product"}
465
+ {"name": "Product 2 test", "type": "consu", "is_storable": True}
428
466
  )
429
467
  delivery_form = Form(
430
468
  self.env["rma.delivery.wizard"].with_context(
@@ -450,7 +488,7 @@ class TestRmaCase(TestRma):
450
488
  picking = first_move.picking_id
451
489
  # Replace again with another product with the remaining quantity
452
490
  product_3 = self.product_product.create(
453
- {"name": "Product 3 test", "type": "product"}
491
+ {"name": "Product 3 test", "type": "consu", "is_storable": True}
454
492
  )
455
493
  delivery_form = Form(
456
494
  self.env["rma.delivery.wizard"].with_context(
@@ -572,7 +610,7 @@ class TestRmaCase(TestRma):
572
610
  )
573
611
  # rma_3: Same partner and different product than rma_1
574
612
  product = self.product_product.create(
575
- {"name": "Product 2 test", "type": "product"}
613
+ {"name": "Product 2 test", "type": "consu", "is_storable": True}
576
614
  )
577
615
  rma_3 = self._create_confirm_receive(self.partner, product, 20, self.rma_loc)
578
616
  # rma_4: Different partner and same product as rma_1
@@ -653,7 +691,7 @@ class TestRmaCase(TestRma):
653
691
  )
654
692
  # rma_3: Same partner and different product than rma_1
655
693
  product = self.product_product.create(
656
- {"name": "Product 2 test", "type": "product"}
694
+ {"name": "Product 2 test", "type": "consu", "is_storable": True}
657
695
  )
658
696
  rma_3 = self._create_confirm_receive(self.partner, product, 20, self.rma_loc)
659
697
  # rma_4: Different partner and same product as rma_1
@@ -685,7 +723,11 @@ class TestRmaCase(TestRma):
685
723
  stock_return_picking_form.create_rma = True
686
724
  stock_return_picking_form.rma_operation_id = self.operation
687
725
  return_wizard = stock_return_picking_form.save()
688
- picking_action = return_wizard.create_returns()
726
+ for move in origin_delivery.move_ids_without_package:
727
+ return_wizard.product_return_moves.filtered(
728
+ lambda x, move=move: x.move_id == move
729
+ ).quantity = move.quantity
730
+ picking_action = return_wizard.action_create_returns()
689
731
  # Each origin move is linked to a different RMA
690
732
  origin_moves = origin_delivery.move_ids
691
733
  self.assertTrue(origin_moves[0].rma_ids)
@@ -99,11 +99,15 @@
99
99
  <tbody>
100
100
  <tr t-if="doc.picking_id" name="tr_picking">
101
101
  <td>Origin delivery</td>
102
- <td><span t-field="doc.picking_id" /></td>
102
+ <td>
103
+ <span t-field="doc.picking_id" />
104
+ </td>
103
105
  </tr>
104
106
  <tr>
105
107
  <td>Product</td>
106
- <td><span t-field="doc.product_id" /></td>
108
+ <td>
109
+ <span t-field="doc.product_id" />
110
+ </td>
107
111
  </tr>
108
112
  <tr>
109
113
  <td>Quantity</td>
@@ -127,7 +131,9 @@
127
131
  </tr>
128
132
  <tr>
129
133
  <td>Requested operation</td>
130
- <td><span t-field="doc.operation_id" /></td>
134
+ <td>
135
+ <span t-field="doc.operation_id" />
136
+ </td>
131
137
  </tr>
132
138
  </tbody>
133
139
  </table>
@@ -78,7 +78,6 @@
78
78
  name="rma_mail_confirmation_template_id"
79
79
  class="oe_inline"
80
80
  required="send_rma_confirmation"
81
- context="{'default_model': 'rma'}"
82
81
  />
83
82
  </div>
84
83
  </div>
@@ -116,7 +115,6 @@
116
115
  name="rma_mail_receipt_confirmation_template_id"
117
116
  class="oe_inline"
118
117
  required="send_rma_receipt_confirmation"
119
- context="{'default_model': 'rma'}"
120
118
  />
121
119
  </div>
122
120
  </div>
@@ -154,7 +152,6 @@
154
152
  name="rma_mail_draft_confirmation_template_id"
155
153
  class="oe_inline"
156
154
  required="send_rma_draft_confirmation"
157
- context="{'default_model': 'rma'}"
158
155
  />
159
156
  </div>
160
157
  </div>
@@ -166,15 +163,15 @@
166
163
  </record>
167
164
 
168
165
  <record id="action_rma_config_settings" model="ir.actions.act_window">
169
- <field name="name">Settings</field>
170
- <field name="type">ir.actions.act_window</field>
171
- <field name="res_model">res.config.settings</field>
172
- <field name="view_mode">form</field>
173
- <field name="target">inline</field>
174
- <field name="context">{'module' : 'rma', 'bin_size': False}</field>
175
- </record>
166
+ <field name="name">Settings</field>
167
+ <field name="type">ir.actions.act_window</field>
168
+ <field name="res_model">res.config.settings</field>
169
+ <field name="view_mode">form</field>
170
+ <field name="target">inline</field>
171
+ <field name="context">{'module' : 'rma', 'bin_size': False}</field>
172
+ </record>
176
173
 
177
- <menuitem
174
+ <menuitem
178
175
  id="menu_rma_general_settings"
179
176
  name="Settings"
180
177
  parent="rma_configuration_menu"
@@ -45,11 +45,11 @@
45
45
  <field name="model">rma.finalization</field>
46
46
  <field eval="6" name="priority" />
47
47
  <field name="arch" type="xml">
48
- <tree>
48
+ <list>
49
49
  <field name="name" />
50
50
  <field name="company_id" groups="base.group_multi_company" />
51
51
  <field name="company_id" invisible="1" />
52
- </tree>
52
+ </list>
53
53
  </field>
54
54
  </record>
55
55
  <record id="action_rma_finalization" model="ir.actions.act_window">