Skip to content

Commit

Permalink
[MIG] l10n_ar_stock: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mem-adhoc committed Feb 16, 2024
1 parent b250820 commit 4291e38
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
4 changes: 2 additions & 2 deletions l10n_ar_stock/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
'name': 'Remitos, COT y demas ajustes de stock para Argentina',
'version': "16.0.1.5.0",
'version': "17.0.1.0.0",
'category': 'Localization/Argentina',
'sequence': 14,
'author': 'ADHOC SA',
Expand Down Expand Up @@ -31,7 +31,7 @@
'demo/stock_book_demo.xml',
'demo/stock_picking_demo.xml',
],
'installable': False,
'installable': True,
'auto_install': False,
'application': False,
}
20 changes: 9 additions & 11 deletions l10n_ar_stock/models/account_chart_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,18 @@
# directory
##############################################################################
from odoo import models, api
from odoo.addons.account.models.chart_template import template


class AccountChartTemplate(models.Model):
class AccountChartTemplate(models.AbstractModel):
_inherit = 'account.chart.template'

def _load_template(
self, company, code_digits=None,
account_ref=None, taxes_ref=None):
self.ensure_one()
if company.country_id == self.env.ref('base.ar'):
self.generate_stock_book(company)
return super(AccountChartTemplate, self)._load_template(
company, code_digits,
account_ref, taxes_ref)
@template(model='stock.book')
def _get_stock_book(self, template_code):
if template_code not in ['ar_ri', 'ar_ex', 'ar_base']:
return {}
else:
#TODO mejorar
return self.generate_stock_book(template_code)

@api.model
def generate_stock_book(self, company):
Expand Down

0 comments on commit 4291e38

Please sign in to comment.