Skip to content

Commit f21694c

Browse files
[IMP] add categories in views
Add categories in SO an pickings views to make comparison with the printed picking operations easier
1 parent a50a63d commit f21694c

File tree

7 files changed

+67
-11
lines changed

7 files changed

+67
-11
lines changed

foodhub_picking/__manifest__.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# SPDX-FileCopyrightText: 2024 Coop IT Easy SC
2-
#
3-
# SPDX-License-Identifier: AGPL-3.0-or-later
4-
51
{
62
"name": "Foodhub Picking Operations",
73
"version": "16.0.1.0.0",
@@ -13,6 +9,11 @@
139
"category": "Stock",
1410
"depends": [
1511
"stock",
12+
"sale_management"
13+
],
14+
"data": [
15+
"reports/report_picking.xml",
16+
"views/stock_picking_views.xml",
17+
"views/sale_order_line_views.xml"
1618
],
17-
"data": ["reports/report_picking.xml"],
1819
}

foodhub_picking/models/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# SPDX-FileCopyrightText: 2024 Coop IT Easy SC
2-
#
3-
# SPDX-License-Identifier: AGPL-3.0-or-later
4-
51
from . import stock_move_line
2+
from . import stock_move
3+
from . import sale_order_line
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# -*- coding: utf-8 -*-
2+
import logging
3+
4+
from odoo import models, fields, api, _
5+
from odoo.exceptions import UserError, ValidationError
6+
7+
_logger = logging.getLogger(__name__)
8+
9+
10+
class SaleOrderLine(models.Model):
11+
_inherit = 'sale.order.line'
12+
13+
product_category_name = fields.Char(related="product_id.categ_id.complete_name", store=True, string="Product Category")

foodhub_picking/models/stock_move.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# -*- coding: utf-8 -*-
2+
import logging
3+
4+
from odoo import models, fields, api, _
5+
from odoo.exceptions import UserError, ValidationError
6+
7+
_logger = logging.getLogger(__name__)
8+
9+
10+
class StockMove(models.Model):
11+
_inherit = 'stock.move'
12+
13+
product_category_name = fields.Char(related="product_id.categ_id.complete_name", store=True, string="Product Category")
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
- Sort picking operations by internal category and internal reference.
2-
31
Context : Increase the efficiency of picking by sorting products by location and priority. We cannot use "locations" because some products are of type Consumable and should stay this way : these are products that are received and sent on the same date, we don't want to manage stock on these products.
42
So instead we sort by internal categories and by reference.
53

4+
- Sort picking operations by internal category and internal reference.
65
- Put the name of the SO in title, rather than the picking reference. Because this picking will be sent to the client, who only knows the reference of the SO. In principle this document should not be sent to the client, but here it's easier to only rely on one document.
6+
- Add categories in SO an pickings views to make comparison with the printed picking operations easier
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<odoo>
3+
4+
<record id="view_sale_order_line_form" model="ir.ui.view">
5+
<field name="name">view.sale_order_line.form</field>
6+
<field name="model">sale.order</field>
7+
<field name="inherit_id" ref="sale.view_order_form" />
8+
<field name="arch" type="xml">
9+
<xpath expr="//tree/field[@name='product_id']" position="after">
10+
<field name="product_category_name" optional="hide" />
11+
</xpath>
12+
</field>
13+
</record>
14+
15+
</odoo>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<odoo>
3+
4+
<record id="view_stock_picking_form" model="ir.ui.view">
5+
<field name="name">view.stock.picking.form</field>
6+
<field name="model">stock.picking</field>
7+
<field name="inherit_id" ref="stock.view_picking_form"/>
8+
<field name="arch" type="xml">
9+
<field name="display_assign_serial" position="after">
10+
<field name="product_category_name" />
11+
</field>
12+
13+
</field>
14+
</record>
15+
16+
</odoo>

0 commit comments

Comments
 (0)