Skip to content

Commit

Permalink
[MIG] Migrate website_sale_multic_ux to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
maq-adhoc committed May 5, 2023
1 parent 3d30146 commit c626691
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 4 deletions.
7 changes: 5 additions & 2 deletions payment_multic_ux/models/account_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ class AccountPayment(models.Model):
def create(self, val_list):
force_company = self.env.context.get('force_company_id')
if force_company:
for vals in val_list:
vals['company_id'] = force_company
if isinstance(val_list, list):
for vals in val_list:
vals['company_id'] = force_company
else:
val_list['company_id'] = force_company
return super().create(val_list)
1 change: 1 addition & 0 deletions website_sale_multic_ux/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from . import controllers
from . import models
4 changes: 2 additions & 2 deletions website_sale_multic_ux/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
##############################################################################
{
'name': 'Website Sale Multicompany Usability',
'version': "15.0.1.1.0",
'version': "16.0.1.0.0",
'author': 'ADHOC SA',
'website': 'www.adhoc.com.ar',
'license': 'AGPL-3',
Expand All @@ -29,6 +29,6 @@
],
'data': [],
'demo': [],
'installable': False,
'installable': True,
'auto_install': False,
}
2 changes: 2 additions & 0 deletions website_sale_multic_ux/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import website
from . import sale_order
15 changes: 15 additions & 0 deletions website_sale_multic_ux/models/sale_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################

from odoo import models, fields


class SaleOrder(models.Model):

_inherit = 'sale.order'

analytic_account_id = fields.Many2one(
check_company=False, # Unrequired company
)
17 changes: 17 additions & 0 deletions website_sale_multic_ux/models/website.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################

from odoo import models


class Website(models.Model):

_inherit = 'website'

def sale_get_order(self, force_create=False, update_pricelist=False):
sale_order_sudo = super().sale_get_order(force_create, update_pricelist)
if sale_order_sudo.company_id != self.env.user.company_id:
sale_order_sudo.company_id = self.env.user.company_id.id
return sale_order_sudo

0 comments on commit c626691

Please sign in to comment.