Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][MIG] sale_elaboration: Migration to 17.0 #3274

Open
wants to merge 76 commits into
base: 17.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
d94176d
[11.0][ADD] sale_elaboration: New module
sergio-teruel Oct 15, 2018
a89bc6d
[11.0][ADD] sale_elaboration: Display elaboration code in picking
sergio-teruel Oct 22, 2018
8f1c5ba
[11.0][ADD] sale_elaboration: Display salesman in line views
sergio-teruel Oct 29, 2018
f512b40
[11.0][FIX] sale_elaboration: Get first elaboration product
sergio-teruel Feb 1, 2019
c57e615
[11.0][IMP] sale_elaboration: Add to invoice line the sale order refe…
sergio-teruel Feb 19, 2019
8fee4a6
[IMP] sale_elaboration: Some improvements
pedrobaeza Feb 28, 2019
5e97360
[11.0][ADD] sale_elaboration: Add is_elaboration in product template
sergio-teruel Mar 26, 2019
e6365e5
[IMP] sale_elaboration: Ensure test correctness + hide is_elaboration…
pedrobaeza Mar 27, 2019
be14669
[11.0][FIX] sale_elaboration should't be auto installed
jjscarafia Apr 11, 2019
3c1edbd
Added translation using Weblate (German)
marylla Jul 15, 2019
2f95634
[IMP] sale_elaboration: Reset "is_elaboration" in order line when use…
sergio-teruel Jul 19, 2019
0f5d8db
[IMP] sale_elaboration: Set is_elaboration in product tests
carlosdauden Jul 22, 2019
3d2cbaf
[FIX] sale_elaboration: Apply force_save for field is_elaboration in …
sergio-teruel Oct 4, 2019
58f5b7e
[MIG] sale_elaboration: Migration to v12.0
sergio-teruel Nov 27, 2019
116c933
[IMP] sale_elaboration: black, isort
sergio-teruel Jan 22, 2020
26c2af0
[MIG] sale_elaboration: Migration to v13.0
sergio-teruel Jan 24, 2020
882b308
[IMP] sale_elaboration: Add menu entry to sale elaboration report at …
CarlosRoca13 Apr 27, 2022
e9041f3
[MIG] sale_elaboration: Migration to 14.0
CarlosRoca13 Sep 28, 2022
b5ba335
[MIG] sale_elaboration: Migration to v15
CarlosRoca13 Oct 24, 2022
abf629f
[IMP] sale_elaboration: Improve elaboration tree view
sergio-teruel Oct 21, 2022
12d4969
[FIX] sale_elaboration: Fix delivery slip report. Add config setting …
sergio-teruel Oct 23, 2022
b5d9cdb
[IMP] sale_elaboration: Add pre-init hooks to quickly install
sergio-teruel Dec 22, 2022
5f74f99
[IMP] sale_elaboration: Allow to select multiple elaborations
Feb 2, 2023
643c3df
[IMP] sale_elaboration: Improve form view and kanban view on sale ord…
sergio-teruel Mar 6, 2023
98dfb30
[IMP] sale_elaboration: Allow to determine a stock.location.route for…
sergio-teruel Mar 6, 2023
342a553
[IMP] sale_elaboration: Improve kanban views
sergio-teruel Mar 9, 2023
7fc1d0f
[IMP] sale_elaboration: Add elaboration mixin and add feature in pick…
sergio-teruel Mar 21, 2023
5cf10e7
[IMP] sale_elaboration: Add elaboration profiles
sergio-teruel Apr 2, 2023
b471e7e
[IMP] sale_elaboration: Allow multi edit in elaborations
sergio-teruel Apr 17, 2023
b10b33b
[IMP] sale_elaboration: Compute sale elaboration price in sale order …
sergio-teruel Apr 24, 2023
55e1e38
[FIX] sale_elaboration: Merge moves with distinct elaboration
sergio-teruel May 30, 2023
2834441
[MIG] sale_elaboration: Migration to 16.0
Jun 1, 2023
1bafed6
[UPD] Update sale_elaboration.pot
Jun 5, 2023
fd28eb2
[UPD] README.rst
OCA-git-bot Jun 5, 2023
b574e1e
Update translation files
weblate Jun 5, 2023
288e39d
Translated using Weblate (Spanish)
Ivorra78 Jul 25, 2023
22f9706
[UPD] README.rst
OCA-git-bot Sep 3, 2023
94bdfce
Added translation using Weblate (Italian)
mymage Dec 1, 2023
ffdd9aa
[IMP] sale_elaboration: optional subtree fields
yajo Dec 13, 2023
cc43ec6
[BOT] post-merge updates
OCA-git-bot Dec 13, 2023
7ab005b
Translated using Weblate (Italian)
mymage Dec 20, 2023
71cc375
[FIX] sale_elaboration: Do not print Elaboration on incoming pickings
Shide Mar 11, 2024
769c364
[BOT] post-merge updates
OCA-git-bot Mar 11, 2024
be5a0d1
[FIX] sale_elaboration: propagate note-only lines to stock moves
yajo Mar 20, 2024
d2c1201
[BOT] post-merge updates
OCA-git-bot Mar 25, 2024
82fe7e6
[IMP] sale_elaboration: remove elaboration column from delivery slip
yajo Apr 11, 2024
85ccb32
[IMP] sale_elaboration: display elaboration notes in picking operatio…
yajo Apr 11, 2024
217a32c
[UPD] Update sale_elaboration.pot
Apr 12, 2024
94f5935
[BOT] post-merge updates
OCA-git-bot Apr 12, 2024
970e41b
Update translation files
weblate Apr 12, 2024
14f465c
[UPD] Update sale_elaboration.pot
Apr 12, 2024
6bfe6d3
[BOT] post-merge updates
OCA-git-bot Apr 12, 2024
5a3c598
Update translation files
weblate Apr 12, 2024
a790338
Translated using Weblate (Italian)
mymage Apr 15, 2024
adb0fa0
[IMP] sale_elaboration: Add elaborations and elaboration note in move…
EmilioPascual Apr 18, 2024
d1db18a
[IMP] sale_elaboration: Add icon fa-comment to reports
EmilioPascual Apr 18, 2024
cfbeb25
[UPD] Update sale_elaboration.pot
Apr 18, 2024
0906c84
[BOT] post-merge updates
OCA-git-bot Apr 18, 2024
755c248
Update translation files
weblate Apr 18, 2024
01896c7
Translated using Weblate (Spanish)
Gelojr Apr 23, 2024
d13c10e
[FIX] sale_elaboration: use parent.state in domain
yajo May 14, 2024
3536150
[BOT] post-merge updates
OCA-git-bot May 15, 2024
3362cb5
[FIX] sale_elaboration: compatible with delivery (don't compute notes)
yajo Jun 3, 2024
d199bf7
[BOT] post-merge updates
OCA-git-bot Jun 4, 2024
8c6ac86
Translated using Weblate (Italian)
mymage Jun 4, 2024
d6337eb
[FIX] sale_elaboration: Fix report call
Shide Jun 5, 2024
8a94bf6
[BOT] post-merge updates
OCA-git-bot Jun 5, 2024
267bb8c
[IMP] sale_elaboration: Add delivery date to the elaborations report
pilarvargas-tecnativa Jun 13, 2024
788a747
[IMP] sale_elaboration: Add field to filter elaborated lines
CarlosRoca13 Nov 29, 2023
16edcb5
[BOT] post-merge updates
OCA-git-bot Jun 14, 2024
3a0f206
[UPD] Update sale_elaboration.pot
Jun 14, 2024
c670c4a
[BOT] post-merge updates
OCA-git-bot Jun 14, 2024
dee58c6
Update translation files
weblate Jun 14, 2024
18b1e5e
Translated using Weblate (Italian)
mymage Jun 14, 2024
d60116e
[IMP] sale_elaboration: pre-commit auto fixes
peluko00 Aug 19, 2024
52fec70
[MIG] sale_elaboration: Migration to 17.0
peluko00 Aug 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions sale_elaboration/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ Contributors

- Eduardo de Miguel (`Moduon <https://www.moduon.team/>`__)
- Jairo Llopis (`Moduon <https://www.moduon.team/>`__)
- `APSL-Nagarro <https://apsl.tech>`__:

- Antoni Marroig <[email protected]>

Maintainers
-----------
Expand Down
3 changes: 2 additions & 1 deletion sale_elaboration/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "Sale Elaboration",
"summary": "Set an elaboration for any sale line",
"version": "16.0.1.7.0",
"version": "17.0.1.0.0",
"development_status": "Production/Stable",
"category": "Sale",
"website": "https://github.com/OCA/sale-workflow",
Expand All @@ -23,6 +23,7 @@
"views/sale_elaboration_report_views.xml",
"views/stock_move_line_views.xml",
"views/stock_picking_views.xml",
"views/stock_move_views.xml",
"reports/report_base.xml",
"reports/report_deliveryslip.xml",
"reports/report_picking_operations.xml",
Expand Down
6 changes: 3 additions & 3 deletions sale_elaboration/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).


def pre_init_hook(cr):
def pre_init_hook(env):
rousseldenis marked this conversation as resolved.
Show resolved Hide resolved
"""Create computed columns if not exists when the module is instelled"""
cr.execute(
env.cr.execute(
"""
ALTER TABLE sale_order_line
ADD COLUMN IF NOT EXISTS is_elaboration BOOLEAN;
"""
)
cr.execute(
env.cr.execute(
"""
ALTER TABLE sale_order_line ADD COLUMN IF NOT EXISTS elaboration_note VARCHAR;
"""
Expand Down
3 changes: 1 addition & 2 deletions sale_elaboration/models/product_elaboration.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class Elaboration(models.Model):
string="Routes",
domain=[("sale_selectable", "=", True)],
ondelete="restrict",
check_company=True,
)
profile_ids = fields.Many2many(
comodel_name="product.elaboration.profile",
Expand All @@ -52,4 +51,4 @@ def name_search(self, name, args=None, operator="ilike", limit=100):
recs = self.search([("code", "=ilike", name)] + args, limit=limit)
if not recs:
recs = self.search([("name", operator, name)] + args, limit=limit)
return recs.name_get()
return [(record.id, record.display_name) for record in recs.sudo()]
2 changes: 1 addition & 1 deletion sale_elaboration/models/stock_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ def _action_done(self):
)
for line in elaboration_lines:
for product in line.sale_line_id.elaboration_ids.product_id:
pick.sale_id._create_elaboration_line(product, line.quantity_done)
pick.sale_id._create_elaboration_line(product, line.product_uom_qty)
return res
2 changes: 2 additions & 0 deletions sale_elaboration/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
- Ernesto Tejeda
- Eduardo de Miguel ([Moduon](https://www.moduon.team/))
- Jairo Llopis ([Moduon](https://www.moduon.team/))
- [APSL-Nagarro](https://apsl.tech):
- Antoni Marroig \<<[email protected]>\>
4 changes: 4 additions & 0 deletions sale_elaboration/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,10 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
</li>
<li>Eduardo de Miguel (<a class="reference external" href="https://www.moduon.team/">Moduon</a>)</li>
<li>Jairo Llopis (<a class="reference external" href="https://www.moduon.team/">Moduon</a>)</li>
<li><a class="reference external" href="https://apsl.tech">APSL-Nagarro</a>:<ul>
<li>Antoni Marroig &lt;<a class="reference external" href="mailto:amarroig&#64;apsl.net">amarroig&#64;apsl.net</a>&gt;</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down
8 changes: 4 additions & 4 deletions sale_elaboration/tests/test_sale_elaboration.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def test_sale_elaboration_doesnt_change(self):

def test_sale_elaboration(self):
self.order.action_confirm()
self.order.picking_ids.move_ids.quantity_done = 10.0
self.order.picking_ids.move_ids.product_uom_qty = 10.0
self.order.picking_ids._action_done()
elaboration_lines = self.order.order_line.filtered("is_elaboration")
self.assertEqual(len(elaboration_lines), 1)
Expand All @@ -110,7 +110,7 @@ def test_sale_elaboration_multi(self):
}
)
self.order.action_confirm()
self.order.picking_ids.move_ids.quantity_done = 10.0
self.order.picking_ids.move_ids.product_uom_qty = 10.0
self.order.picking_ids._action_done()
elaboration_lines = self.order.order_line.filtered("is_elaboration")
self.assertEqual(len(elaboration_lines), 1)
Expand Down Expand Up @@ -162,9 +162,9 @@ def test_multi_elaboration_per_line(self):
self.order.action_confirm()
move_ids = self.order.picking_ids.move_ids
move_line_a = move_ids.filtered(lambda r: r.product_id == self.product)
move_line_a.quantity_done = 10.0
move_line_a.product_uom_qty = 10.0
move_line_b = move_ids.filtered(lambda r: r.product_id == product2)
move_line_b.quantity_done = 1.0
move_line_b.product_uom_qty = 1.0
self.order.picking_ids._action_done()
elaboration_lines = self.order.order_line.filtered("is_elaboration")
self.assertEqual(len(elaboration_lines), 2)
Expand Down
7 changes: 2 additions & 5 deletions sale_elaboration/views/product_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
<field name="inherit_id" ref="product.product_template_only_form_view" />
<field name="arch" type="xml">
<field name='default_code' position="after">
<field
name="is_elaboration"
attrs="{'invisible': [('type', '!=', 'service')]}"
/>
<field name="is_elaboration" invisible="type != 'service'" />
</field>
</field>
</record>
Expand All @@ -23,7 +20,7 @@
<group name="elboration" string="Elaborations">
<field
name="elaboration_profile_id"
attrs="{'invisible':[('product_variant_count', '&gt;', 1), ('is_product_variant', '=', False)]}"
invisible="product_variant_count > 1 and not is_product_variant"
/>
</group>
</xpath>
Expand Down
32 changes: 9 additions & 23 deletions sale_elaboration/views/res_config_settings_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,21 @@
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="stock.res_config_settings_view_form" />
<field name="arch" type="xml">
<xpath expr="//div[@id='group_lot_on_delivery_slip']" position="after">
<div
class="col-12 col-lg-6 o_setting_box"
<xpath expr="//setting[@id='group_lot_on_delivery_slip']" position="after">
<setting
help="Elaboration notes will appear on the delivery slip"
id="group_elaboration_note_on_delivery_slip"
>
<div class="o_setting_left_pane">
<field name="group_elaboration_note_on_delivery_slip" />
</div>
<div class="o_setting_right_pane">
<label for="group_elaboration_note_on_delivery_slip" />
<div class="text-muted">
Elaboration notes will appear on the delivery slip
</div>
</div>
</div>
<div
class="col-12 col-lg-6 o_setting_box"
</setting>
<setting
help="Elaboration notes will appear on the picking operations report"
id="group_elaboration_note_on_picking_operations"
>
<div class="o_setting_left_pane">
<field name="group_elaboration_note_on_picking_operations" />
</div>
<div class="o_setting_right_pane">
<label for="group_elaboration_note_on_picking_operations" />
<div class="text-muted">
Elaboration notes will appear on the picking operations report
</div>
</div>
</div>
<field name="group_elaboration_note_on_picking_operations" />
<label for="group_elaboration_note_on_picking_operations" />
</setting>
</xpath>
</field>
</record>
Expand Down
2 changes: 1 addition & 1 deletion sale_elaboration/views/sale_elaboration_profile_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
name="web_ribbon"
title="Archived"
bg_color="bg-danger"
attrs="{'invisible': [('active', '=', True)]}"
invisible="active"
/>
<field name="active" invisible="1" />
<group>
Expand Down
2 changes: 1 addition & 1 deletion sale_elaboration/views/sale_elaboration_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
name="web_ribbon"
title="Archived"
bg_color="bg-danger"
attrs="{'invisible': [('active', '=', True)]}"
invisible="active"
/>
<field name="active" invisible="1" />
<group>
Expand Down
12 changes: 6 additions & 6 deletions sale_elaboration/views/sale_order_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,36 @@
<field
name="elaboration_ids"
widget="many2many_tags"
attrs="{'readonly': ['|', ('product_updatable', '=', False), ('parent.state', 'in', ('done', 'cancel'))]}"
readonly="not product_updatable or parent.state in ['done', 'cancel']"
domain="elaboration_profile_id and [('profile_ids', 'in', [elaboration_profile_id])] or []"
/>
<field
name="elaboration_note"
attrs="{'readonly': ['|', ('product_updatable', '=', False), ('parent.state', 'in', ('done', 'cancel'))]}"
readonly="not product_updatable or parent.state in ['done', 'cancel']"
/>
<field
name="elaboration_price_unit"
readonly="1"
widget="monetary"
attrs="{'invisible': [('elaboration_ids', '=', [])]}"
invisible="not elaboration_ids"
/>
</group>
</xpath>
<xpath
expr="//field[@name='order_line']/tree//field[@name='price_unit']"
position="after"
>
<field name="elaboration_profile_id" invisible="1" />
<field name="elaboration_profile_id" column_invisible="1" />
<field
name="elaboration_ids"
widget="many2many_tags"
attrs="{'readonly': ['|', ('product_updatable', '=', False), ('parent.state', 'in', ('done', 'cancel'))]}"
readonly="not product_updatable or parent.state in ['done', 'cancel']"
domain="elaboration_profile_id and [('profile_ids', 'in', [elaboration_profile_id])] or []"
optional="show"
/>
<field
name="elaboration_note"
attrs="{'readonly': ['|', ('product_updatable', '=', False), ('parent.state', 'in', ('done', 'cancel'))]}"
readonly="not product_updatable or parent.state in ['done', 'cancel']"
optional="show"
/>
<field
Expand Down
25 changes: 25 additions & 0 deletions sale_elaboration/views/stock_move_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2023 Tecnativa - Sergio Teruel
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
<record id="view_stock_move_operations_sale_operation" model="ir.ui.view">
<field name="name">stock.move.operation.sale</field>
<field name="model">stock.move</field>
<field name="inherit_id" ref="stock.view_stock_move_operations" />
<field name="arch" type="xml">
<xpath expr="//field[@name='product_id']" position="after">
<field name="is_initial_demand_editable" invisible="1" readonly="1" />
<field
name="elaboration_ids"
widget="many2many_tags"
options="{'no_create': True}"
readonly="not is_initial_demand_editable"
/>
<field
name="elaboration_note"
readonly="not is_initial_demand_editable"
/>
</xpath>
</field>
</record>
</odoo>
20 changes: 3 additions & 17 deletions sale_elaboration/views/stock_picking_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,20 @@
expr="//field[@name='move_ids_without_package']/tree/field[@name='product_uom']"
position="after"
>
<field name="show_operations" invisible="1" readonly="1" />
<field
name="elaboration_ids"
widget="many2many_tags"
options="{'no_create': True}"
attrs="{'column_invisible': [('parent.immediate_transfer', '=', True)], 'readonly': ['|', ('is_initial_demand_editable', '=', False), '&amp;', '&amp;', ('show_operations', '=', True), ('is_locked', '=', True), ('is_initial_demand_editable', '=', False)]}"
readonly="not is_initial_demand_editable or show_operations and is_locked and not is_initial_demand_editable"
optional="show"
/>
<field
name="elaboration_note"
attrs="{'column_invisible': [('parent.immediate_transfer', '=', True)], 'readonly': ['|', ('is_initial_demand_editable', '=', False), '&amp;', '&amp;', ('show_operations', '=', True), ('is_locked', '=', True), ('is_initial_demand_editable', '=', False)]}"
readonly="not is_initial_demand_editable or show_operations and is_locked and not is_initial_demand_editable"
optional="show"
/>
</xpath>
<xpath
expr="//field[@name='move_ids_without_package']/form//field[@name='product_uom']"
position="after"
>
<field
name="elaboration_ids"
widget="many2many_tags"
options="{'no_create': True}"
attrs="{'invisible': [('parent.immediate_transfer', '=', True)], 'readonly': [('is_initial_demand_editable', '=', False)]}"
/>
<field
name="elaboration_note"
attrs="{'invisible': [('parent.immediate_transfer', '=', True)], 'readonly': [('is_initial_demand_editable', '=', False)]}"
/>
</xpath>
</field>
</record>
</odoo>
Loading