Skip to content
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

[MIG] account_multi_store: Migration to 18.0 #64

Open
wants to merge 2 commits into
base: 18.0
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions account_multi_store/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
##############################################################################
{
'name': 'Multi Store for Accounting',
'version': "17.0.1.1.0",
'version': "18.0.1.1.0",
'category': 'Accounting',
'sequence': 14,
'summary': '',
Expand All @@ -45,7 +45,7 @@
# 'demo/account_demo.xml',
'demo/res_store_demo.xml',
],
'installable': False,
'installable': True,
'auto_install': True,
'application': False,
}
4 changes: 2 additions & 2 deletions account_multi_store/models/account_journal.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class AccountJournal(models.Model):
)

@api.model
def _search(self, args, offset=0, limit=None, order=None, access_rights_uid=None):
def _search(self, args, offset=0, limit=None, order=None):
"""
Para que los usuarios no puedan elegir diarios donde no puedan
escribir, modificamos la funcion search. No lo hacemos por regla de
Expand All @@ -28,4 +28,4 @@ def _search(self, args, offset=0, limit=None, order=None, access_rights_uid=None
# if superadmin, do not apply
if not self.env.is_superuser():
args += ['|', ('store_id', '=', False), ('store_id', 'child_of', [user.store_id.id])]
return super()._search(args, offset, limit, order, access_rights_uid=access_rights_uid)
return super()._search(args, offset, limit, order)
2 changes: 1 addition & 1 deletion account_multi_store/views/res_store_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class="oe_inline oe_stat_button"
name="%(account.action_account_journal_form)d"
type="action"
context="{'search_default_store_id': active_id}"
context="{'search_default_store_id': id}"
icon="fa-money">
<field name="journals_count" widget="statinfo"/>
</button>
Expand Down
4 changes: 2 additions & 2 deletions base_multi_store/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
##############################################################################
{
'name': 'Multi Stores Management',
'version': "17.0.1.0.0",
'version': "18.0.1.0.0",
'category': 'Accounting',
'sequence': 14,
'summary': '',
Expand All @@ -40,7 +40,7 @@
'demo': [
'demo/res_store_demo.xml',
],
'installable': False,
'installable': True,
'auto_install': False,
'application': True,
}
2 changes: 0 additions & 2 deletions base_multi_store/demo/res_store_demo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@

<record id="rosario_store" model="res.store">
<field name="name">Rosario</field>
<field name="parent_id" ref="main_company_stores"/>
<field name="company_id" ref="base.main_company"/>
</record>

<record id="buenos_aires_store" model="res.store">
<field name="name">Buenos Aires</field>
<field name="parent_id" ref="main_company_stores"/>
<field name="company_id" ref="base.main_company"/>
</record>

Expand Down
2 changes: 1 addition & 1 deletion base_multi_store/models/res_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class ResStore(models.Model):
@api.constrains('parent_id')
def _check_parent_id(self):
for rec in self:
if not rec._check_recursion():
if rec._has_cycle():
raise ValidationError(
_('Error! You can not create recursive stores.'))

Expand Down
8 changes: 4 additions & 4 deletions base_multi_store/views/res_store_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<odoo>
<!-- Tree -->
<record id="view_res_store_tree" model="ir.ui.view">
<field name="name">res.store.tree</field>
<field name="name">res.store.list</field>
<field name="model">res.store</field>
<field name="arch" type="xml">
<tree string="Stores">
<list string="Stores">
<field name="name"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="parent_id"/>
</tree>
</list>
</field>
</record>

Expand Down Expand Up @@ -48,7 +48,7 @@
<field name="name">Stores</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.store</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">list,form</field>
<field name="domain"></field>
</record>

Expand Down