Skip to content

Commit 3eeb99b

Browse files
amas-odoovava-odoo
authored andcommitted
[IMP] excise_management: weekly excise report automation and configuration
- Capture transfer external IDs from transfer form and expose transfer IDs in invoice form. - Add new model to manage weekly Excise Reports. - Implement scheduled action running every Sunday to: - Create a new Excise Report for the past week. - Set report date range, label, and computation status (in progress). - Create a To-Do activity: "Excise Report <year>W<week>" assigned to the designated reporter, due +1 week. - Keep existing "Excises" report view, but: - Remove default grouping by week (keep only by fiscal deposit move). - Remove "Excise Amount" measure from default display, keep only quantity visible. - Add new menu item "Excise Reports" listing all Excise Report records. - 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. task-5106520
1 parent b5020e6 commit 3eeb99b

21 files changed

+669
-72
lines changed

beverage_distributor/__manifest__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
'demo/crm_lead.xml',
5757
'demo/product_template.xml',
5858
'demo/product_supplierinfo.xml',
59+
'demo/stock_quant.xml',
5960
'demo/sale_order.xml',
6061
'demo/sale_order_line.xml',
6162
'demo/sale_order_confirm.xml',
@@ -65,9 +66,6 @@
6566
'demo/purchase_order.xml',
6667
'demo/purchase_order_line.xml',
6768
'demo/purchase_order_confirm.xml',
68-
'demo/validate_deliveries.xml',
69-
'demo/validate_receipts.xml',
70-
'demo/stock_quant.xml',
7169
'demo/mail_activity.xml',
7270
'demo/delivery_carrier.xml',
7371
'demo/payment_provider_demo_post.xml',

beverage_distributor/data/knowledge_article.xml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,17 @@ Create a warehouse for each branch: Go to Inventory &gt; Configuration &gt; Ware
101101
<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>
102102
</div>
103103
</div>
104-
<p><strong>Excise reporting</strong></p>
105-
<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>
104+
<p><strong>Excise reports</strong></p>
105+
<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>
106+
<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">
107+
<i class="o_editor_banner_icon mb-3 fst-normal" data-oe-aria-label="Banner Info" aria-label="Banner Info">💡</i>
108+
<div class="o_editor_banner_content o-contenteditable-true w-100 px-3" contenteditable="true">
109+
<p>The assignee of the excise reporting activities can be set from the Inventory settings.</p>
110+
</div>
111+
</div>
106112
<ul>
107113
<li>
108-
<p>Open the <strong>Inventory app</strong> and reach from the Reporting menu the Excises.</p>
114+
<p>Open the <strong>Inventory app</strong> and reach the Excise Reports from the Reporting menu.</p>
109115
<ul>
110116
<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>
111117
<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>
@@ -122,13 +128,16 @@ Create a warehouse for each branch: Go to Inventory &gt; Configuration &gt; Ware
122128
</div>
123129
</div>
124130
<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>
131+
<p><strong>Excise reporting</strong></p>
132+
<p>On top of the legal reporting, you need as well to know at all time the quantity of excise submitted products in your fiscal deposit warehouses.</p>
133+
<ul>
134+
<li><p>Open the <strong>Inventory app</strong> and reach the Excise Reports from the Reporting menu.</p></li>
135+
<li><p>Rows come with the same move types detailed as the Excise Reports.</p></li>
136+
<li><p>The Total row allows you to capture your currently in fiscal deposit warehouse product quantity!</p></li>
137+
</ul>
125138
<p>You now have the keys to easily report those to the relevant authorities!</p>
126-
<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">
127-
<i class="o_editor_banner_icon mb-3 fst-normal" data-oe-aria-label="Banner Info" aria-label="Banner Info">💡</i>
128-
<div class="o_editor_banner_content o-contenteditable-true w-100 px-3" contenteditable="true">
129-
<p>The default breakdown is done by week and you can configure it to be by month if needed.</p>
130-
</div>
131-
</div>
139+
<p><a href="https://apps.odoo.com/apps/modules/19.0/excise_management" class="btn btn-outline-primary btn-sm" target="_blank">🎓 Excise Management</a></p>
140+
<p><br/></p>
132141
<h3>Sales Management 🍾</h3><p>Use the Sales app to:</p><ul>
133142
<li>Manage your product catalog</li>
134143
<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_reporter_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_21') +
33+
obj().env.ref('beverage_distributor.sale_order_25') +
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_21') +
40+
obj().env.ref('beverage_distributor.sale_order_25') +
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_21') +
47+
obj().env.ref('beverage_distributor.sale_order_25') +
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>

beverage_distributor/demo/stock_quant.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,74 +3,92 @@
33
<record id="product_quant_1" model="stock.quant">
44
<field name="product_id" ref="product_product_37"/>
55
<field name="inventory_quantity">0</field>
6+
<field name="location_id" search="[('warehouse_id', '=', ref('excise_management.stock_warehouse_fiscal_deposit')), ('child_ids', '=', False)]"/>
67
</record>
78
<record id="product_quant_2" model="stock.quant">
89
<field name="product_id" ref="product_product_7"/>
910
<field name="inventory_quantity">0</field>
11+
<field name="location_id" search="[('warehouse_id', '=', ref('excise_management.stock_warehouse_fiscal_deposit')), ('child_ids', '=', False)]"/>
1012
</record>
1113
<record id="product_quant_3" model="stock.quant">
1214
<field name="product_id" ref="product_product_39"/>
1315
<field name="inventory_quantity">0</field>
16+
<field name="location_id" search="[('warehouse_id', '=', ref('excise_management.stock_warehouse_fiscal_deposit')), ('child_ids', '=', False)]"/>
1417
</record>
1518
<record id="product_quant_4" model="stock.quant">
1619
<field name="product_id" ref="product_product_41"/>
1720
<field name="inventory_quantity">0</field>
21+
<field name="location_id" search="[('warehouse_id', '=', ref('excise_management.stock_warehouse_fiscal_deposit')), ('child_ids', '=', False)]"/>
1822
</record>
1923
<record id="product_quant_5" model="stock.quant">
2024
<field name="product_id" ref="product_product_43"/>
2125
<field name="inventory_quantity">0</field>
26+
<field name="location_id" search="[('warehouse_id', '=', ref('excise_management.stock_warehouse_fiscal_deposit')), ('child_ids', '=', False)]"/>
2227
</record>
2328
<record id="product_quant_6" model="stock.quant">
2429
<field name="product_id" ref="product_product_45"/>
2530
<field name="inventory_quantity">0</field>
31+
<field name="location_id" search="[('warehouse_id', '=', ref('excise_management.stock_warehouse_fiscal_deposit')), ('child_ids', '=', False)]"/>
2632
</record>
2733
<record id="product_quant_7" model="stock.quant">
2834
<field name="product_id" ref="product_product_47"/>
2935
<field name="inventory_quantity">0</field>
36+
<field name="location_id" search="[('warehouse_id', '=', ref('excise_management.stock_warehouse_fiscal_deposit')), ('child_ids', '=', False)]"/>
3037
</record>
3138
<record id="product_quant_8" model="stock.quant">
3239
<field name="product_id" ref="product_product_36"/>
3340
<field name="inventory_quantity">4</field>
41+
<field name="location_id" search="[('warehouse_id', '=', ref('excise_management.stock_warehouse_fiscal_deposit')), ('child_ids', '=', False)]"/>
3442
</record>
3543
<record id="product_quant_9" model="stock.quant">
3644
<field name="product_id" ref="product_product_6"/>
3745
<field name="inventory_quantity">0</field>
46+
<field name="location_id" search="[('warehouse_id', '=', ref('excise_management.stock_warehouse_fiscal_deposit')), ('child_ids', '=', False)]"/>
3847
</record>
3948
<record id="product_quant_10" model="stock.quant">
4049
<field name="product_id" search="[('product_tmpl_id', '=', ref('product_template_56'))]"/>
4150
<field name="inventory_quantity">0</field>
51+
<field name="location_id" search="[('warehouse_id', '=', ref('excise_management.stock_warehouse_fiscal_deposit')), ('child_ids', '=', False)]"/>
4252
</record>
4353
<record id="product_quant_11" model="stock.quant">
4454
<field name="product_id" search="[('product_tmpl_id', '=', ref('product_template_67'))]"/>
4555
<field name="inventory_quantity">40</field>
56+
<field name="location_id" search="[('warehouse_id', '=', ref('excise_management.stock_warehouse_fiscal_deposit')), ('child_ids', '=', False)]"/>
4657
</record>
4758
<record id="product_quant_12" model="stock.quant">
4859
<field name="product_id" search="[('product_tmpl_id', '=', ref('product_template_6'))]"/>
4960
<field name="inventory_quantity">0</field>
61+
<field name="location_id" search="[('warehouse_id', '=', ref('excise_management.stock_warehouse_fiscal_deposit')), ('child_ids', '=', False)]"/>
5062
</record>
5163
<record id="product_quant_13" model="stock.quant">
5264
<field name="product_id" search="[('product_tmpl_id', '=', ref('product_template_59'))]"/>
5365
<field name="inventory_quantity">50</field>
66+
<field name="location_id" search="[('warehouse_id', '=', ref('excise_management.stock_warehouse_fiscal_deposit')), ('child_ids', '=', False)]"/>
5467
</record>
5568
<record id="product_quant_14" model="stock.quant">
5669
<field name="product_id" search="[('product_tmpl_id', '=', ref('product_template_51'))]"/>
5770
<field name="inventory_quantity">10</field>
71+
<field name="location_id" search="[('warehouse_id', '=', ref('excise_management.stock_warehouse_fiscal_deposit')), ('child_ids', '=', False)]"/>
5872
</record>
5973
<record id="product_quant_15" model="stock.quant">
6074
<field name="product_id" search="[('product_tmpl_id', '=', ref('product_template_27'))]"/>
6175
<field name="inventory_quantity">10</field>
76+
<field name="location_id" search="[('warehouse_id', '=', ref('excise_management.stock_warehouse_fiscal_deposit')), ('child_ids', '=', False)]"/>
6277
</record>
6378
<record id="product_quant_16" model="stock.quant">
6479
<field name="product_id" search="[('product_tmpl_id', '=', ref('product_template_28'))]"/>
6580
<field name="inventory_quantity">10</field>
81+
<field name="location_id" search="[('warehouse_id', '=', ref('excise_management.stock_warehouse_fiscal_deposit')), ('child_ids', '=', False)]"/>
6682
</record>
6783
<record id="product_quant_17" model="stock.quant">
6884
<field name="product_id" search="[('product_tmpl_id', '=', ref('product_template_29'))]"/>
6985
<field name="inventory_quantity">10</field>
86+
<field name="location_id" search="[('warehouse_id', '=', ref('excise_management.stock_warehouse_fiscal_deposit')), ('child_ids', '=', False)]"/>
7087
</record>
7188
<record id="product_quant_18" model="stock.quant">
7289
<field name="product_id" search="[('product_tmpl_id', '=', ref('product_template_54'))]"/>
7390
<field name="inventory_quantity">10</field>
91+
<field name="location_id" search="[('warehouse_id', '=', ref('excise_management.stock_warehouse_fiscal_deposit')), ('child_ids', '=', False)]"/>
7492
</record>
7593
<function name="action_apply_inventory" model="stock.quant" eval="[[
7694
ref('product_quant_1'),

beverage_distributor/demo/validate_deliveries.xml

Lines changed: 0 additions & 17 deletions
This file was deleted.

beverage_distributor/demo/validate_receipts.xml

Lines changed: 0 additions & 11 deletions
This file was deleted.

excise_management/__manifest__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
'name': 'Excise Management',
3-
'version': '2.2',
3+
'version': '2.3',
44
'category': 'Inventory/Inventory',
55
'author': 'Odoo S.A.',
66
'depends': [
@@ -13,11 +13,11 @@
1313
'data': [
1414
'data/ir_model.xml',
1515
'data/ir_model_fields.xml',
16+
'data/ir_actions_server.xml',
1617
'data/ir_ui_view.xml',
1718
'data/qweb_view.xml',
1819
'data/ir_actions_act_window.xml',
1920
'data/account_tax_group.xml',
20-
'data/ir_actions_server.xml',
2121
'data/ir_ui_menu.xml',
2222
'data/base_automation.xml',
2323
'data/ir_model_access.xml',

excise_management/data/base_automation.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,17 @@
2727
<field name="trigger">on_create_or_write</field>
2828
<field name="trigger_field_ids" eval="[(6, 0, [ref('account.field_account_tax__tax_group_id')])]"/>
2929
</record>
30+
<record id="base_automation_create_excise_report_line" model="base.automation">
31+
<field name="model_id" ref="excise_report"/>
32+
<field name="action_server_ids" eval="[(6, 0, [ref('ir_action_create_excise_report_line')])]"/>
33+
<field name="trigger">on_create</field>
34+
<field name="name">Create Excise Report Line</field>
35+
</record>
36+
<record id="base_automation_update_excise_report_line_onupdate_stock_move" model="base.automation">
37+
<field name="model_id" ref="stock.model_stock_move"/>
38+
<field name="action_server_ids" eval="[(6, 0, [ref('ir_action_update_excise_report_line_onupdate_stock_move')])]"/>
39+
<field name="trigger">on_create_or_write</field>
40+
<field name="name">Update Excise line: when changing state and date</field>
41+
<field name="trigger_field_ids" eval="[(6, 0, [ref('stock.field_stock_move__date'), ref('stock.field_stock_move__state')])]"/>
42+
</record>
3043
</odoo>

0 commit comments

Comments
 (0)