odoo-addon-sale-order-line-sequence 15.0.1.0.0.7__py3-none-any.whl → 15.0.2.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.

Potentially problematic release.


This version of odoo-addon-sale-order-line-sequence might be problematic. Click here for more details.

Files changed (44) hide show
  1. odoo/addons/sale_order_line_sequence/README.rst +1 -1
  2. odoo/addons/sale_order_line_sequence/__init__.py +1 -2
  3. odoo/addons/sale_order_line_sequence/__manifest__.py +7 -3
  4. odoo/addons/sale_order_line_sequence/i18n/ca.po +18 -7
  5. odoo/addons/sale_order_line_sequence/i18n/de.po +24 -7
  6. odoo/addons/sale_order_line_sequence/i18n/el_GR.po +18 -7
  7. odoo/addons/sale_order_line_sequence/i18n/es.po +25 -8
  8. odoo/addons/sale_order_line_sequence/i18n/es_ES.po +18 -7
  9. odoo/addons/sale_order_line_sequence/i18n/es_VE.po +18 -7
  10. odoo/addons/sale_order_line_sequence/i18n/fi.po +18 -7
  11. odoo/addons/sale_order_line_sequence/i18n/fr.po +18 -7
  12. odoo/addons/sale_order_line_sequence/i18n/hr.po +24 -7
  13. odoo/addons/sale_order_line_sequence/i18n/hr_HR.po +18 -7
  14. odoo/addons/sale_order_line_sequence/i18n/hu.po +18 -7
  15. odoo/addons/sale_order_line_sequence/i18n/it.po +18 -7
  16. odoo/addons/sale_order_line_sequence/i18n/nl.po +18 -7
  17. odoo/addons/sale_order_line_sequence/i18n/nl_NL.po +18 -7
  18. odoo/addons/sale_order_line_sequence/i18n/pt.po +24 -7
  19. odoo/addons/sale_order_line_sequence/i18n/pt_BR.po +18 -7
  20. odoo/addons/sale_order_line_sequence/i18n/ro.po +18 -7
  21. odoo/addons/sale_order_line_sequence/i18n/sale_order_line_sequence.pot +18 -7
  22. odoo/addons/sale_order_line_sequence/i18n/sk.po +18 -7
  23. odoo/addons/sale_order_line_sequence/i18n/sl.po +18 -7
  24. odoo/addons/sale_order_line_sequence/i18n/tr.po +18 -7
  25. odoo/addons/sale_order_line_sequence/i18n/tr_TR.po +18 -7
  26. odoo/addons/sale_order_line_sequence/i18n/vi_VN.po +18 -7
  27. odoo/addons/sale_order_line_sequence/i18n/zh_CN.po +24 -7
  28. odoo/addons/sale_order_line_sequence/{model → models}/__init__.py +2 -0
  29. odoo/addons/sale_order_line_sequence/models/account_move_line.py +24 -0
  30. odoo/addons/sale_order_line_sequence/models/sale_order.py +24 -0
  31. odoo/addons/sale_order_line_sequence/models/sale_order_line.py +31 -0
  32. odoo/addons/sale_order_line_sequence/static/description/index.html +1 -1
  33. odoo/addons/sale_order_line_sequence/tests/test_sale_order_line_sequence.py +83 -14
  34. odoo/addons/sale_order_line_sequence/views/account_move_view.xml +20 -0
  35. odoo/addons/sale_order_line_sequence/views/report_invoice.xml +24 -0
  36. odoo/addons/sale_order_line_sequence/views/report_saleorder.xml +2 -2
  37. odoo/addons/sale_order_line_sequence/views/sale_view.xml +1 -1
  38. {odoo_addon_sale_order_line_sequence-15.0.1.0.0.7.dist-info → odoo_addon_sale_order_line_sequence-15.0.2.0.0.2.dist-info}/METADATA +2 -2
  39. odoo_addon_sale_order_line_sequence-15.0.2.0.0.2.dist-info/RECORD +46 -0
  40. {odoo_addon_sale_order_line_sequence-15.0.1.0.0.7.dist-info → odoo_addon_sale_order_line_sequence-15.0.2.0.0.2.dist-info}/WHEEL +1 -1
  41. odoo/addons/sale_order_line_sequence/init_hooks.py +0 -15
  42. odoo/addons/sale_order_line_sequence/model/sale_order.py +0 -69
  43. odoo_addon_sale_order_line_sequence-15.0.1.0.0.7.dist-info/RECORD +0 -43
  44. {odoo_addon_sale_order_line_sequence-15.0.1.0.0.7.dist-info → odoo_addon_sale_order_line_sequence-15.0.2.0.0.2.dist-info}/top_level.txt +0 -0
@@ -22,8 +22,13 @@ msgstr ""
22
22
 
23
23
  #. module: sale_order_line_sequence
24
24
  #: model_terms:ir.ui.view,arch_db:sale_order_line_sequence.report_saleorder_document_sequence
25
- msgid "<strong>Sequence</strong>"
26
- msgstr "<strong>序列</strong>"
25
+ msgid "<strong>Line Number</strong>"
26
+ msgstr ""
27
+
28
+ #. module: sale_order_line_sequence
29
+ #: model:ir.model.fields,help:sale_order_line_sequence.field_sale_order_line__visible_sequence
30
+ msgid "Displays the sequence of the line in the sale order."
31
+ msgstr ""
27
32
 
28
33
  #. module: sale_order_line_sequence
29
34
  #: model:ir.model.fields,help:sale_order_line_sequence.field_sale_order_line__sequence
@@ -31,7 +36,13 @@ msgid "Gives the sequence of this line when displaying the sale order."
31
36
  msgstr "显示销售订单时给出此行的顺序。"
32
37
 
33
38
  #. module: sale_order_line_sequence
34
- #: model:ir.model.fields,field_description:sale_order_line_sequence.field_sale_order_line__sequence2
39
+ #: model:ir.model,name:sale_order_line_sequence.model_account_move_line
40
+ msgid "Journal Item"
41
+ msgstr ""
42
+
43
+ #. module: sale_order_line_sequence
44
+ #: model:ir.model.fields,field_description:sale_order_line_sequence.field_sale_order_line__visible_sequence
45
+ #: model_terms:ir.ui.view,arch_db:sale_order_line_sequence.report_invoice_document_inherit_sale_sequence
35
46
  msgid "Line Number"
36
47
  msgstr "行号"
37
48
 
@@ -40,6 +51,11 @@ msgstr "行号"
40
51
  msgid "Max sequence in lines"
41
52
  msgstr "行中的最大序列"
42
53
 
54
+ #. module: sale_order_line_sequence
55
+ #: model:ir.model.fields,field_description:sale_order_line_sequence.field_account_move_line__related_so_sequence
56
+ msgid "SO Line Number"
57
+ msgstr ""
58
+
43
59
  #. module: sale_order_line_sequence
44
60
  #: model:ir.model,name:sale_order_line_sequence.model_sale_order
45
61
  msgid "Sales Order"
@@ -55,10 +71,11 @@ msgstr "销售订单行"
55
71
  msgid "Sequence"
56
72
  msgstr "序列"
57
73
 
58
- #. module: sale_order_line_sequence
59
- #: model:ir.model.fields,help:sale_order_line_sequence.field_sale_order_line__sequence2
60
- msgid "Shows the sequence of this line in the sale order."
61
- msgstr "显示销售订单中此行的顺序。"
74
+ #~ msgid "<strong>Sequence</strong>"
75
+ #~ msgstr "<strong>序列</strong>"
76
+
77
+ #~ msgid "Shows the sequence of this line in the sale order."
78
+ #~ msgstr "显示销售订单中此行的顺序。"
62
79
 
63
80
  #~ msgid "Sale Order"
64
81
  #~ msgstr "销售订单"
@@ -1,3 +1,5 @@
1
1
  # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
2
2
 
3
3
  from . import sale_order
4
+ from . import sale_order_line
5
+ from . import account_move_line
@@ -0,0 +1,24 @@
1
+ # Copyright 2023 Forgeflow S.L.
2
+ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
3
+
4
+ from odoo import api, fields, models
5
+
6
+
7
+ class AccountMoveLine(models.Model):
8
+ _inherit = "account.move.line"
9
+
10
+ related_so_sequence = fields.Char(
11
+ string="SO Line Number",
12
+ compute="_compute_related_so_sequence",
13
+ )
14
+
15
+ @api.depends("move_id.invoice_line_ids")
16
+ def _compute_related_so_sequence(self):
17
+ for rec in self:
18
+ if len(rec.move_id.mapped("line_ids.sale_line_ids.order_id")) > 1:
19
+ rec.related_so_sequence = "{}/{}".format(
20
+ rec.sale_line_ids.order_id.name,
21
+ rec.sale_line_ids.visible_sequence,
22
+ )
23
+ else:
24
+ rec.related_so_sequence = str(rec.sale_line_ids.visible_sequence)
@@ -0,0 +1,24 @@
1
+ # Copyright 2017 ForgeFlow S.L.
2
+ # Copyright 2017 Serpent Consulting Services Pvt. Ltd.
3
+ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
4
+
5
+ from odoo import api, fields, models
6
+
7
+
8
+ class SaleOrder(models.Model):
9
+ _inherit = "sale.order"
10
+
11
+ @api.depends("order_line")
12
+ def _compute_max_line_sequence(self):
13
+ """Allow to know the highest sequence entered in sale order lines.
14
+ Then we add 1 to this value for the next sequence.
15
+ This value is given to the context of the o2m field in the view.
16
+ So when we create new sale order lines, the sequence is automatically
17
+ added as : max_sequence + 1
18
+ """
19
+ for sale in self:
20
+ sale.max_line_sequence = max(sale.mapped("order_line.sequence") or [0]) + 1
21
+
22
+ max_line_sequence = fields.Integer(
23
+ string="Max sequence in lines", compute="_compute_max_line_sequence", store=True
24
+ )
@@ -0,0 +1,31 @@
1
+ # Copyright 2017 ForgeFlow S.L.
2
+ # Copyright 2017 Serpent Consulting Services Pvt. Ltd.
3
+ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
4
+
5
+ from odoo import api, fields, models
6
+
7
+
8
+ class SaleOrderLine(models.Model):
9
+ _inherit = "sale.order.line"
10
+
11
+ # re-defines the field to change the default
12
+ sequence = fields.Integer(
13
+ help="Gives the sequence of this line when displaying the sale order.",
14
+ default=9999,
15
+ )
16
+
17
+ visible_sequence = fields.Integer(
18
+ "Line Number",
19
+ help="Displays the sequence of the line in the sale order.",
20
+ compute="_compute_visible_sequence",
21
+ store=True,
22
+ )
23
+
24
+ @api.depends("sequence", "order_id.order_line")
25
+ def _compute_visible_sequence(self):
26
+ for so in self.mapped("order_id"):
27
+ sequence = 1
28
+ order_lines = so.order_line.filtered(lambda l: not l.display_type)
29
+ for line in sorted(order_lines, key=lambda l: l.sequence):
30
+ line.visible_sequence = sequence
31
+ sequence += 1
@@ -367,7 +367,7 @@ ul.auto-toc {
367
367
  !! This file is generated by oca-gen-addon-readme !!
368
368
  !! changes will be overwritten. !!
369
369
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370
- !! source digest: sha256:ebec3c262a51e2c6dbd1aaf2ea532cebbb4f4ff23b93c83b39f080f9e6c8c203
370
+ !! source digest: sha256:3e6b14e52a5ea56c930b7d7d9743a54db9ac35f86f8d1bce89181f74c332b15c
371
371
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372
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/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/sale-workflow/tree/15.0/sale_order_line_sequence"><img alt="OCA/sale-workflow" src="https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/sale-workflow-15-0/sale-workflow-15-0-sale_order_line_sequence"><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/sale-workflow&amp;target_branch=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373
373
  <p>Displays the sequence of Sale order line and helps to maintain the order.
@@ -1,18 +1,24 @@
1
1
  # Copyright 2019 Ecosoft Co., Ltd (http://ecosoft.co.th/)
2
2
  # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)
3
3
 
4
+ from odoo.tests import tagged
4
5
  from odoo.tests.common import TransactionCase
5
6
 
6
7
 
8
+ @tagged("post_install", "-at_install")
7
9
  class TestSaleOrderLineSequence(TransactionCase):
8
- def setUp(self):
9
- super(TestSaleOrderLineSequence, self).setUp()
10
- self.sale_order = self.env["sale.order"]
11
- self.sale_order_line = self.env["sale.order.line"]
12
- self.partner = self.env.ref("base.res_partner_1")
13
- self.product = self.env.ref("product.product_product_4")
10
+ @classmethod
11
+ def setUpClass(cls):
12
+ super(TestSaleOrderLineSequence, cls).setUpClass()
13
+ cls.sale_order = cls.env["sale.order"]
14
+ cls.sale_order_line = cls.env["sale.order.line"]
15
+ cls.account_move = cls.env["account.move"]
16
+ cls.account_move_line = cls.env["account.move.line"]
17
+ cls.partner = cls.env.ref("base.res_partner_1")
18
+ cls.product = cls.env.ref("product.product_product_4")
19
+ cls.product_2 = cls.env.ref("product.product_product_11")
14
20
 
15
- def test_sale_order_line_sequence(self):
21
+ def _create_sale_order(self):
16
22
  vals = {
17
23
  "partner_id": self.partner.id,
18
24
  "order_line": [
@@ -20,16 +26,79 @@ class TestSaleOrderLineSequence(TransactionCase):
20
26
  0,
21
27
  0,
22
28
  {
23
- "product_id": self.product.id,
24
29
  "name": self.product.name,
25
- "product_uom_qty": 1.0,
26
- "price_unit": self.product.lst_price,
30
+ "product_id": self.product.id,
31
+ "product_uom_qty": 5.0,
32
+ "product_uom": self.product.uom_id.id,
33
+ "price_unit": 500.0,
34
+ },
35
+ ),
36
+ (
37
+ 0,
38
+ 0,
39
+ {
40
+ "name": self.product_2.name,
41
+ "product_id": self.product_2.id,
42
+ "product_uom_qty": 5.0,
43
+ "product_uom": self.product.uom_id.id,
44
+ "price_unit": 150,
27
45
  },
28
- )
46
+ ),
29
47
  ],
30
48
  }
31
- so1 = self.sale_order.create(vals)
49
+
50
+ return self.sale_order.create(vals)
51
+
52
+ def test_sale_order_line_sequence(self):
53
+ so1 = self._create_sale_order()
32
54
  so1.action_confirm()
33
- self.assertEqual(so1.order_line.sequence, 1)
55
+ self.assertEqual(so1.order_line[0].visible_sequence, 1)
34
56
  so2 = so1.copy()
35
- self.assertEqual(so2.order_line.sequence, 1)
57
+ self.assertEqual(so2.order_line[0].visible_sequence, 1)
58
+
59
+ def test_sale_order_line_sequence_section(self):
60
+ so1 = self._create_sale_order()
61
+ self.sale_order_line.create(
62
+ {
63
+ "name": "Note 1",
64
+ "order_id": so1.id,
65
+ "display_type": "line_section",
66
+ }
67
+ )
68
+ self.sale_order_line.create(
69
+ {
70
+ "name": self.product_2.name,
71
+ "order_id": so1.id,
72
+ "product_id": self.product_2.id,
73
+ "product_uom_qty": 3.0,
74
+ "product_uom": self.product.uom_id.id,
75
+ "price_unit": 200,
76
+ }
77
+ )
78
+ so1.action_confirm()
79
+
80
+ sequence = 1
81
+ for line in so1.order_line:
82
+ if line.display_type:
83
+ self.assertFalse(line.visible_sequence)
84
+ continue
85
+ self.assertEqual(line.visible_sequence, sequence)
86
+ sequence += 1
87
+
88
+ def test_invoice_sequence(self):
89
+ """
90
+ Verify that the sequence is correctly assigned to the account move associated
91
+ with the sale order line it references.
92
+ """
93
+ so = self._create_sale_order()
94
+ so.action_confirm()
95
+ so.order_line.qty_delivered = 5
96
+ self.invoice = so._create_invoices()
97
+ self.assertEqual(
98
+ str(so.order_line[0].visible_sequence),
99
+ self.invoice.line_ids[0].related_so_sequence,
100
+ )
101
+ self.assertEqual(
102
+ str(so.order_line[1].visible_sequence),
103
+ self.invoice.line_ids[1].related_so_sequence,
104
+ )
@@ -0,0 +1,20 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <odoo>
3
+
4
+ <record id="view_move_form" model="ir.ui.view">
5
+ <field name="name">account.move.form</field>
6
+ <field name="model">account.move</field>
7
+ <field name="inherit_id" ref="account.view_move_form" />
8
+ <field name="arch" type="xml">
9
+ <xpath
10
+ expr="//field[@name='invoice_line_ids']/tree/field[@name='sequence']"
11
+ position="before"
12
+ >
13
+ <field
14
+ name="related_so_sequence"
15
+ attrs="{'column_invisible': [('parent.move_type', '!=', 'out_invoice')]}"
16
+ />
17
+ </xpath>
18
+ </field>
19
+ </record>
20
+ </odoo>
@@ -0,0 +1,24 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <odoo>
3
+ <template
4
+ id="report_invoice_document_inherit_sale_sequence"
5
+ inherit_id="account.report_invoice_document"
6
+ >
7
+ <!--complicated expr to be compatible with other modules-->
8
+ <xpath expr="//table/thead/tr/th[1]" position="before">
9
+ <th
10
+ t-if="(o.move_type == 'out_invoice' or o.move_type == 'out_refund') and any(l.related_so_sequence for l in o.invoice_line_ids)"
11
+ >
12
+ Line Number
13
+ </th>
14
+ </xpath>
15
+ <!--complicated expr to be compatible with other modules-->
16
+ <xpath expr="//table/tbody//span[1]/.." position="before">
17
+ <td
18
+ t-if="(o.move_type == 'out_invoice' or o.move_type == 'out_refund') and line.related_so_sequence"
19
+ >
20
+ <span t-field="line.related_so_sequence" />
21
+ </td>
22
+ </xpath>
23
+ </template>
24
+ </odoo>
@@ -9,7 +9,7 @@
9
9
  position="before"
10
10
  >
11
11
  <th>
12
- <strong>Sequence</strong>
12
+ <strong>Line Number</strong>
13
13
  </th>
14
14
  </xpath>
15
15
  <xpath
@@ -17,7 +17,7 @@
17
17
  position="before"
18
18
  >
19
19
  <td>
20
- <span t-field="line.sequence2" />
20
+ <span t-field="line.visible_sequence" />
21
21
  </td>
22
22
  </xpath>
23
23
  </template>
@@ -17,7 +17,7 @@
17
17
  expr="//field[@name='order_line']/tree/field[@name='product_id']"
18
18
  position="before"
19
19
  >
20
- <field name="sequence2" />
20
+ <field name="visible_sequence" />
21
21
  </xpath>
22
22
  </field>
23
23
  </record>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: odoo-addon-sale-order-line-sequence
3
- Version: 15.0.1.0.0.7
3
+ Version: 15.0.2.0.0.2
4
4
  Summary: Propagates SO line sequence to invoices and stock picking.
5
5
  Home-page: https://github.com/OCA/sale-workflow
6
6
  Author: ForgeFlow, Serpent CS, Odoo Community Association (OCA)
@@ -23,7 +23,7 @@ Sale Order Line Sequence
23
23
  !! This file is generated by oca-gen-addon-readme !!
24
24
  !! changes will be overwritten. !!
25
25
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
26
- !! source digest: sha256:ebec3c262a51e2c6dbd1aaf2ea532cebbb4f4ff23b93c83b39f080f9e6c8c203
26
+ !! source digest: sha256:3e6b14e52a5ea56c930b7d7d9743a54db9ac35f86f8d1bce89181f74c332b15c
27
27
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
28
28
 
29
29
  .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -0,0 +1,46 @@
1
+ odoo/addons/sale_order_line_sequence/README.rst,sha256=UvmyP0JBmawQz0Dnsz33vYyz2U2wlS6e2R2qvpqorTw,3278
2
+ odoo/addons/sale_order_line_sequence/__init__.py,sha256=QXl_U5mKDJfzIWJDZpUzH9Rf4Zda8Ko8Q1Df6Lc0MF8,92
3
+ odoo/addons/sale_order_line_sequence/__manifest__.py,sha256=AeIpwIe364fFnw5vx1O9MT1kVueQqHIO4Vj4kCZHED8,701
4
+ odoo/addons/sale_order_line_sequence/i18n/ca.po,sha256=7yEPiuaRACguMgRTB9zrBBEuAvd_9JTWvcH_djNy8x0,2571
5
+ odoo/addons/sale_order_line_sequence/i18n/de.po,sha256=se9wS16jFQtVw4xyriAQXENfIso0xR9qvKT1Adw-3sw,2893
6
+ odoo/addons/sale_order_line_sequence/i18n/el_GR.po,sha256=RPU95vKiARmDdOE7N0En_9dRDUrGwzdag1aFpL9jJ7I,2570
7
+ odoo/addons/sale_order_line_sequence/i18n/es.po,sha256=tS0mwHcrQuOOub3F9OK1FeGQ-n0L_97NgEpAGS8K-0k,3043
8
+ odoo/addons/sale_order_line_sequence/i18n/es_ES.po,sha256=b4i0IX6Pm1BSQT1gZds-yLv2PrXSltf4EIZ8YpkwXHo,2559
9
+ odoo/addons/sale_order_line_sequence/i18n/es_VE.po,sha256=NBkGOBLQmH0kKdnFWiwxUZhbo0x7Y_kSCg1tQfnGuck,2589
10
+ odoo/addons/sale_order_line_sequence/i18n/fi.po,sha256=V3WNCLc3SlMGfGCW86jQoPrhQoWU1ObYXQkQzoYjxXA,2539
11
+ odoo/addons/sale_order_line_sequence/i18n/fr.po,sha256=A9GDU3gD0xtANrpCvl3HMA3icR2gwZpCQyRCye0PQJE,2565
12
+ odoo/addons/sale_order_line_sequence/i18n/hr.po,sha256=kSBbGwv_WaYUmMJB3SbideWgo2V_vUA0jXCOKZSVobQ,2937
13
+ odoo/addons/sale_order_line_sequence/i18n/hr_HR.po,sha256=fR1xMRNG_QSZ-bqeB6h6NAE-70jk644Ls7GLrHJTkRw,2636
14
+ odoo/addons/sale_order_line_sequence/i18n/hu.po,sha256=rNmNRan2tqrVfiBFdpRR-fmt02CUxNvJNBARrywRm1o,2548
15
+ odoo/addons/sale_order_line_sequence/i18n/it.po,sha256=KYAglVQPNeHgKf2GctFu8wK0n9o_iv-4OvN1AYJbqMQ,2589
16
+ odoo/addons/sale_order_line_sequence/i18n/nl.po,sha256=G1N8YhiG_nQdCbQYkhqDifCP7VimclPCtoP4zSTy36o,2537
17
+ odoo/addons/sale_order_line_sequence/i18n/nl_NL.po,sha256=hM6qAsUDBqNsRy3Zk9Jzf9NIOweW2gw3Aodyjr2kAFk,2563
18
+ odoo/addons/sale_order_line_sequence/i18n/pt.po,sha256=w3hFLbp4NZCR7Ny7F_2hJvwNpe9i6s9nXbm10-SX6Ok,2900
19
+ odoo/addons/sale_order_line_sequence/i18n/pt_BR.po,sha256=FrOWms6SPF_vaOU_XBlc1gCBYEHTsKVEj6kTXAMtajk,2583
20
+ odoo/addons/sale_order_line_sequence/i18n/ro.po,sha256=2ILiS8tMKBgFiNuEhce1ZjZj39rIIbYMV1klsx2vmxg,2612
21
+ odoo/addons/sale_order_line_sequence/i18n/sale_order_line_sequence.pot,sha256=GXuxOnjMhepdF6SvQ2mH_HBnFaCEKjoFyZIw55-N2tM,2180
22
+ odoo/addons/sale_order_line_sequence/i18n/sk.po,sha256=-mmaDxD9SvUdSV7D9qN1H8wt6fufMROlQESMcCYl78g,2572
23
+ odoo/addons/sale_order_line_sequence/i18n/sl.po,sha256=x9nT40WWyHGDW8XxUCtapJrBDHGbUR39AJAEDYIiNdU,2633
24
+ odoo/addons/sale_order_line_sequence/i18n/tr.po,sha256=Ze_jisIcHFLk9xQradgPEpD-pEVxdQ4vkpmuHigaaRg,2563
25
+ odoo/addons/sale_order_line_sequence/i18n/tr_TR.po,sha256=dyh3lbCpaQH31Se4NrdRpGYowNuE9rftB-iIRrIWMoY,2573
26
+ odoo/addons/sale_order_line_sequence/i18n/vi_VN.po,sha256=VOH7gJ99xLut-Gl5-ZhKRTSw8iiy4uF816Ax_QW51_o,2559
27
+ odoo/addons/sale_order_line_sequence/i18n/zh_CN.po,sha256=3E8-BzYIv-c9kFqeGrfiAibOt7vaViijnU6Wcma5Jy8,2831
28
+ odoo/addons/sale_order_line_sequence/models/__init__.py,sha256=VRPd35ij54tshK-q0rTvzxebdiyow6L25QcghlF1TKQ,158
29
+ odoo/addons/sale_order_line_sequence/models/account_move_line.py,sha256=o2NdsXBlHVnpSsXkLd3FM82i0T3WNI-N-WoT78NTCxE,820
30
+ odoo/addons/sale_order_line_sequence/models/sale_order.py,sha256=B8VS4-qU1gPXjjoKBBgC7KwpwXXFLKYQNrN6EFdtSog,914
31
+ odoo/addons/sale_order_line_sequence/models/sale_order_line.py,sha256=kq3wGXiVaRYydtEzes3gEQtpQBomYVsG48mjQLVIcpk,1048
32
+ odoo/addons/sale_order_line_sequence/readme/CONTRIBUTORS.rst,sha256=4XoJJwCrfktuJDG8CWmr8FU1FB5ZfUZumuVHHhdnOaM,158
33
+ odoo/addons/sale_order_line_sequence/readme/CREDITS.rst,sha256=jMwRaerf5d-Tt1o4OJyzZVhHmYPGzeQI2M9OliI5bn8,152
34
+ odoo/addons/sale_order_line_sequence/readme/DESCRIPTION.rst,sha256=-JBPSfPiYUEDM7SHNAjRz_TkGDiRk6WzqWHRfGL0Yt8,140
35
+ odoo/addons/sale_order_line_sequence/static/description/icon.png,sha256=6xBPJauaFOF0KDHfHgQopSc28kKvxMaeoQFQWZtfZDo,9455
36
+ odoo/addons/sale_order_line_sequence/static/description/index.html,sha256=tOsu_vFrrxspkBpEUsABmJh4iHW1wTFsglOZ-dYK75c,13172
37
+ odoo/addons/sale_order_line_sequence/tests/__init__.py,sha256=nrrUFWs1sNdScz5WKYeeT3b75RGu9EYowrBNnl9z1X0,44
38
+ odoo/addons/sale_order_line_sequence/tests/test_sale_order_line_sequence.py,sha256=K5Y-XBfPRpGLodM9sopmP8E72aC1PXQEaLnJRH22VpY,3592
39
+ odoo/addons/sale_order_line_sequence/views/account_move_view.xml,sha256=uHmBrVCJ631vtGAzsM_q0PWZG6tpkGYnjCK48F8mM0o,698
40
+ odoo/addons/sale_order_line_sequence/views/report_invoice.xml,sha256=PQf7Lo9jAQCVRlE658Zs_s6QO8lyPBJiI_R6yvPzrNg,948
41
+ odoo/addons/sale_order_line_sequence/views/report_saleorder.xml,sha256=JVvnNxK871yr0fbD-CwRIu4863wVsC1_CFRkByP2yRY,663
42
+ odoo/addons/sale_order_line_sequence/views/sale_view.xml,sha256=ZB_hybarQxn5ctk-j1EtWFaf3LWGLaltPGh_41Cw7a0,913
43
+ odoo_addon_sale_order_line_sequence-15.0.2.0.0.2.dist-info/METADATA,sha256=wy_833W35OycKANz55QgtdszbMxWBtFZ54BACJvnKiA,3869
44
+ odoo_addon_sale_order_line_sequence-15.0.2.0.0.2.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
45
+ odoo_addon_sale_order_line_sequence-15.0.2.0.0.2.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
46
+ odoo_addon_sale_order_line_sequence-15.0.2.0.0.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.41.2)
2
+ Generator: bdist_wheel (0.42.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,15 +0,0 @@
1
- # Copyright 2017 ForgeFlow S.L.
2
- # Copyright 2017 Serpent Consulting Services Pvt. Ltd.
3
- # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
4
-
5
- from odoo import SUPERUSER_ID
6
- from odoo.api import Environment
7
-
8
-
9
- def post_init_hook(cr, pool):
10
- """
11
- Fetches all the sale order and resets the sequence of the order lines
12
- """
13
- env = Environment(cr, SUPERUSER_ID, {})
14
- sale = env["sale.order"].search([])
15
- sale._reset_sequence()
@@ -1,69 +0,0 @@
1
- # Copyright 2017 ForgeFlow S.L.
2
- # Copyright 2017 Serpent Consulting Services Pvt. Ltd.
3
- # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
4
-
5
- from odoo import api, fields, models
6
-
7
-
8
- class SaleOrder(models.Model):
9
- _inherit = "sale.order"
10
-
11
- @api.depends("order_line")
12
- def _compute_max_line_sequence(self):
13
- """Allow to know the highest sequence entered in sale order lines.
14
- Then we add 1 to this value for the next sequence.
15
- This value is given to the context of the o2m field in the view.
16
- So when we create new sale order lines, the sequence is automatically
17
- added as : max_sequence + 1
18
- """
19
- for sale in self:
20
- sale.max_line_sequence = max(sale.mapped("order_line.sequence") or [0]) + 1
21
-
22
- max_line_sequence = fields.Integer(
23
- string="Max sequence in lines", compute="_compute_max_line_sequence", store=True
24
- )
25
-
26
- def _reset_sequence(self):
27
- for rec in self:
28
- current_sequence = 1
29
- for line in sorted(rec.order_line, key=lambda x: (x.sequence, x.id)):
30
- if line.sequence != current_sequence:
31
- line.sequence = current_sequence
32
- current_sequence += 1
33
-
34
- def write(self, line_values):
35
- res = super(SaleOrder, self).write(line_values)
36
- self._reset_sequence()
37
- return res
38
-
39
- def copy(self, default=None):
40
- return super(SaleOrder, self.with_context(keep_line_sequence=True)).copy(
41
- default
42
- )
43
-
44
-
45
- class SaleOrderLine(models.Model):
46
- _inherit = "sale.order.line"
47
-
48
- # re-defines the field to change the default
49
- sequence = fields.Integer(
50
- help="Gives the sequence of this line when displaying the sale order.",
51
- default=9999,
52
- )
53
-
54
- # displays sequence on the order line
55
- sequence2 = fields.Integer(
56
- help="Shows the sequence of this line in the sale order.",
57
- related="sequence",
58
- string="Line Number",
59
- readonly=True,
60
- store=True,
61
- )
62
-
63
- @api.model
64
- def create(self, values):
65
- line = super(SaleOrderLine, self).create(values)
66
- # We do not reset the sequence if we are copying a complete sale order
67
- if self.env.context.get("keep_line_sequence"):
68
- line.order_id._reset_sequence()
69
- return line
@@ -1,43 +0,0 @@
1
- odoo/addons/sale_order_line_sequence/README.rst,sha256=Gy5EW-Y1yagFgh5ubBRnhMx325Y5OAd4hgcBPQp4Sfw,3278
2
- odoo/addons/sale_order_line_sequence/__init__.py,sha256=Gaf8H2DUFCZL9VNUP_AgTYtaGu6f7N5gqYPYB0vQC_8,130
3
- odoo/addons/sale_order_line_sequence/__manifest__.py,sha256=IaJIlpH478rY7Lp-M4WDqsoGvrti775jCMD5fXn24RM,643
4
- odoo/addons/sale_order_line_sequence/init_hooks.py,sha256=5f7ljGwDNIlbn-AiD-hgGENSZBC08rIyiZSR8H__RQY,454
5
- odoo/addons/sale_order_line_sequence/i18n/ca.po,sha256=jzDwGZOCbL1jqtcNhS0gNyI11dbCga9sZR2OxBw1oKI,2124
6
- odoo/addons/sale_order_line_sequence/i18n/de.po,sha256=s2TZJn1R5sPCUW7QAYphgBCcB0ZjieNxsgvJySe4s8A,2319
7
- odoo/addons/sale_order_line_sequence/i18n/el_GR.po,sha256=WfMCyZK5X-H5MZXJ4FXPK3MGlVtEmEJ8NXAYROV9VgE,2123
8
- odoo/addons/sale_order_line_sequence/i18n/es.po,sha256=5u6EwJ-6IGdcdW2VC-hvbE7TVxjkVegVrOjYaXoRIE4,2340
9
- odoo/addons/sale_order_line_sequence/i18n/es_ES.po,sha256=pvDU_9RZ7VaaZrF688DbQnJ-KPz0U0Qd4MA973dug4E,2112
10
- odoo/addons/sale_order_line_sequence/i18n/es_VE.po,sha256=E-xYWLoCghgiykqm2h5GcFUGcXBCjdTDOshjQ-Q2V00,2142
11
- odoo/addons/sale_order_line_sequence/i18n/fi.po,sha256=yM-F2ScP5RlK0F4RGKy3eU9SfAM_70s0WvRpbqut0-4,2092
12
- odoo/addons/sale_order_line_sequence/i18n/fr.po,sha256=NFyo1FFtbJBw-JOAZeq1Pg8ujCQcCLJE89Heivrxvlc,2118
13
- odoo/addons/sale_order_line_sequence/i18n/hr.po,sha256=WyfCKJmCFYGkoDGKyV6S0D-bTNFmohoG86gDAfNHHdg,2363
14
- odoo/addons/sale_order_line_sequence/i18n/hr_HR.po,sha256=9z-3Xmyh1N6Ql-OpMV45b82e5R66N5Zb_Yhhf5nKAWs,2189
15
- odoo/addons/sale_order_line_sequence/i18n/hu.po,sha256=l8ao5BDxiyZEHRK6h8KHrL0avybzqeLMWOZwGE2D8iY,2101
16
- odoo/addons/sale_order_line_sequence/i18n/it.po,sha256=6AuFO5G5Trdh1O4q5Ja5WOxxPDPzr3fHHe43azFure8,2142
17
- odoo/addons/sale_order_line_sequence/i18n/nl.po,sha256=gLNS2ehDV2OnzPxdYAvNGx_ttOx2IcWgidZdlxxiXXM,2090
18
- odoo/addons/sale_order_line_sequence/i18n/nl_NL.po,sha256=gdty7aLmFEWiY71hCSq0f3SX0gmI8NZrAjATgBwvBIM,2116
19
- odoo/addons/sale_order_line_sequence/i18n/pt.po,sha256=EBA9h9w9kYeR4CYfTTYkeoKB_Eioqdpje9C2-_v5GZE,2326
20
- odoo/addons/sale_order_line_sequence/i18n/pt_BR.po,sha256=zO0BS8XeUYLhgVhnYNeIs1gkNmBxbUcTQSphL2eqpds,2136
21
- odoo/addons/sale_order_line_sequence/i18n/ro.po,sha256=BCWULDgORSpCrT7WONi70yywYtfOzOKU2UR1MEAYmYc,2165
22
- odoo/addons/sale_order_line_sequence/i18n/sale_order_line_sequence.pot,sha256=PvzJrPAv-RIcX4FeYzpXCOEqn2WshrqzZHTmv5R6u2k,1733
23
- odoo/addons/sale_order_line_sequence/i18n/sk.po,sha256=MQjc_5GkRld5PFmD72NK4yUAAe529Z6JD2ISbzRL4Cg,2125
24
- odoo/addons/sale_order_line_sequence/i18n/sl.po,sha256=aUxxlnfbvjHkxebNCnd87TdDezEYOmzE4BOYsgVIws0,2186
25
- odoo/addons/sale_order_line_sequence/i18n/tr.po,sha256=L0T7f3ixKKwW8ztncIQx3scWAGPOQEmR0yZsxsK7AP0,2116
26
- odoo/addons/sale_order_line_sequence/i18n/tr_TR.po,sha256=TUf6VpnedKKC4SnSwGxlUn1-uPEIIjH9LXZWD6rPRo4,2126
27
- odoo/addons/sale_order_line_sequence/i18n/vi_VN.po,sha256=YH1IopIMf22tlT6wn2QdJAoyibz__e_0_LuulNcpefg,2112
28
- odoo/addons/sale_order_line_sequence/i18n/zh_CN.po,sha256=KSVYnI95zv64atiAqclVGw-6rSLREJRgrSUgQtwDm34,2257
29
- odoo/addons/sale_order_line_sequence/model/__init__.py,sha256=YgFCLxAyGFfA3PKn4KZtU3zOZWBz1OLwu5mFavtrSVY,96
30
- odoo/addons/sale_order_line_sequence/model/sale_order.py,sha256=NTf75E2pg4XcCd8WjrQgVzZHUe5CjuYUqQVZiR1MGJw,2328
31
- odoo/addons/sale_order_line_sequence/readme/CONTRIBUTORS.rst,sha256=4XoJJwCrfktuJDG8CWmr8FU1FB5ZfUZumuVHHhdnOaM,158
32
- odoo/addons/sale_order_line_sequence/readme/CREDITS.rst,sha256=jMwRaerf5d-Tt1o4OJyzZVhHmYPGzeQI2M9OliI5bn8,152
33
- odoo/addons/sale_order_line_sequence/readme/DESCRIPTION.rst,sha256=-JBPSfPiYUEDM7SHNAjRz_TkGDiRk6WzqWHRfGL0Yt8,140
34
- odoo/addons/sale_order_line_sequence/static/description/icon.png,sha256=6xBPJauaFOF0KDHfHgQopSc28kKvxMaeoQFQWZtfZDo,9455
35
- odoo/addons/sale_order_line_sequence/static/description/index.html,sha256=AcRxLsdpK01du8PPKJMwfnIsOYssIApyhL_r1sb778I,13172
36
- odoo/addons/sale_order_line_sequence/tests/__init__.py,sha256=nrrUFWs1sNdScz5WKYeeT3b75RGu9EYowrBNnl9z1X0,44
37
- odoo/addons/sale_order_line_sequence/tests/test_sale_order_line_sequence.py,sha256=gh7OYFBjBsDrXVPkREzy3CcRowkrAEW2_N4xEx_qoFc,1238
38
- odoo/addons/sale_order_line_sequence/views/report_saleorder.xml,sha256=-WeV3laF7rGEYAI0akG80XFqMnGzY-vagKIN5Yy0mdk,653
39
- odoo/addons/sale_order_line_sequence/views/sale_view.xml,sha256=ecCSkSIbWAq-tYThC23NeEmBjjNaMI24IWtcT4gJ7ms,906
40
- odoo_addon_sale_order_line_sequence-15.0.1.0.0.7.dist-info/METADATA,sha256=6PV4rvtd8jQgHtjOAc_WI8K3NBbsXp0-gX-NAbKnndg,3869
41
- odoo_addon_sale_order_line_sequence-15.0.1.0.0.7.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
42
- odoo_addon_sale_order_line_sequence-15.0.1.0.0.7.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
43
- odoo_addon_sale_order_line_sequence-15.0.1.0.0.7.dist-info/RECORD,,