Skip to content

Commit 333ea64

Browse files
dhrs-odoovava-odoo
authored andcommitted
[ADD] beverage_distributor: add module for beverage distributor
Odoo for Beverages Distributors This industry package includes everything you need to run your company efficiently with Odoo. Discover everything you need to know about this package by visiting the Knowledge App after installing it. Basics - Use the Inventory app as your central hub for managing stock, consignments, and warehouse operations. - Employ the Sales app to handle client orders and manage your product catalog. - Utilize the CRM to track leads, manage your sales pipeline, and nurture client relationships. - Use the Purchase app to order from suppliers and manage your supply chain. - Leverage the Point of Sale app for efficient B2C sales at your distribution center. - Streamline operations with the Barcode app for quick and accurate inventory management. - Expand your reach with a B2B eCommerce website for online ordering. - Use the Contacts app to maintain a comprehensive database of clients and suppliers. Included customizations - Additional fields on Product to manage deposit (Deposit product, Quantity by deposit product, Unit sale product and Empty deposit product) - Auto-addition of taxes from Deposit product to main product. - Auto-creation of a 00 reordering rule for each product selected in the Unit sale product field, with manufacturing route. - Auto-creation of a Bill of Material based on Unit sale product field. This BOM will create as many units of the Unit sale product as precised in the Quantity by deposit field from a single unit of the main product. - Additional "Auto-production" field on Bill of Material. This field will ensure that any manufacture order for this Bill of Material will be automatically produced. task-4194448
1 parent 141b3cb commit 333ea64

File tree

103 files changed

+4896
-0
lines changed

Some content is hidden

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

103 files changed

+4896
-0
lines changed

.tx/config

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ resource_name = bar_industry
4646
replace_edited_strings = false
4747
keep_translations = false
4848

49+
[o:odoo:p:odoo-18:r:beverage_distributor]
50+
file_filter = beverage_distributor/i18n/<lang>.po
51+
source_file = beverage_distributor/i18n/beverage_distributor.pot
52+
type = PO
53+
minimum_perc = 0
54+
resource_name = beverage_distributor
55+
replace_edited_strings = false
56+
keep_translations = false
57+
4958
[o:odoo:p:odoo-18:r:bike_leasing]
5059
file_filter = bike_leasing/i18n/<lang>.po
5160
source_file = bike_leasing/i18n/bike_leasing.pot

bar_industry/images/main.png

-576 Bytes
Loading
-335 Bytes
Loading
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
{
2+
'name': 'Beverage Distributor',
3+
'version': '1.0',
4+
'category': 'Supply Chain',
5+
'description': "",
6+
'depends': [
7+
'base_automation',
8+
'calendar',
9+
'knowledge',
10+
'mrp',
11+
'pos_loyalty',
12+
'product_barcodelookup',
13+
'sale_crm',
14+
'sale_management',
15+
'sale_purchase',
16+
'sale_service',
17+
'web_studio',
18+
'website_crm',
19+
'website_sale',
20+
'website_sale_stock',
21+
'theme_bistro',
22+
],
23+
'data': [
24+
'data/product_category.xml',
25+
'data/ir_attachment_pre.xml',
26+
'data/ir_model_fields.xml',
27+
'data/ir_ui_view.xml',
28+
'data/ir_actions_server.xml',
29+
'data/base_automation.xml',
30+
'data/ir_default.xml',
31+
'data/product_public_category.xml',
32+
'data/pos_category.xml',
33+
'data/account_tax.xml',
34+
'data/product_template.xml',
35+
'data/product_attribute.xml',
36+
'data/product_attribute_value.xml',
37+
'data/product_pricelist.xml',
38+
'data/product_template_attribute_line.xml',
39+
'data/product_template_attribute_value.xml',
40+
'data/product_product.xml',
41+
'data/product_template_package.xml',
42+
'data/ptal.xml',
43+
'data/knowledge_cover.xml',
44+
'data/knowledge_article.xml',
45+
'data/knowledge_article_favorite.xml',
46+
'data/mail_message.xml',
47+
'data/delivery_carrier.xml',
48+
'data/ir_model_data.xml',
49+
'data/ir_attachment_post.xml',
50+
'data/pos_config.xml',
51+
'data/res_config_settings.xml',
52+
],
53+
'demo': [
54+
'demo/website.xml',
55+
'demo/res_partner.xml',
56+
'demo/crm_lead.xml',
57+
'demo/product_template.xml',
58+
'demo/product_supplierinfo.xml',
59+
'demo/sale_order.xml',
60+
'demo/sale_order_line.xml',
61+
'demo/sale_order_confirm.xml',
62+
'demo/website_attachment.xml',
63+
'demo/website_view.xml',
64+
'demo/website_theme_apply.xml',
65+
'demo/website_page.xml',
66+
'demo/website_menu.xml',
67+
'demo/purchase_order.xml',
68+
'demo/purchase_order_line.xml',
69+
'demo/purchase_order_confirm.xml',
70+
'demo/validate_deliveries.xml',
71+
'demo/validate_receipts.xml',
72+
'demo/stock_quant.xml',
73+
'demo/mail_activity.xml',
74+
'demo/delivery_carrier.xml',
75+
'demo/payment_provider_demo_post.xml',
76+
],
77+
'license': 'OPL-1',
78+
'author': 'Odoo S.A.',
79+
'images': ['images/main.png'],
80+
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<odoo noupdate="1">
3+
<record id='deposit_tax_group' model='account.tax.group'>
4+
<field name='name'>Deposit</field>
5+
</record>
6+
7+
<record id="account_tax_01_sale" model="account.tax">
8+
<field name="amount">0.1</field>
9+
<field name="amount_type">fixed</field>
10+
<field name="name">DEP 0.1</field>
11+
<field name="type_tax_use">sale</field>
12+
<field name="tax_group_id" ref="deposit_tax_group"/>
13+
</record>
14+
<record id="account_tax_21_sale" model="account.tax">
15+
<field name="amount">2.1</field>
16+
<field name="amount_type">fixed</field>
17+
<field name="name">DEP 2.1</field>
18+
<field name="type_tax_use">sale</field>
19+
<field name="tax_group_id" ref="deposit_tax_group"/>
20+
</record>
21+
<record id="account_tax_24_sale" model="account.tax">
22+
<field name="amount">2.4</field>
23+
<field name="amount_type">fixed</field>
24+
<field name="name">DEP 2.4</field>
25+
<field name="type_tax_use">sale</field>
26+
<field name="tax_group_id" ref="deposit_tax_group"/>
27+
</record>
28+
<record id="account_tax_45_sale" model="account.tax">
29+
<field name="amount">4.5</field>
30+
<field name="amount_type">fixed</field>
31+
<field name="name">DEP 4.5</field>
32+
<field name="type_tax_use">sale</field>
33+
<field name="tax_group_id" ref="deposit_tax_group"/>
34+
</record>
35+
<record id="account_tax_01_purchase" model="account.tax">
36+
<field name="amount">0.1</field>
37+
<field name="amount_type">fixed</field>
38+
<field name="name">DEP 0.1</field>
39+
<field name="type_tax_use">purchase</field>
40+
<field name="tax_group_id" ref="deposit_tax_group"/>
41+
</record>
42+
<record id="account_tax_24_purchase" model="account.tax">
43+
<field name="amount">2.4</field>
44+
<field name="amount_type">fixed</field>
45+
<field name="name">DEP 2.4</field>
46+
<field name="type_tax_use">purchase</field>
47+
<field name="tax_group_id" ref="deposit_tax_group"/>
48+
</record>
49+
<record id="account_tax_45_purchase" model="account.tax">
50+
<field name="amount">4.5</field>
51+
<field name="amount_type">fixed</field>
52+
<field name="name">DEP 4.5</field>
53+
<field name="type_tax_use">purchase</field>
54+
<field name="tax_group_id" ref="deposit_tax_group"/>
55+
</record>
56+
57+
<record id='excises_tax_group' model='account.tax.group'>
58+
<field name='name'>Excises</field>
59+
</record>
60+
61+
<record id="account_tax_exc_coca_sale" model="account.tax">
62+
<field name="amount">1.21</field>
63+
<field name="amount_type">fixed</field>
64+
<field name="name">EXC COCA</field>
65+
<field name="type_tax_use">sale</field>
66+
<field name="tax_group_id" ref="excises_tax_group"/>
67+
</record>
68+
<record id="account_tax_exc_21676_sale" model="account.tax">
69+
<field name="amount">2.1676</field>
70+
<field name="amount_type">fixed</field>
71+
<field name="name">EXC 2.1676</field>
72+
<field name="type_tax_use">sale</field>
73+
<field name="tax_group_id" ref="excises_tax_group"/>
74+
</record>
75+
</odoo>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<odoo>
3+
<record id="auto_production" model="base.automation">
4+
<field name="name">Auto Production</field>
5+
<field name="action_server_ids" eval="[(6, 0, [ref('update_state')])]"/>
6+
<field name="trigger_field_ids" eval="[(6, 0, [ref('mrp.field_mrp_production__state')])]"/>
7+
<field name="model_id" ref="mrp.model_mrp_production"/>
8+
<field name="trigger">on_state_set</field>
9+
<field name="filter_domain">[('state', '=', 'confirmed')]</field>
10+
<field name="filter_pre_domain">[("bom_id.x_auto_production", "=", True)]</field>
11+
</record>
12+
<record id="bom_automation" model="base.automation">
13+
<field name="name">Automated BoM</field>
14+
<field name="action_server_ids" eval="[(6, 0, [ref('bom_server_action')])]"/>
15+
<field name="model_id" ref="product.model_product_template"/>
16+
<field name="trigger_field_ids" eval="[(6, 0, [ref('field_empty_deposit'), ref('field_quantity_by_deposit_product'), ref('field_unit_sale_product')])]"/>
17+
<field name="trigger">on_create_or_write</field>
18+
</record>
19+
<record id="update_sales_taxes" model="base.automation">
20+
<field name="name">Update Taxes</field>
21+
<field name="action_server_ids" eval="[(6, 0, [ref('update_sales_taxes_server_action')])]"/>
22+
<field name="model_id" ref="product.model_product_template"/>
23+
<field name="trigger_field_ids" eval="[(6, 0, [ref('field_deposit_product_1')])]"/>
24+
<field name="filter_domain">[('x_is_a_deposit', '=', False)]</field>
25+
<field name="trigger">on_create_or_write</field>
26+
</record>
27+
<record id="make_deposit_storable_delivery_invoice" model="base.automation">
28+
<field name="name">Default fields for deposits</field>
29+
<field name="action_server_ids" eval="[(6, 0, [ref('action_make_deposit_storable_delivery_invoice')])]"/>
30+
<field name="model_id" ref="product.model_product_template"/>
31+
<field name="trigger_field_ids" eval="[(6, 0, [ref('product.field_product_template__categ_id')])]"/>
32+
<field name="on_change_field_ids" eval="[(6, 0, [ref('product.field_product_template__categ_id')])]"/>
33+
<field name="filter_domain">[('x_is_a_deposit', '=', False)]</field>
34+
<field name="trigger">on_change</field>
35+
</record>
36+
</odoo>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<odoo noupdate="1">
3+
<record id="product_product_delivery" model="product.product">
4+
<field name="name">Take Away</field>
5+
<field name="default_code">Delivery_008</field>
6+
<field name="type">service</field>
7+
<field name="categ_id" ref="delivery.product_category_deliveries"/>
8+
<field name="sale_ok" eval="False"/>
9+
<field name="purchase_ok" eval="False"/>
10+
<field name="list_price">0.0</field>
11+
</record>
12+
<record id="delivery_carrier_1" model="delivery.carrier">
13+
<field name="name">Take Away</field>
14+
<field name="fixed_price">0.0</field>
15+
<field name="sequence">1</field>
16+
<field name="delivery_type">fixed</field>
17+
<field name="product_id" ref="product_product_delivery"/>
18+
</record>
19+
</odoo>
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<odoo>
3+
<record id="bom_server_action" model="ir.actions.server">
4+
<field name="code"><![CDATA[
5+
if record.x_quantity_by_deposit_product == 1 and record.x_unit_sale_product.id:
6+
raise UserError("Unit sale product should be undefined if this product can not be sold in a smaller unit.")
7+
if record.x_unit_sale_product:
8+
existing_bom = env['mrp.bom'].search([('product_tmpl_id', '=',record.x_unit_sale_product.product_tmpl_id.id)], limit=1)
9+
reordering_rule = env['stock.warehouse.orderpoint'].search_count([('product_id', '=', record.x_unit_sale_product.id)], limit=1)
10+
bom_vals = {
11+
'product_qty': record.x_quantity_by_deposit_product,
12+
'type': 'normal',
13+
'x_parent_product': record.id,
14+
'x_auto_production': True,
15+
'bom_line_ids': [(5, 0), (0, 0, {
16+
'product_id': record.product_variant_id.id,
17+
'product_qty': 1,
18+
})],
19+
}
20+
if record.x_deposit_product:
21+
bom_vals['byproduct_ids'] = [(5, 0), (0, 0, {
22+
'product_id': record.x_deposit_product.product_variant_id.id,
23+
'product_qty': 1.0,
24+
})]
25+
if existing_bom:
26+
existing_bom.write(bom_vals)
27+
else:
28+
bom_vals['product_tmpl_id'] = record.x_unit_sale_product.product_tmpl_id.id
29+
env['mrp.bom'].create(bom_vals)
30+
if not reordering_rule:
31+
env['stock.warehouse.orderpoint'].create({
32+
'product_id': record.x_unit_sale_product.id,
33+
'x_parent_product': record.id,
34+
'product_min_qty': 0,
35+
'product_max_qty': 0,
36+
'qty_multiple': record.x_quantity_by_deposit_product or 1,
37+
'route_id': env.ref('mrp.route_warehouse0_manufacture').id,
38+
'location_id': env.ref('stock.stock_location_stock').id,
39+
})
40+
else:
41+
existing_bom = env['mrp.bom'].search([('x_parent_product', '=',record.id)], limit=1)
42+
reordering_rule = env['stock.warehouse.orderpoint'].search([('x_parent_product', '=', record.id)], limit=1)
43+
if existing_bom:
44+
existing_bom.unlink()
45+
if reordering_rule:
46+
reordering_rule.unlink()
47+
]]></field>
48+
<field name="model_id" ref="product.model_product_template"/>
49+
<field name="state">code</field>
50+
<field name="name">Execute Code</field>
51+
</record>
52+
<record id="update_sales_taxes_server_action" model="ir.actions.server">
53+
<field name="code"><![CDATA[
54+
product_taxe = record.taxes_id.filtered(lambda t: t.tax_group_id.name != 'Deposit')
55+
supplier_taxe = record.supplier_taxes_id.filtered(lambda t: t.tax_group_id.name != 'Deposit')
56+
if record.x_deposit_product_1:
57+
product_taxe += record.x_deposit_product_1.taxes_id
58+
supplier_taxe += record.x_deposit_product_1.supplier_taxes_id
59+
record['taxes_id'] = [(6, 0, (product_taxe).ids)]
60+
record['supplier_taxes_id'] = [(6, 0, (supplier_taxe).ids)]
61+
]]></field>
62+
<field name="model_id" ref="product.model_product_template"/>
63+
<field name="state">code</field>
64+
<field name="name">Execute Code</field>
65+
</record>
66+
<record id="update_state" model="ir.actions.server">
67+
<field name="child_ids" eval="[(6, 0, [ref('mrp.action_production_order_mark_done')])]"/>
68+
<field name="model_id" ref="mrp.model_mrp_production"/>
69+
<field name="state">multi</field>
70+
<field name="name">Execute Existing Actions</field>
71+
</record>
72+
<record id="action_make_deposit_storable_delivery_invoice" model="ir.actions.server">
73+
<field name="code"><![CDATA[
74+
if record.x_is_a_deposit:
75+
record.write({'invoice_policy':'delivery', 'type': 'consu', 'is_storable': True})
76+
]]></field>
77+
<field name="model_id" ref="product.model_product_template"/>
78+
<field name="state">code</field>
79+
<field name="name">Execute Code</field>
80+
</record>
81+
</odoo>
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 noupdate="1">
3+
<record id="ir_attachment_1073" model="ir.attachment">
4+
<field name="name">unsplash_r4UGyzh_8Ik_beers.jpg</field>
5+
<field name="datas" type="base64" file="beverage_distributor/static/src/binary/ir_attachment/1073-unsplash_r4UGyzh_8Ik_beers.jpg"/>
6+
<field name="url">/unsplash/r4UGyzh_8Ik/beers.jpg</field>
7+
<field name="res_model">ir.ui.view</field>
8+
<field name="website_id" ref="website.default_website"/>
9+
</record>
10+
<record id="ir_attachment_1074" model="ir.attachment">
11+
<field name="name">unsplash_y2Vw5Tgtk5s_wines.jpg</field>
12+
<field name="datas" type="base64" file="beverage_distributor/static/src/binary/ir_attachment/1074-unsplash_y2Vw5Tgtk5s_wines.jpg"/>
13+
<field name="url">/unsplash/y2Vw5Tgtk5s/wines.jpg</field>
14+
<field name="res_model">ir.ui.view</field>
15+
<field name="website_id" ref="website.default_website"/>
16+
</record>
17+
<record id="ir_attachment_1075" model="ir.attachment">
18+
<field name="name">unsplash_y2Vw5Tgtk5s_wines.webp</field>
19+
<field name="datas" type="base64" file="beverage_distributor/static/src/binary/ir_attachment/1075-unsplash_y2Vw5Tgtk5s_wines.webp"/>
20+
<field name="url">/unsplash/y2Vw5Tgtk5s/1075/wines.jpg</field>
21+
<field name="res_model">ir.ui.view</field>
22+
<field name="website_id" ref="website.default_website"/>
23+
</record>
24+
<record id="ir_attachment_1076" model="ir.attachment">
25+
<field name="name">unsplash_r4UGyzh_8Ik_beers.webp</field>
26+
<field name="datas" type="base64" file="beverage_distributor/static/src/binary/ir_attachment/1076-unsplash_r4UGyzh_8Ik_beers.webp"/>
27+
<field name="url">/unsplash/r4UGyzh_8Ik/1076/beers.jpg</field>
28+
<field name="res_model">ir.ui.view</field>
29+
<field name="website_id" ref="website.default_website"/>
30+
</record>
31+
<record id="ir_attachment_1077" model="ir.attachment">
32+
<field name="name">unsplash_7dpHzyA7rb8_beverages.webp</field>
33+
<field name="datas" type="base64" file="beverage_distributor/static/src/binary/ir_attachment/1077-unsplash_7dpHzyA7rb8_beverages.webp"/>
34+
<field name="url">/unsplash/7dpHzyA7rb8/1077/beverages.jpg</field>
35+
<field name="res_model">ir.ui.view</field>
36+
<field name="website_id" ref="website.default_website"/>
37+
</record>
38+
</odoo>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<odoo noupdate="1">
3+
<record id="ir_attachment_829" model="ir.attachment">
4+
<field name="name">unsplash_7dpHzyA7rb8_.jpg</field>
5+
<field name="datas" type="base64" file="beverage_distributor/static/src/binary/ir_attachment/1077-unsplash_7dpHzyA7rb8_beverages.webp"/>
6+
<field name="url">/unsplash/7dpHzyA7rb8/.jpg</field>
7+
</record>
8+
</odoo>

0 commit comments

Comments
 (0)