Skip to content

Commit

Permalink
[MIG] default_warehouse_from_sale_team: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
IrvingReyes committed Jan 29, 2025
1 parent 00fc9e2 commit 80a3404
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion default_warehouse_from_sale_team/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"website": "http://www.vauxoo.com",
"license": "LGPL-3",
"category": "Inventory/Inventory",
"version": "17.0.1.0.0",
"version": "18.0.1.0.0",
"depends": [
"sale_stock",
"purchase_requisition",
Expand Down
2 changes: 1 addition & 1 deletion default_warehouse_from_sale_team/models/ir_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def next_by_code(self, sequence_code, sequence_date=None):
if "sequence_salesteam_id" not in self.env.context:
return super().next_by_code(sequence_code, sequence_date)
salesteam_id = self.env.context["sequence_salesteam_id"]
self.check_access_rights("read")
self.check_access("read")
company_id = self.env.company.id
sequence = self.search(
[
Expand Down
4 changes: 2 additions & 2 deletions default_warehouse_from_sale_team/models/res_users.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from odoo import _, api, fields, models
from odoo import api, fields, models
from odoo.exceptions import ValidationError


Expand All @@ -22,7 +22,7 @@ def _check_section_id(self):
user_wrong_team = self.filtered(lambda u: u.sale_team_id - u.sale_team_ids)
if user_wrong_team:
raise ValidationError(
_(
self.env._(
"The chosen team (%s) is not in the allowed sales teams for this user",
user_wrong_team[0].sale_team_id.name,
)
Expand Down
2 changes: 1 addition & 1 deletion default_warehouse_from_sale_team/models/stock_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class StockPicking(models.Model):
@api.depends_context("uid")
def _compute_is_editable(self):
# Using intersection operator to keep original env
editable_records = self & self._filter_access_rules_python("write")
editable_records = self & self._filtered_access("write")
editable_records.is_editable = True
(self - editable_records).is_editable = False

Expand Down
2 changes: 1 addition & 1 deletion default_warehouse_from_sale_team/models/stock_warehouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def _access_unallowed_current_user_salesteams(self):
return (
warehouses
and not self.env.su
and warehouses.check_access_rights("read", raise_exception=False)
and warehouses.check_access("read", raise_exception=False)
and failed_rules
and not failed_rules - allowed_rules
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form" />
<field name="arch" type="xml">
<field name="show_reserved" position="after">
<field name="is_editable" invisible="True" />
</field>
<button name="action_confirm" position="attributes">
<attribute name="invisible" add="not is_editable" separator=" or " />
</button>
Expand Down

0 comments on commit 80a3404

Please sign in to comment.