Browse Source

[IMP] account_tax_balance: black, isort, prettier

pull/736/head
Francisco Ivan Anton Prieto 4 years ago
parent
commit
1eb15ff81e
  1. 4
      account_tax_balance/hooks.py
  2. 2
      account_tax_balance/models/account_tax.py
  3. 8
      account_tax_balance/wizard/open_tax_balances_view.xml
  4. 1
      setup/account_tax_balance/odoo/addons/account_tax_balance
  5. 6
      setup/account_tax_balance/setup.py

4
account_tax_balance/hooks.py

@ -7,11 +7,11 @@ from psycopg2 import sql
def pre_init_hook(cr): def pre_init_hook(cr):
""" Precreate move_type and fill with appropriate values to prevent
"""Precreate move_type and fill with appropriate values to prevent
a MemoryError when the ORM attempts to call its compute method on a large a MemoryError when the ORM attempts to call its compute method on a large
amount of preexisting moves. Note that the order of the mapping is amount of preexisting moves. Note that the order of the mapping is
important as one move can have move lines on accounts of multiple types important as one move can have move lines on accounts of multiple types
and the move type is set in the order of precedence. """
and the move type is set in the order of precedence."""
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
logger.info("Add account_move.move_type column if it does not yet exist") logger.info("Add account_move.move_type column if it does not yet exist")
cr.execute("ALTER TABLE account_move ADD COLUMN IF NOT EXISTS move_type VARCHAR") cr.execute("ALTER TABLE account_move ADD COLUMN IF NOT EXISTS move_type VARCHAR")

2
account_tax_balance/models/account_tax.py

@ -35,7 +35,7 @@ class AccountTax(models.Model):
) )
def _account_tax_ids_with_moves(self): def _account_tax_ids_with_moves(self):
""" Return all account.tax ids for which there is at least
"""Return all account.tax ids for which there is at least
one account.move.line in the context period one account.move.line in the context period
for the user company. for the user company.

8
account_tax_balance/wizard/open_tax_balances_view.xml

@ -18,15 +18,15 @@
<field name="target_move" /> <field name="target_move" />
</group> </group>
<footer> <footer>
<button
<button
string="Open Taxes" string="Open Taxes"
name="open_taxes" name="open_taxes"
type="object" type="object"
class="oe_highlight" class="oe_highlight"
/> />
or
<button string="Cancel" class="oe_link" special="cancel" />
</footer>
or
<button string="Cancel" class="oe_link" special="cancel" />
</footer>
</form> </form>
</field> </field>
</record> </record>

1
setup/account_tax_balance/odoo/addons/account_tax_balance

@ -0,0 +1 @@
../../../../account_tax_balance

6
setup/account_tax_balance/setup.py

@ -0,0 +1,6 @@
import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
Loading…
Cancel
Save