-
Couldn't load subscription status.
- Fork 83
[IMP] excise_management : Deposit & excise totals by line #1214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dhrs-odoo
wants to merge
5
commits into
odoo:19.0
Choose a base branch
from
odoo-dev:19.0-excise_management-update-dhrs
base: 19.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0695fa1
[IMP] excise_management: deposit and excise totals
dhrs-odoo 5b10a5f
[IMP] .*: made x_is_deposit enabled for deposit tax
dhrs-odoo 611c613
[IMP] excise_management: invoice report
dhrs-odoo 75f423a
[IMP] excise_management: automation rule for sequence
dhrs-odoo 1c12848
[IMP] excise_management: code review update
dhrs-odoo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -257,4 +257,126 @@ for template in self: | |
| <field name="relation">uom.uom</field> | ||
| <field name="readonly" eval="True"/> | ||
| </record> | ||
| <record id="account_tax_deposit_field" model="ir.model.fields"> | ||
| <field name="name">x_is_deposit</field> | ||
| <field name="field_description">Is Deposit</field> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is already a similar field on account.tax.group. But it is hidden. Maybe we should just display this one instead, and use when needed. |
||
| <field name="model_id" ref="account.model_account_tax"/> | ||
| <field name="ttype">boolean</field> | ||
| </record> | ||
| <record id="sale_order_line_excise_free_unit_price_field" model="ir.model.fields"> | ||
| <field name="name">x_excise_free_unit_price</field> | ||
| <field name="field_description">Excise Free Unit Price</field> | ||
| <field name="model_id" ref="sale.model_sale_order_line"/> | ||
| <field name="ttype">monetary</field> | ||
| <field name="depends">price_unit, product_id</field> | ||
| <field name="compute"><![CDATA[for record in self: | ||
| record['x_excise_free_unit_price'] = record.price_unit - record.product_id.x_excise_amount]]></field> | ||
| <field name="readonly" eval="True"/> | ||
| <field name="store" eval="False"/> | ||
| <field name="currency_field">currency_id</field> | ||
| </record> | ||
| <record id="sale_order_line_total_excises_field" model="ir.model.fields"> | ||
| <field name="name">x_total_excises</field> | ||
| <field name="field_description">Excises</field> | ||
| <field name="model_id" ref="sale.model_sale_order_line"/> | ||
| <field name="ttype">monetary</field> | ||
| <field name="depends">product_id, product_uom_qty, order_id.fiscal_position_id</field> | ||
| <field name="compute"><![CDATA[for record in self: | ||
| record['x_total_excises'] = record.product_id.x_excise_amount * record.product_uom_qty if not record.order_id.fiscal_position_id.x_is_fiscal_deposit else False]]></field> | ||
| <field name="readonly" eval="True"/> | ||
| <field name="currency_field">currency_id</field> | ||
| </record> | ||
| <record id="sale_order_line_total_deposits_field" model="ir.model.fields"> | ||
| <field name="name">x_total_deposits</field> | ||
| <field name="field_description">Deposits</field> | ||
| <field name="ttype">monetary</field> | ||
| <field name="model_id" ref="sale.model_sale_order_line"/> | ||
| <field name="depends">product_uom_qty, tax_ids</field> | ||
| <field name="compute"><![CDATA[for record in self: | ||
| deposit = sum(tax.amount for tax in record.tax_ids if tax.x_is_deposit) | ||
| record['x_total_deposits'] = deposit * record.product_uom_qty]]></field> | ||
| <field name="readonly" eval="True"/> | ||
| <field name="store" eval="False"/> | ||
| <field name="currency_field">currency_id</field> | ||
| </record> | ||
| <record id="sale_order_has_deposit_line_field" model="ir.model.fields"> | ||
| <field name="name">x_has_deposit_line</field> | ||
| <field name="field_description">Has Deposit Line</field> | ||
| <field name="model_id" ref="sale.model_sale_order"/> | ||
| <field name="ttype">boolean</field> | ||
| <field name="depends">order_line.x_total_deposits</field> | ||
| <field name="compute"><![CDATA[ | ||
| for record in self: | ||
| record['x_has_deposit_line'] = any(line.x_total_deposits for line in record.order_line)]]></field> | ||
| <field name="store" eval="False"/> | ||
| </record> | ||
|
|
||
| <record id="sale_order_has_excise_line_field" model="ir.model.fields"> | ||
| <field name="name">x_has_excise_line</field> | ||
| <field name="field_description">Has Excise Line</field> | ||
| <field name="model_id" ref="sale.model_sale_order"/> | ||
| <field name="ttype">boolean</field> | ||
| <field name="depends">order_line.x_total_excises</field> | ||
| <field name="compute"><![CDATA[ | ||
| for record in self: | ||
| record['x_has_excise_line'] = any(line.x_total_excises for line in record.order_line)]]></field> | ||
| <field name="store" eval="False"/> | ||
| </record> | ||
| <record id="account_move_line_excise_free_unit_price_field" model="ir.model.fields"> | ||
| <field name="name">x_excise_free_unit_price_account_move</field> | ||
| <field name="field_description">Excise Free Unit Price</field> | ||
| <field name="ttype">monetary</field> | ||
| <field name="model_id" ref="account.model_account_move_line"/> | ||
| <field name="depends">price_unit, tax_ids</field> | ||
| <field name="compute"><![CDATA[for record in self: | ||
| record['x_excise_free_unit_price_account_move'] = record.price_unit - record.product_id.x_excise_amount]]></field> | ||
| <field name="readonly" eval="True"/> | ||
| <field name="currency_field">company_currency_id</field> | ||
| </record> | ||
| <record id="account_move_line_total_excise_field" model="ir.model.fields"> | ||
| <field name="name">x_total_excises_account_move</field> | ||
| <field name="field_description">Excises</field> | ||
| <field name="model_id" ref="account.model_account_move_line"/> | ||
| <field name="ttype">monetary</field> | ||
| <field name="depends">product_id, quantity</field> | ||
| <field name="compute"><![CDATA[for record in self: | ||
| record['x_total_excises_account_move'] = record.product_id.x_excise_amount * record.quantity if not record.sale_line_ids.order_id.fiscal_position_id.x_is_fiscal_deposit else False]]></field> | ||
| <field name="readonly" eval="True"/> | ||
| <field name="currency_field">company_currency_id</field> | ||
| </record> | ||
| <record id="account_move_line_total_deposits_field" model="ir.model.fields"> | ||
| <field name="name">x_total_deposits_account_move</field> | ||
| <field name="field_description">Deposits</field> | ||
| <field name="model_id" ref="account.model_account_move_line"/> | ||
| <field name="ttype">monetary</field> | ||
| <field name="depends">price_unit, tax_ids.x_is_deposit, quantity</field> | ||
| <field name="compute"><![CDATA[for record in self: | ||
| deposit = sum(tax.amount for tax in record.tax_ids if tax.x_is_deposit) | ||
| record['x_total_deposits_account_move'] = deposit * record.quantity]]></field> | ||
| <field name="readonly" eval="True"/> | ||
| <field name="currency_field">company_currency_id</field> | ||
| </record> | ||
| <record id="account_move_has_deposit_line_field" model="ir.model.fields"> | ||
| <field name="name">x_has_deposit_line</field> | ||
| <field name="field_description">Has Deposit Line</field> | ||
| <field name="model_id" ref="account.model_account_move"/> | ||
| <field name="ttype">boolean</field> | ||
| <field name="depends">line_ids.x_total_deposits_account_move</field> | ||
| <field name="compute"><![CDATA[ | ||
| for record in self: | ||
| record['x_has_deposit_line'] = any(line.x_total_deposits_account_move for line in record.line_ids)]]></field> | ||
| <field name="store" eval="False"/> | ||
| </record> | ||
|
|
||
| <record id="account_move_has_excise_line_field" model="ir.model.fields"> | ||
| <field name="name">x_has_excise_line</field> | ||
| <field name="field_description">Has Excise Line</field> | ||
| <field name="model_id" ref="account.model_account_move"/> | ||
| <field name="ttype">boolean</field> | ||
| <field name="depends">line_ids.x_total_excises_account_move</field> | ||
| <field name="compute"><![CDATA[ | ||
| for record in self: | ||
| record['x_has_excise_line'] = any(line.x_total_excises_account_move for line in record.line_ids)]]></field> | ||
| <field name="store" eval="False"/> | ||
| </record> | ||
| </odoo> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| <?xml version='1.0' encoding='UTF-8'?> | ||
| <odoo> | ||
| <template id="report_saleorder_custom_inherit" inherit_id="sale.report_saleorder_document"> | ||
| <xpath expr="//t[@t-set='display_taxes']" position="after"> | ||
| <t t-set="display_excise_free_unit_price" t-value="any(l.x_excise_free_unit_price for l in lines_to_report)"/> | ||
| <t t-set="display_total_excises" t-value="any(l.x_total_excises for l in lines_to_report)"/> | ||
| <t t-set="display_total_deposits" t-value="any(l.x_total_deposits for l in lines_to_report)"/> | ||
| </xpath> | ||
|
|
||
| <xpath expr="//th[@name='th_taxes']" position="after"> | ||
| <th name="th_excise_free_unit_price" t-if="display_excise_free_unit_price" class="text-end"> | ||
| <span>Excise Free Unit Price</span> | ||
| </th> | ||
| <th name="th_total_excises" t-if="display_total_excises" class="text-end"> | ||
| <span>Total Excises</span> | ||
| </th> | ||
| <th name="th_total_deposits" t-if="display_total_deposits" class="text-end"> | ||
| <span>Total Deposits</span> | ||
| </th> | ||
| </xpath> | ||
|
|
||
| <xpath expr="//tr[@name='tr_product']/td[@name='td_product_taxes']" position="after"> | ||
| <td name="td_excise_free_unit_price" t-if="display_excise_free_unit_price" class="text-end"> | ||
| <span t-field="line.x_excise_free_unit_price" t-options="{'widget': 'float', 'precision': 2}" t-if="line.x_excise_free_unit_price"/> | ||
| </td> | ||
| <td name="td_display_total_excises" t-if="display_total_excises" class="text-end"> | ||
| <span t-field="line.x_total_excises" t-options="{'widget': 'float', 'precision': 2}" t-if="line.x_total_excises"/> | ||
| </td> | ||
| <td name="td_display_total_deposits" t-if="display_total_deposits" class="text-end"> | ||
| <span t-field="line.x_total_deposits" t-options="{'widget': 'float', 'precision': 2}" t-if="line.x_total_deposits"/> | ||
| </td> | ||
| </xpath> | ||
| </template> | ||
|
|
||
| <template id="report_invoice_document_inherit_custom" inherit_id="account.report_invoice_document"> | ||
| <xpath expr="//t[@t-set='display_taxes']" position="after"> | ||
| <t t-set="display_excise_free_unit_price" t-value="any(l.x_excise_free_unit_price_account_move for l in o.invoice_line_ids)"/> | ||
| <t t-set="display_total_excises" t-value="any(l.x_total_excises_account_move for l in o.invoice_line_ids)"/> | ||
| <t t-set="display_total_deposits" t-value="any(l.x_total_deposits_account_move for l in o.invoice_line_ids)"/> | ||
| </xpath> | ||
|
|
||
| <xpath expr="//th[@name='th_taxes']" position="after"> | ||
| <th name="th_excise_free_unit_price" t-if="display_excise_free_unit_price" | ||
| t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"> | ||
| <span>Excise Free Unit Price</span> | ||
| </th> | ||
| <th name="th_total_excises" t-if="display_total_excises" | ||
| t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"> | ||
| <span>Total Excises</span> | ||
| </th> | ||
| <th name="th_total_deposits" t-if="display_total_deposits" | ||
| t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"> | ||
| <span>Total Deposits</span> | ||
| </th> | ||
| </xpath> | ||
|
|
||
| <xpath expr="//td[@name='td_taxes']" position="after"> | ||
| <td name="td_excise_free_unit_price" t-if="display_excise_free_unit_price" | ||
| t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"> | ||
| <span t-out="line.x_excise_free_unit_price_account_move" | ||
| id="line_x_excise_free_unit_price_account_move" t-options="{'widget': 'float', 'precision': 2}" t-if="line.x_excise_free_unit_price_account_move"/> | ||
| </td> | ||
| <td name="td_display_total_excises" t-if="display_total_excises" | ||
| t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"> | ||
| <span t-out="line.x_total_excises_account_move" id="line_x_total_excises_account_move" t-options="{'widget': 'float', 'precision': 2}" t-if="line.x_total_excises_account_move"/> | ||
| </td> | ||
| <td name="td_display_total_deposits" t-if="display_total_deposits" | ||
| t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"> | ||
| <span t-out="line.x_total_deposits_account_move" id="line_x_total_deposits_account_move" t-options="{'widget': 'float', 'precision': 2}" t-if="line.x_total_deposits_account_move"/> | ||
| </td> | ||
| </xpath> | ||
| </template> | ||
| </odoo> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you bump the minor version of all modules?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all please