Skip to content

Commit c74385e

Browse files
updates
1 parent f7def6a commit c74385e

File tree

294 files changed

+649822
-73
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

294 files changed

+649822
-73
lines changed

addons/stock/.DS_Store

8 KB
Binary file not shown.

addons/stock/__init__.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# -*- coding: utf-8 -*-
2+
# Part of Odoo. See LICENSE file for full copyright and licensing details.
3+
4+
from . import controllers
5+
from . import models
6+
from . import report
7+
from . import wizard
8+
9+
10+
# TODO: Apply proper fix & remove in master
11+
def pre_init_hook(env):
12+
env['ir.model.data'].search([
13+
('model', 'like', 'stock'),
14+
('module', '=', 'stock')
15+
]).unlink()
16+
17+
def _assign_default_mail_template_picking_id(env):
18+
company_ids_without_default_mail_template_id = env['res.company'].search([
19+
('stock_mail_confirmation_template_id', '=', False)
20+
])
21+
default_mail_template_id = env.ref('stock.mail_template_data_delivery_confirmation', raise_if_not_found=False)
22+
if default_mail_template_id:
23+
company_ids_without_default_mail_template_id.write({
24+
'stock_mail_confirmation_template_id': default_mail_template_id.id,
25+
})
26+
27+
def uninstall_hook(env):
28+
picking_type_ids = env["stock.picking.type"].with_context({"active_test": False}).search([])
29+
picking_type_ids.sequence_id.unlink()

addons/stock/__manifest__.py

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
# -*- coding: utf-8 -*-
2+
# Part of Odoo. See LICENSE file for full copyright and licensing details.
3+
4+
{
5+
'name': 'Inventory',
6+
'version': '1.1',
7+
'summary': 'Manage your stock and logistics activities',
8+
'website': 'https://www.odoo.com/app/inventory',
9+
'depends': ['product', 'barcodes_gs1_nomenclature', 'digest'],
10+
'category': 'Inventory/Inventory',
11+
'sequence': 25,
12+
'demo': [
13+
'data/stock_demo_pre.xml',
14+
'data/stock_demo.xml',
15+
'data/stock_demo2.xml',
16+
'data/stock_orderpoint_demo.xml',
17+
'data/stock_storage_category_demo.xml',
18+
],
19+
'data': [
20+
'security/stock_security.xml',
21+
'security/ir.model.access.csv',
22+
23+
'data/digest_data.xml',
24+
'data/mail_templates.xml',
25+
'data/default_barcode_patterns.xml',
26+
'data/stock_data.xml',
27+
'data/stock_sequence_data.xml',
28+
'data/stock_traceability_report_data.xml',
29+
30+
'report/report_stock_quantity.xml',
31+
'report/report_stock_reception.xml',
32+
'report/stock_report_views.xml',
33+
'report/report_package_barcode.xml',
34+
'report/report_lot_barcode.xml',
35+
'report/report_location_barcode.xml',
36+
'report/report_stockpicking_operations.xml',
37+
'report/report_deliveryslip.xml',
38+
'report/report_stockinventory.xml',
39+
'report/report_stock_rule.xml',
40+
'report/stock_lot_customer.xml',
41+
'report/package_templates.xml',
42+
'report/picking_templates.xml',
43+
'report/product_templates.xml',
44+
'report/product_packaging.xml',
45+
'report/report_return_slip.xml',
46+
'data/mail_template_data.xml',
47+
48+
'views/stock_menu_views.xml',
49+
'wizard/stock_change_product_qty_views.xml',
50+
'wizard/stock_picking_return_views.xml',
51+
'wizard/stock_inventory_conflict.xml',
52+
'wizard/stock_backorder_confirmation_views.xml',
53+
'wizard/stock_quantity_history.xml',
54+
'wizard/stock_request_count.xml',
55+
'wizard/stock_replenishment_info.xml',
56+
'wizard/stock_rules_report_views.xml',
57+
'wizard/stock_warn_insufficient_qty_views.xml',
58+
'wizard/product_replenish_views.xml',
59+
'wizard/product_label_layout_views.xml',
60+
'wizard/stock_track_confirmation_views.xml',
61+
'wizard/stock_orderpoint_snooze_views.xml',
62+
'wizard/stock_package_destination_views.xml',
63+
'wizard/stock_inventory_adjustment_name.xml',
64+
'wizard/stock_inventory_warning.xml',
65+
'wizard/stock_label_type.xml',
66+
'wizard/stock_lot_label_layout.xml',
67+
'wizard/stock_quant_relocate.xml',
68+
69+
'views/res_partner_views.xml',
70+
'views/product_strategy_views.xml',
71+
'views/stock_lot_views.xml',
72+
'views/stock_scrap_views.xml',
73+
'views/stock_quant_views.xml',
74+
'views/stock_warehouse_views.xml',
75+
'views/stock_move_line_views.xml',
76+
'views/stock_move_views.xml',
77+
'views/stock_picking_views.xml',
78+
'views/stock_picking_type_views.xml',
79+
'views/product_views.xml',
80+
'views/stock_location_views.xml',
81+
'views/stock_orderpoint_views.xml',
82+
'views/stock_storage_category_views.xml',
83+
'views/res_config_settings_views.xml',
84+
'views/report_stock_traceability.xml',
85+
'views/stock_template.xml',
86+
'views/stock_rule_views.xml',
87+
'views/stock_package_level_views.xml',
88+
'views/stock_package_type_view.xml',
89+
'views/stock_forecasted.xml',
90+
],
91+
'installable': True,
92+
'application': True,
93+
'pre_init_hook': 'pre_init_hook',
94+
'post_init_hook': '_assign_default_mail_template_picking_id',
95+
'uninstall_hook': 'uninstall_hook',
96+
'assets': {
97+
'web.report_assets_common': [
98+
'stock/static/src/scss/report_stock_reception.scss',
99+
'stock/static/src/scss/report_stock_rule.scss',
100+
'stock/static/src/scss/report_stockpicking_operations.scss',
101+
],
102+
'web.assets_backend': [
103+
'stock/static/src/**/*.js',
104+
'stock/static/src/**/*.xml',
105+
'stock/static/src/**/*.scss',
106+
('remove', 'stock/static/src/stock_forecasted/forecasted_graph.*'),
107+
],
108+
'web.assets_backend_lazy': [
109+
'stock/static/src/stock_forecasted/forecasted_graph.*',
110+
],
111+
'web.assets_frontend': [
112+
'stock/static/src/scss/stock_traceability_report.scss',
113+
],
114+
'web.assets_tests': [
115+
'stock/static/tests/tours/*.js',
116+
],
117+
'web.qunit_suite_tests': [
118+
'stock/static/tests/counted_quantity_widget_tests.js',
119+
'stock/static/tests/inventory_report_list_tests.js',
120+
'stock/static/tests/popover_widget_tests.js',
121+
'stock/static/tests/stock_traceability_report_backend_tests.js',
122+
'stock/static/tests/stock_move_one2many_tests.js',
123+
],
124+
},
125+
'license': 'LGPL-3',
126+
}

addons/stock/base_import_module.py

Lines changed: 0 additions & 45 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import main

addons/stock/controllers/main.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# -*- coding: utf-8 -*-
2+
import werkzeug
3+
from werkzeug.exceptions import InternalServerError
4+
5+
from odoo import http
6+
from odoo.http import request
7+
from odoo.tools.misc import html_escape
8+
9+
import json
10+
11+
12+
class StockReportController(http.Controller):
13+
14+
@http.route('/stock/<string:output_format>/<string:report_name>', type='http', auth='user')
15+
def report(self, output_format, report_name=False, **kw):
16+
uid = request.session.uid
17+
domain = [('create_uid', '=', uid)]
18+
stock_traceability = request.env['stock.traceability.report'].with_user(uid).search(domain, limit=1)
19+
line_data = json.loads(kw['data'])
20+
try:
21+
if output_format == 'pdf':
22+
response = request.make_response(
23+
stock_traceability.with_context(active_id=kw['active_id'], active_model=kw['active_model']).get_pdf(line_data),
24+
headers=[
25+
('Content-Type', 'application/pdf'),
26+
('Content-Disposition', 'attachment; filename=' + 'stock_traceability' + '.pdf;')
27+
]
28+
)
29+
return response
30+
except Exception as e:
31+
se = http.serialize_exception(e)
32+
error = {
33+
'code': 200,
34+
'message': 'Odoo Server Error',
35+
'data': se
36+
}
37+
res = request.make_response(html_escape(json.dumps(error)))
38+
raise InternalServerError(response=res) from e
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<odoo>
3+
<data noupdate="1">
4+
<record id="barcode_rule_weight_three_dec" model="barcode.rule">
5+
<field name="name">Weight Barcodes 3 Decimals</field>
6+
<field name="barcode_nomenclature_id" ref="barcodes.default_barcode_nomenclature"/>
7+
<field name="sequence">36</field>
8+
<field name="type">weight</field>
9+
<field name="encoding">ean13</field>
10+
<field name="pattern">21.....{NNDDD}</field>
11+
</record>
12+
13+
<record id="barcode_rule_package" model="barcode.rule">
14+
<field name="name">Package barcodes</field>
15+
<field name="barcode_nomenclature_id" ref="barcodes.default_barcode_nomenclature"/>
16+
<field name="sequence">70</field>
17+
<field name="type">package</field>
18+
<field name="encoding">any</field>
19+
<field name="pattern">PACK</field>
20+
</record>
21+
22+
<record id="barcode_rule_lot" model="barcode.rule">
23+
<field name="name">Lot barcodes</field>
24+
<field name="barcode_nomenclature_id" ref="barcodes.default_barcode_nomenclature"/>
25+
<field name="sequence">80</field>
26+
<field name="type">lot</field>
27+
<field name="encoding">any</field>
28+
<field name="pattern">10</field>
29+
</record>
30+
31+
<record id="barcode_rule_location" model="barcode.rule">
32+
<field name="name">Location barcodes</field>
33+
<field name="barcode_nomenclature_id" ref="barcodes.default_barcode_nomenclature"/>
34+
<field name="sequence">60</field>
35+
<field name="type">location</field>
36+
<field name="encoding">any</field>
37+
<field name="pattern">414</field>
38+
</record>
39+
</data>
40+
</odoo>

addons/stock/data/digest_data.xml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version='1.0' encoding='utf-8'?>
2+
<odoo>
3+
<data>
4+
<record id="digest_tip_stock_0" model="digest.tip">
5+
<field name="name">Tip: Speed up inventory operations with barcodes</field>
6+
<field name="sequence">1000</field>
7+
<field name="group_id" ref="stock.group_stock_user" />
8+
<field name="tip_description" type="html">
9+
<div>
10+
<p class="tip_title">Tip: Speed up inventory operations with barcodes</p>
11+
<table class="tip_twocol">
12+
<tr>
13+
<td class="tip_twocol_left" style="width: 45%;">
14+
<img src="https://download.odoocdn.com/digests/stock/static/src/img/barcode.gif" class="tip_twocol_img" width="240"/>
15+
</td>
16+
<td style="width: 55%;">
17+
<p class="tip_content" style="margin: 0;">Enjoy a quick-paced experience with the Odoo barcode app. It is blazing fast and works even without a stable internet connection. It supports all flows: inventory adjustments, batch picking, moving lots or pallets, low inventory checks, etc. Go to the "Apps" menu to activate the barcode interface.</p>
18+
</td>
19+
</tr>
20+
</table>
21+
<div style="clear: both;" />
22+
</div>
23+
</field>
24+
</record>
25+
<record id="digest_tip_stock_1" model="digest.tip">
26+
<field name="name">Tip: Monitor Lot details</field>
27+
<field name="sequence">4000</field>
28+
<field name="group_id" ref="stock.group_stock_user"/>
29+
<field name="tip_description" type="html">
30+
<div>
31+
<p class="tip_title">Tip: Monitor Lot details</p>
32+
<p class="tip_content">Store and retrieve information regarding every Lot/Serial Number (condition, product info, ...).</p>
33+
<img src="https://download.odoocdn.com/digests/stock/static/src/img/18-stock-property-fields.gif" width="540" class="illustration_border"/>
34+
</div>
35+
</field>
36+
</record>
37+
</data>
38+
</odoo>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?xml version='1.0' encoding='utf-8'?>
2+
<odoo><data noupdate="1">
3+
<record id="mail_template_data_delivery_confirmation" model="mail.template">
4+
<field name="name">Shipping: Send by Email</field>
5+
<field name="model_id" ref="model_stock_picking"/>
6+
<field name="subject">{{ object.company_id.name }} Delivery Order (Ref {{ object.name or 'n/a' }})</field>
7+
<field name="partner_to">{{ object.partner_id.email and object.partner_id.id or object.partner_id.parent_id.id }}</field>
8+
<field name="description">Sent to the customers when orders are delivered, if the setting is enabled</field>
9+
<field name="body_html" type="html">
10+
<div style="margin: 0px; padding: 0px;">
11+
<p style="margin: 0px; padding: 0px; font-size: 13px;">
12+
Hello <t t-out="object.partner_id.name or ''">Brandon Freeman</t>,<br/><br/>
13+
We are glad to inform you that your order has been shipped.
14+
<t t-if="hasattr(object, 'carrier_tracking_ref') and object.carrier_tracking_ref">
15+
Your tracking reference is
16+
<strong>
17+
<t t-if="object.carrier_tracking_url">
18+
<t t-set="multiple_carrier_tracking" t-value="object.get_multiple_carrier_tracking()"/>
19+
<t t-if="multiple_carrier_tracking">
20+
<t t-foreach="multiple_carrier_tracking" t-as="line">
21+
<br/><a t-att-href="line[1]" target="_blank" t-out="line[0] or ''"></a>
22+
</t>
23+
</t>
24+
<t t-else="">
25+
<a t-attf-href="{{ object.carrier_tracking_url }}" target="_blank" t-out="object.carrier_tracking_ref or ''"></a>.
26+
</t>
27+
</t>
28+
<t t-else="">
29+
<t t-out="object.carrier_tracking_ref or ''"></t>.
30+
</t>
31+
</strong>
32+
</t>
33+
<br/><br/>
34+
Please find your delivery order attached for more details.<br/><br/>
35+
Thank you,
36+
<t t-if="user.signature">
37+
<br />
38+
<t t-out="user.signature or ''">--<br/>Mitchell Admin</t>
39+
</t>
40+
</p>
41+
</div>
42+
</field>
43+
<field name="report_template_ids" eval="[(4, ref('stock.action_report_delivery'))]"/>
44+
<field name="lang">{{ object.partner_id.lang }}</field>
45+
<field name="auto_delete" eval="True"/>
46+
</record>
47+
</data>
48+
</odoo>

0 commit comments

Comments
 (0)