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] purchase_multi_store: Migration to 18.0 #66

Open
wants to merge 3 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/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)
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
6 changes: 3 additions & 3 deletions purchase_multi_store/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
##############################################################################
{
'name': 'Multi Store for Purchase',
'version': "17.0.1.0.0",
'version': "18.0.1.0.0",
'category': 'Accounting',
'sequence': 14,
'summary': '',
Expand All @@ -30,15 +30,15 @@
],
'depends': [
'purchase_stock',
'base_multi_store',
'stock_multi_store',
],
'data': [
'views/purchase_order_views.xml',
'security/multi_store_security.xml',
],
'demo': [
],
'installable': False,
'installable': True,
'auto_install': True,
'application': False,
}
4 changes: 2 additions & 2 deletions stock_multi_store/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
##############################################################################
{
'name': 'Multi Store for Warehouse',
'version': "17.0.1.0.0",
'version': "18.0.1.0.0",
'category': 'Accounting',
'sequence': 14,
'summary': '',
Expand All @@ -44,7 +44,7 @@
],
'test': [
],
'installable': False,
'installable': True,
'auto_install': True,
'application': False,
}
4 changes: 2 additions & 2 deletions stock_multi_store/models/stock_picking_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def write(self, vals):
return super().write(vals)

@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 pickings donde no puedan
escribir, modificamos la funcion search. No lo hacemos por regla de
Expand All @@ -30,4 +30,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)
4 changes: 2 additions & 2 deletions stock_multi_store/models/stock_warehouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def write(self, vals):
return super().write(vals)

@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 almacenes donde no puedan
escribir, modificamos la funcion search. No lo hacemos por regla de
Expand All @@ -34,4 +34,4 @@ def _search(self, args, offset=0, limit=None, order=None, access_rights_uid=None
# we use limit to control if the call is calling from a interface, and if not we need to not restring the domain
if limit and 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 stock_multi_store/views/res_store_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class="oe_inline oe_stat_button"
name="%(stock.action_warehouse_form)d"
type="action"
context="{'search_default_store_id': active_id}"
context="{'search_default_store_id': id}"
icon="fa-home">
<field name="warehouses_count" widget="statinfo"/>
</button>
Expand Down