Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions accounting_update/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
9 changes: 9 additions & 0 deletions accounting_update/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "Account Update",
"author": "Shrey Patel",
"depends": ["l10n_in_edi"],
"license": "LGPL-3",
"data": [
"views/accounting_move_views.xml",
],
}
2 changes: 2 additions & 0 deletions accounting_update/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import account_move
from . import account_move_line
13 changes: 13 additions & 0 deletions accounting_update/models/account_move.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from odoo import models


class AccountMove(models.Model):
_inherit = "account.move"

def _get_l10n_in_edi_line_details(self, index, line, line_tax_details):
line_details = super()._get_l10n_in_edi_line_details(
index, line, line_tax_details
)
if line.is_zero_qty:
line_details["Qty"] = 0.0
return line_details
7 changes: 7 additions & 0 deletions accounting_update/models/account_move_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from odoo import models, fields


class AccountMoveLine(models.Model):
_inherit = "account.move.line"

is_zero_qty = fields.Boolean()
15 changes: 15 additions & 0 deletions accounting_update/views/accounting_move_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<odoo>
<record id="view_move_form" model="ir.ui.view">
<field name="name">account.move.form.inherit.accounting_update</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="arch" type="xml">
<xpath expr="//list[@name='journal_items']/field[@name='tax_ids']" position="after">
<field name="is_zero_qty" optional="show" column_invisible="parent.move_type not in ('out_invoice', 'out_refund')"/>
</xpath>
<xpath expr="//field[@name='invoice_line_ids']/form//field[@name='tax_ids']" position="after">
<field name="is_zero_qty" optional="show" column_invisible="parent.move_type not in ('out_invoice', 'out_refund')"/>
</xpath>
</field>
</record>
</odoo>