mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
Merge pull request #487 from acsone/10.0-account_move_line_tax_editable-bwi
[10.0][ADD] Module to allow account move line taxes edition
This commit is contained in:
41
account_move_line_tax_editable/README.rst
Normal file
41
account_move_line_tax_editable/README.rst
Normal file
@@ -0,0 +1,41 @@
|
||||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
|
||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||
:alt: License: AGPL-3
|
||||
|
||||
==============================
|
||||
Account Move Line Tax Editable
|
||||
==============================
|
||||
|
||||
Allows to edit taxes on account move lines
|
||||
|
||||
Bug Tracker
|
||||
===========
|
||||
|
||||
Bugs are tracked on `GitHub Issues
|
||||
<https://github.com/OCA/{project_repo}/issues>`_. In case of trouble, please
|
||||
check there if your issue has already been reported. If you spotted it first,
|
||||
help us smashing it by providing a detailed and welcomed feedback.
|
||||
|
||||
Credits
|
||||
=======
|
||||
|
||||
Contributors
|
||||
------------
|
||||
|
||||
* Thomas Binsfeld <thomas.binsfeld@acsone.eu>
|
||||
* Benjamin Willig <benjamin.willig@acsone.eu>
|
||||
|
||||
Maintainer
|
||||
----------
|
||||
|
||||
.. image:: https://odoo-community.org/logo.png
|
||||
:alt: Odoo Community Association
|
||||
:target: https://odoo-community.org
|
||||
|
||||
This module is maintained by the OCA.
|
||||
|
||||
OCA, or the Odoo Community Association, is a nonprofit organization whose
|
||||
mission is to support the collaborative development of Odoo features and
|
||||
promote its widespread use.
|
||||
|
||||
To contribute to this module, please visit https://odoo-community.org.
|
||||
1
account_move_line_tax_editable/__init__.py
Normal file
1
account_move_line_tax_editable/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import models
|
||||
22
account_move_line_tax_editable/__manifest__.py
Normal file
22
account_move_line_tax_editable/__manifest__.py
Normal file
@@ -0,0 +1,22 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2017 ACSONE SA/NV
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
'name': 'Account Move Line Tax Editable',
|
||||
'summary': """
|
||||
Allows to edit taxes on non-posted account move lines""",
|
||||
'version': '10.0.1.0.0',
|
||||
'license': 'AGPL-3',
|
||||
'author': 'ACSONE SA/NV,Odoo Community Association (OCA)',
|
||||
'website': 'https://www.acsone.eu',
|
||||
'depends': [
|
||||
'account',
|
||||
],
|
||||
'data': [
|
||||
'views/account_move.xml',
|
||||
'views/account_move_line.xml',
|
||||
],
|
||||
'demo': [
|
||||
],
|
||||
}
|
||||
1
account_move_line_tax_editable/models/__init__.py
Normal file
1
account_move_line_tax_editable/models/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import account_move_line
|
||||
24
account_move_line_tax_editable/models/account_move_line.py
Normal file
24
account_move_line_tax_editable/models/account_move_line.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2017 ACSONE SA/NV
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class AccountMoveLine(models.Model):
|
||||
|
||||
_inherit = 'account.move.line'
|
||||
|
||||
is_tax_editable = fields.Boolean(
|
||||
string="Is tax data editable?", compute='_compute_is_tax_editable')
|
||||
|
||||
@api.multi
|
||||
@api.depends('move_id.state')
|
||||
def _compute_is_tax_editable(self):
|
||||
for rec in self:
|
||||
rec.is_tax_editable = rec._get_is_tax_editable()
|
||||
|
||||
@api.multi
|
||||
def _get_is_tax_editable(self):
|
||||
self.ensure_one()
|
||||
return self.move_id.state == 'draft'
|
||||
BIN
account_move_line_tax_editable/static/description/icon.png
Normal file
BIN
account_move_line_tax_editable/static/description/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.2 KiB |
23
account_move_line_tax_editable/views/account_move.xml
Normal file
23
account_move_line_tax_editable/views/account_move.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright 2017 ACSONE SA/NV
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
||||
|
||||
<odoo>
|
||||
<data>
|
||||
|
||||
<record model="ir.ui.view" id="account_move_form_view">
|
||||
<field name="name">account.move.form (in account_move_line_tax_editable)</field>
|
||||
<field name="model">account.move</field>
|
||||
<field name="inherit_id" ref="account.view_move_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='line_ids']/tree/field[@name='name']" position="after">
|
||||
<field name="is_tax_editable" invisible="1"/>
|
||||
<field name="tax_line_id" attrs="{'readonly': [('is_tax_editable', '=', False)]}"/>
|
||||
<field name="tax_ids" attrs="{'readonly': [('is_tax_editable', '=', False)]}"
|
||||
widget="many2many_tags"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
28
account_move_line_tax_editable/views/account_move_line.xml
Normal file
28
account_move_line_tax_editable/views/account_move_line.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright 2017 ACSONE SA/NV
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
||||
|
||||
<odoo>
|
||||
<data>
|
||||
|
||||
<record model="ir.ui.view" id="account_move_line_form_view">
|
||||
<field name="name">account.move.line.form (in account_move_line_tax_editable)</field>
|
||||
<field name="model">account.move.line</field>
|
||||
<field name="inherit_id" ref="account.view_move_line_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="tax_line_id" position="before">
|
||||
<field name="is_tax_editable" invisible="1"/>
|
||||
</field>
|
||||
<field name="tax_line_id" position="attributes">
|
||||
<attribute name="readonly">0</attribute>
|
||||
<attribute name="attrs">{'readonly': [('is_tax_editable', '=', False)]}</attribute>
|
||||
</field>
|
||||
<field name="tax_ids" position="attributes">
|
||||
<attribute name="readonly">0</attribute>
|
||||
<attribute name="attrs">{'readonly': [('is_tax_editable', '=', False)]}</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
1
setup/account_move_line_tax_editable/odoo/__init__.py
Normal file
1
setup/account_move_line_tax_editable/odoo/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
__import__('pkg_resources').declare_namespace(__name__)
|
||||
@@ -0,0 +1 @@
|
||||
__import__('pkg_resources').declare_namespace(__name__)
|
||||
@@ -0,0 +1 @@
|
||||
../../../../account_move_line_tax_editable
|
||||
6
setup/account_move_line_tax_editable/setup.py
Normal file
6
setup/account_move_line_tax_editable/setup.py
Normal file
@@ -0,0 +1,6 @@
|
||||
import setuptools
|
||||
|
||||
setuptools.setup(
|
||||
setup_requires=['setuptools-odoo'],
|
||||
odoo_addon=True,
|
||||
)
|
||||
Reference in New Issue
Block a user