Skip to content

Commit 099a3f7

Browse files
committed
[IMP] excise_management: Editable fields, expose new button, add demo data
- Exposed the “New” button to allow users to manually create excise reports. - Made key excise report form fields (Name, Period, State) editable. - Removed the “Mark as Done” button from excise reports. - Reworked the scheduled action to generate excise report. - Updated demo data for the beverage distributor: added excise report demo data.
1 parent 1335d74 commit 099a3f7

File tree

14 files changed

+194
-157
lines changed

14 files changed

+194
-157
lines changed

beverage_distributor/__manifest__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
'name': 'Beverage Distributor',
3-
'version': '2.1',
3+
'version': '2.0',
44
'category': 'Supply Chain',
55
'depends': [
66
'base_automation',
@@ -54,6 +54,7 @@
5454
'demo/crm_lead.xml',
5555
'demo/product_template.xml',
5656
'demo/product_supplierinfo.xml',
57+
'demo/stock_quant.xml',
5758
'demo/sale_order.xml',
5859
'demo/sale_order_line.xml',
5960
'demo/sale_order_confirm.xml',
@@ -63,9 +64,6 @@
6364
'demo/purchase_order.xml',
6465
'demo/purchase_order_line.xml',
6566
'demo/purchase_order_confirm.xml',
66-
'demo/validate_deliveries.xml',
67-
'demo/validate_receipts.xml',
68-
'demo/stock_quant.xml',
6967
'demo/mail_activity.xml',
7068
'demo/delivery_carrier.xml',
7169
'demo/payment_provider_demo_post.xml',

beverage_distributor/data/knowledge_article.xml

Lines changed: 66 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -46,64 +46,72 @@
4646
</li>
4747
<li>You can also collect deposit directly on your Point of Sale. Select the correct product and encode a negative quantity.</li>
4848
</ul><p><br/></p>
49-
<h3>Excise Management 🧾</h3>
50-
<p>In case you import or purchase products for which excises need to be recorded, you can handle it with this package.</p>
51-
<p>Excise management consists in two dimensions in this package:</p>
52-
<ul>
53-
<li>The maintenance of excise categories and the assignation of excises to products</li>
54-
<li>The reporting of received and delivered excise concerned products, a legal implication for any fiscal deposit</li>
55-
</ul>
56-
<div class="o_editor_banner lh-1 d-flex align-items-center alert alert-warning pb-0 pt-3 o-contenteditable-false" data-oe-protected="true" data-oe-role="status" contenteditable="false" role="status">
57-
<i class="o_editor_banner_icon mb-3 fst-normal" data-oe-aria-label="Banner Warning" aria-label="Banner Warning">⚠️</i>
58-
<div class="w-100 px-3 o_editor_banner_content o-contenteditable-true" data-oe-protected="false" contenteditable="true">
59-
<p>When installing this module, all Fiscal Positions are set as Fiscal Deposit.<br/>Adjust the Fiscal Positions which are not to consider the Excise Taxes in your orders.</p>
60-
</div>
61-
</div>
62-
<p><strong>Excise categories maintenance</strong></p>
63-
<p>From the <strong>Inventory app</strong>, open the Excise categories from the menu Configuration / Excise Categories. <br/>Here you can define new and maintain existing excise categories.</p>
64-
<p>Imagine you create a new category of products which need excise management...</p>
65-
<ul>
66-
<li>Create a new excise category defining its name, description and reporting unit following the legislation which applies.</li>
67-
</ul>
68-
<p>Then create your product: </p>
69-
<ul>
70-
<li>Define the required product fields. </li>
71-
<li>Assign the relevant excise category, input the Excise Amount and the Excise Quantity in the reporting unit and then save your product.</li>
72-
</ul>
73-
<div class="o_editor_banner user-select-none lh-1 d-flex align-items-center alert alert-info pb-0 pt-3 o-contenteditable-false" data-oe-role="status" contenteditable="false" role="status">
74-
<i class="o_editor_banner_icon mb-3 fst-normal" data-oe-aria-label="Banner Info" aria-label="Banner Info">💡</i>
75-
<div class="w-100 px-3 o_editor_banner_content o-contenteditable-true" contenteditable="true">
76-
<p>When you sell this product, the excise is accounted separately in a tax and summarised at the end of your sale orders, allowing you to offer clear discounts on your product irrespectively of the excise.</p>
77-
</div>
78-
</div>
79-
<p><strong>Excise reporting</strong></p>
80-
<p>On a regular basis, excises need to be declared. To support you with this duty, a report is setup to reach the quantity by excise category entering and exiting your fiscal deposit warehouse.</p>
81-
<ul>
82-
<li>
83-
<p>Open the <strong>Inventory app</strong> and reach from the Reporting menu the Excises.</p>
84-
<ul>
85-
<li>Entry from FD corresponds to products entering you fiscal deposit warehouse from the fiscal deposit of a supplier. To define such suppliers, adapt their fiscal position to handle excise tax.</li>
86-
<li>Exit to FD refers to products exiting your fiscal deposit warehouse to the fiscal deposit of a customer. To define such customers, adapt their fiscal position to handle excise tax.</li>
87-
<li>Exit means that products exited your fiscal deposit, to another warehouse of your or through a delivery to a customer without fiscal deposit warehouse.</li>
88-
<li>Entry is here in case you purchase products or are returned products not from a fiscal deposit warehouse. In such case, you ask for excise credits with your excise declaration.</li>
89-
<li>Transfer is here to handle the transfers between multiple fiscal deposit warehouses of yours.</li>
90-
</ul>
91-
</li>
92-
</ul>
93-
<div class="o_editor_banner user-select-none o-contenteditable-false lh-1 d-flex align-items-center alert alert-warning pb-0 pt-3" data-oe-role="status" contenteditable="false" role="status">
94-
<i class="o_editor_banner_icon mb-3 fst-normal" data-oe-aria-label="Banner Warning" aria-label="Banner Warning">⚠️</i>
95-
<div class="o_editor_banner_content o-contenteditable-true w-100 px-3" contenteditable="true">
96-
<p>Receipts and Deliveries from and to Partners having no Fiscal Position defined are handled with the product taxes.</p>
97-
</div>
98-
</div>
99-
<p>Remember that only stock moves to or from your fiscal deposit warehouses are reported here.<br/>This is normal not to see any move related to a sale from a front store warehouse since it is not a fiscal deposit for example.</p>
100-
<p>You now have the keys to easily report those to the relevant authorities!</p>
101-
<div class="o_editor_banner user-select-none o-contenteditable-false lh-1 d-flex align-items-center alert alert-info pb-0 pt-3" data-oe-role="status" contenteditable="false" role="status">
102-
<i class="o_editor_banner_icon mb-3 fst-normal" data-oe-aria-label="Banner Info" aria-label="Banner Info">💡</i>
103-
<div class="o_editor_banner_content o-contenteditable-true w-100 px-3" contenteditable="true">
104-
<p>The default breakdown is done by week and you can configure it to be by month if needed.</p>
105-
</div>
106-
</div>
49+
<h3>Excise Management 🧾</h3>
50+
<p>In case you import or purchase products for which excises need to be recorded, you can handle it with this package.</p>
51+
<p>Excise management consists in two dimensions in this package:</p>
52+
<ul>
53+
<li>The maintenance of excise categories and the assignation of excises to products</li>
54+
<li>The reporting of received and delivered excise concerned products, a legal implication for any fiscal deposit</li>
55+
</ul>
56+
<div class="o_editor_banner lh-1 d-flex align-items-center alert alert-warning pb-0 pt-3 o-contenteditable-false" data-oe-protected="true" data-oe-role="status" contenteditable="false" role="status">
57+
<i class="o_editor_banner_icon mb-3 fst-normal" data-oe-aria-label="Banner Warning" aria-label="Banner Warning">⚠️</i>
58+
<div class="w-100 px-3 o_editor_banner_content o-contenteditable-true" data-oe-protected="false" contenteditable="true">
59+
<p>When installing this module, all Fiscal Positions are set as Fiscal Deposit.<br/>Adjust the Fiscal Positions which are not to consider the Excise Taxes in your orders.</p>
60+
</div>
61+
</div>
62+
<p><strong>Excise categories maintenance</strong></p>
63+
<p>From the <strong>Inventory app</strong>, open the Excise categories from the menu Configuration / Excise Categories. <br/>Here you can define new and maintain existing excise categories.</p>
64+
<p>Imagine you create a new category of products which need excise management...</p>
65+
<ul>
66+
<li>Create a new excise category defining its name, description and reporting unit following the legislation which applies.</li>
67+
</ul>
68+
<p>Then create your product: </p>
69+
<ul>
70+
<li>Define the required product fields. </li>
71+
<li>Assign the relevant excise category, input the Excise Amount and the Excise Quantity in the reporting unit and then save your product.</li>
72+
</ul>
73+
<div class="o_editor_banner user-select-none lh-1 d-flex align-items-center alert alert-info pb-0 pt-3 o-contenteditable-false" data-oe-role="status" contenteditable="false" role="status">
74+
<i class="o_editor_banner_icon mb-3 fst-normal" data-oe-aria-label="Banner Info" aria-label="Banner Info">💡</i>
75+
<div class="w-100 px-3 o_editor_banner_content o-contenteditable-true" contenteditable="true">
76+
<p>When you sell this product, the excise is accounted separately in a tax and summarised at the end of your sale orders, allowing you to offer clear discounts on your product irrespectively of the excise.</p>
77+
</div>
78+
</div>
79+
<p><strong>Excise reports</strong></p>
80+
<p>On a regular basis, excises need to be declared. To support you with this duty, a report generated weekly provides the quantity by excise category entering and exiting your fiscal deposit warehouse with a dedicated activity for it.</p>
81+
<div class="o_editor_banner user-select-none o-contenteditable-false lh-1 d-flex align-items-center alert alert-info pb-0 pt-3" data-oe-role="status" contenteditable="false" role="status">
82+
<i class="o_editor_banner_icon mb-3 fst-normal" data-oe-aria-label="Banner Info" aria-label="Banner Info">💡</i>
83+
<div class="o_editor_banner_content o-contenteditable-true w-100 px-3" contenteditable="true">
84+
<p>The assignee of the excise reporting activities can be set from the Inventory settings.</p>
85+
</div>
86+
</div>
87+
<ul>
88+
<li>
89+
<p>Open the <strong>Inventory app</strong> and reach the Excise Reports from the Reporting menu.</p>
90+
<ul>
91+
<li>Entry from FD corresponds to products entering you fiscal deposit warehouse from the fiscal deposit of a supplier. To define such suppliers, adapt their fiscal position to handle excise tax.</li>
92+
<li>Exit to FD refers to products exiting your fiscal deposit warehouse to the fiscal deposit of a customer. To define such customers, adapt their fiscal position to handle excise tax.</li>
93+
<li>Exit means that products exited your fiscal deposit, to another warehouse of your or through a delivery to a customer without fiscal deposit warehouse.</li>
94+
<li>Entry is here in case you purchase products or are returned products not from a fiscal deposit warehouse. In such case, you ask for excise credits with your excise declaration.</li>
95+
<li>Transfer is here to handle the transfers between multiple fiscal deposit warehouses of yours.</li>
96+
</ul>
97+
</li>
98+
</ul>
99+
<div class="o_editor_banner user-select-none o-contenteditable-false lh-1 d-flex align-items-center alert alert-warning pb-0 pt-3" data-oe-role="status" contenteditable="false" role="status">
100+
<i class="o_editor_banner_icon mb-3 fst-normal" data-oe-aria-label="Banner Warning" aria-label="Banner Warning">⚠️</i>
101+
<div class="o_editor_banner_content o-contenteditable-true w-100 px-3" contenteditable="true">
102+
<p>Receipts and Deliveries from and to Partners having no Fiscal Position defined are handled with the product taxes.</p>
103+
</div>
104+
</div>
105+
<p>Remember that only stock moves to or from your fiscal deposit warehouses are reported here.</p>
106+
<p>This is normal not to see any move related to a sale from a front store warehouse since it is not a fiscal deposit for example</p>
107+
<p><strong>Excise reporting</strong></p>
108+
<p>On top of the legal reporting, you needs as well to know at all time the quantity of excise submitted products in your fiscal deposit warehouses.</p>
109+
<ul>
110+
<li><p>Open the <strong>Inventory app</strong> and reach the Excise Reports from the Reporting menu.</p></li>
111+
<li><p>Rows come with the same move types detailed as the Excise Reports.</p></li>
112+
<li><p>The Total row allows you to capture your currently in fiscal deposit warehouse product quantity!</p></li>
113+
</ul>
114+
<p>You now have the keys to easily report those to the relevant authorities!</p>
107115
<h3>Sales Management 🍾</h3><p>Use the Sales app to:</p><ul>
108116
<li>Manage your product catalog</li>
109117
<li>Create and track sales orders</li>

beverage_distributor/demo/mail_activity.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,12 @@
1818
<field name="res_id" ref="crm_lead_6"/>
1919
<field name="activity_type_id" ref="mail.mail_activity_data_todo"/>
2020
</record>
21+
<record id="mail_activity_4" model="mail.activity">
22+
<field name="res_model_id" ref="excise_management.excise_report"/>
23+
<field name="res_id" ref="excise_report_1"/>
24+
<field name="summary" model="mail.activity" eval="'Excise Report ' + obj().env.ref('beverage_distributor.excise_report_1').x_name"/>
25+
<field name="date_deadline" eval="(datetime.today() + timedelta(weeks=1))"/>
26+
<field name="user_id" ref="base.user_admin"/>
27+
<field name="activity_type_id" ref="mail.mail_activity_data_todo"/>
28+
</record>
2129
</odoo>

beverage_distributor/demo/purchase_order_confirm.xml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,23 @@
1414
).picking_ids.ids"/>
1515
<value model="stock.location" eval="{'location_dest_id': obj().search([('display_name', '=', 'FD/Stock')]).id}"/>
1616
</function>
17-
18-
<function name="button_validate" model="stock.picking">
17+
<function name="button_validate" model="stock.picking" context="{'skip_sms': True}">
1918
<value model="stock.picking" eval="(
2019
obj().env.ref('beverage_distributor.purchase_order_4') +
20+
obj().env.ref('beverage_distributor.purchase_order_5') +
21+
obj().env.ref('beverage_distributor.purchase_order_6') +
2122
obj().env.ref('beverage_distributor.purchase_order_7')
2223
).picking_ids.ids"/>
2324
</function>
25+
<function name="write" model="stock.picking">
26+
<value model="stock.picking" eval="(
27+
obj().env.ref('beverage_distributor.purchase_order_4')
28+
).picking_ids.ids"/>
29+
<value eval="{'scheduled_date': (datetime.today().date() + relativedelta(weeks=-1)), 'date_done': (datetime.today().date() + relativedelta(weeks=-1))}" />
30+
</function>
31+
<record id="excise_report_1" model="x_excise_report">
32+
<field name="x_user_id" ref="base.user_admin"/>
33+
<field name="x_from_date" eval="(datetime.today() - timedelta(weeks=1))"/>
34+
<field name="x_to_date" eval="(datetime.today())"/>
35+
</record>
2436
</odoo>

beverage_distributor/demo/sale_order_confirm.xml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,39 @@
1414
]]"/>
1515
<function name="write" model="stock.picking">
1616
<value model="stock.picking" eval="(
17+
obj().env.ref('beverage_distributor.sale_order_21') +
18+
obj().env.ref('beverage_distributor.sale_order_22') +
19+
obj().env.ref('beverage_distributor.sale_order_23') +
20+
obj().env.ref('beverage_distributor.sale_order_24') +
21+
obj().env.ref('beverage_distributor.sale_order_25') +
22+
obj().env.ref('beverage_distributor.sale_order_26') +
23+
obj().env.ref('beverage_distributor.sale_order_27') +
24+
obj().env.ref('beverage_distributor.sale_order_28') +
1725
obj().env.ref('beverage_distributor.sale_order_29') +
1826
obj().env.ref('beverage_distributor.sale_order_30')
1927
).picking_ids.ids"/>
2028
<value model="stock.location" eval="{'location_id': obj().search([('warehouse_id', '=', ref('excise_management.stock_warehouse_fiscal_deposit')), ('child_ids', '=', False)], limit=1).id}"/>
2129
</function>
22-
<function name="button_validate" model="stock.picking">
30+
<function name="action_assign" model="stock.picking">
2331
<value model="stock.picking" eval="(
24-
obj().env.ref('beverage_distributor.sale_order_29') +
32+
obj().env.ref('beverage_distributor.sale_order_25') +
33+
obj().env.ref('beverage_distributor.sale_order_28') +
34+
obj().env.ref('beverage_distributor.sale_order_30')
35+
).picking_ids.ids"/>
36+
</function>
37+
<function name="button_validate" model="stock.picking" context="{'skip_sms': True}">
38+
<value model="stock.picking" eval="(
39+
obj().env.ref('beverage_distributor.sale_order_25') +
40+
obj().env.ref('beverage_distributor.sale_order_28') +
41+
obj().env.ref('beverage_distributor.sale_order_30')
42+
).picking_ids.ids"/>
43+
</function>
44+
<function name="write" model="stock.picking">
45+
<value model="stock.picking" eval="(
46+
obj().env.ref('beverage_distributor.sale_order_25') +
47+
obj().env.ref('beverage_distributor.sale_order_28') +
2548
obj().env.ref('beverage_distributor.sale_order_30')
2649
).picking_ids.ids"/>
50+
<value eval="{'scheduled_date': (datetime.today().date() + relativedelta(weeks=-1)), 'date_done': (datetime.today().date() + relativedelta(weeks=-1))}" />
2751
</function>
2852
</odoo>

0 commit comments

Comments
 (0)