[IMP]:Issues-145, Issues-147
This commit is contained in:
parent
32353100ea
commit
4f7a4fd533
@ -12,7 +12,7 @@ Core mechanisms for the accounting modules. To display the menuitems, install th
|
|||||||
'category': 'Accounting',
|
'category': 'Accounting',
|
||||||
'website': 'https://flectrahq.com/accounting',
|
'website': 'https://flectrahq.com/accounting',
|
||||||
'images' : ['images/accounts.jpeg','images/bank_statement.jpeg','images/cash_register.jpeg','images/chart_of_accounts.jpeg','images/customer_invoice.jpeg','images/journal_entries.jpeg'],
|
'images' : ['images/accounts.jpeg','images/bank_statement.jpeg','images/cash_register.jpeg','images/chart_of_accounts.jpeg','images/customer_invoice.jpeg','images/journal_entries.jpeg'],
|
||||||
'depends' : ['base_setup', 'product', 'analytic', 'web_planner', 'portal', 'digest'],
|
'depends' : ['base_setup', 'product', 'analytic', 'web_planner', 'portal', 'digest', 'base_branch_company'],
|
||||||
'data': [
|
'data': [
|
||||||
'security/account_security.xml',
|
'security/account_security.xml',
|
||||||
'security/ir.model.access.csv',
|
'security/ir.model.access.csv',
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
'version': '1.1',
|
'version': '1.1',
|
||||||
'website' : 'https://flectrahq.com/accounting',
|
'website' : 'https://flectrahq.com/accounting',
|
||||||
'category': 'Hidden/Dependency',
|
'category': 'Hidden/Dependency',
|
||||||
'depends' : ['base', 'decimal_precision', 'mail'],
|
'depends' : ['base', 'decimal_precision', 'mail', 'base_branch_company'],
|
||||||
'description': """
|
'description': """
|
||||||
Module for defining analytic accounting object.
|
Module for defining analytic accounting object.
|
||||||
===============================================
|
===============================================
|
||||||
|
@ -92,6 +92,19 @@ class Users(models.Model):
|
|||||||
|
|
||||||
_inherit = "res.users"
|
_inherit = "res.users"
|
||||||
|
|
||||||
|
@api.multi
|
||||||
|
def read(self, fields=None, load='_classic_read'):
|
||||||
|
result = super(Users, self).read(fields, load=load)
|
||||||
|
self.with_context({'check_branch': True}).check_missing_branch()
|
||||||
|
return result
|
||||||
|
|
||||||
|
@api.multi
|
||||||
|
def check_missing_branch(self):
|
||||||
|
for user_id in self:
|
||||||
|
if self._context.get('check_branch', False) and user_id.company_id.branch_id and not user_id.default_branch_id:
|
||||||
|
user_id.default_branch_id = user_id.company_id.branch_id.id
|
||||||
|
user_id.branch_ids = [(4, user_id.company_id.branch_id.id)]
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def branch_default_get(self, user):
|
def branch_default_get(self, user):
|
||||||
if not user:
|
if not user:
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
'web_tour',
|
'web_tour',
|
||||||
'contacts',
|
'contacts',
|
||||||
'digest',
|
'digest',
|
||||||
|
'base_branch_company'
|
||||||
],
|
],
|
||||||
'data': [
|
'data': [
|
||||||
'security/crm_security.xml',
|
'security/crm_security.xml',
|
||||||
|
@ -19,7 +19,8 @@
|
|||||||
'web',
|
'web',
|
||||||
'web_planner',
|
'web_planner',
|
||||||
'web_tour',
|
'web_tour',
|
||||||
'digest'
|
'digest',
|
||||||
|
'base_branch_company'
|
||||||
],
|
],
|
||||||
'description': "",
|
'description': "",
|
||||||
'data': [
|
'data': [
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
'sequence': 40,
|
'sequence': 40,
|
||||||
'summary': 'A module for Scrum implementation',
|
'summary': 'A module for Scrum implementation',
|
||||||
'depends': [
|
'depends': [
|
||||||
'project', 'resource'
|
'project', 'resource', 'base_branch_company'
|
||||||
],
|
],
|
||||||
'data': [
|
'data': [
|
||||||
'security/ir.model.access.csv',
|
'security/ir.model.access.csv',
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
'summary': 'Purchase Orders, Receipts, Vendor Bills',
|
'summary': 'Purchase Orders, Receipts, Vendor Bills',
|
||||||
'description': "",
|
'description': "",
|
||||||
'website': 'https://flectrahq.com/purchase',
|
'website': 'https://flectrahq.com/purchase',
|
||||||
'depends': ['stock_account'],
|
'depends': ['stock_account', 'base_branch_company'],
|
||||||
'data': [
|
'data': [
|
||||||
'security/purchase_security.xml',
|
'security/purchase_security.xml',
|
||||||
'security/ir.model.access.csv',
|
'security/ir.model.access.csv',
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
'depends': [
|
'depends': [
|
||||||
'purchase',
|
'purchase',
|
||||||
'purchase_requisition',
|
'purchase_requisition',
|
||||||
|
'base_branch_company'
|
||||||
],
|
],
|
||||||
'data': [
|
'data': [
|
||||||
'security/ir.model.access.csv',
|
'security/ir.model.access.csv',
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
'description': """
|
'description': """
|
||||||
This module contains all the common features of Sales Management and eCommerce.
|
This module contains all the common features of Sales Management and eCommerce.
|
||||||
""",
|
""",
|
||||||
'depends': ['sales_team', 'account', 'portal'],
|
'depends': ['sales_team', 'account', 'portal', 'base_branch_company'],
|
||||||
'data': [
|
'data': [
|
||||||
'security/sale_security.xml',
|
'security/sale_security.xml',
|
||||||
'security/ir.model.access.csv',
|
'security/ir.model.access.csv',
|
||||||
|
@ -11,7 +11,7 @@ Using this application you can manage Sales Channels with CRM and/or Sales
|
|||||||
===========================================================================
|
===========================================================================
|
||||||
""",
|
""",
|
||||||
'website': 'https://flectrahq.com/page/crm',
|
'website': 'https://flectrahq.com/page/crm',
|
||||||
'depends': ['base', 'mail'],
|
'depends': ['base', 'mail', 'base_branch_company'],
|
||||||
'data': ['security/sales_team_security.xml',
|
'data': ['security/sales_team_security.xml',
|
||||||
'security/ir.model.access.csv',
|
'security/ir.model.access.csv',
|
||||||
'data/sales_team_data.xml',
|
'data/sales_team_data.xml',
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
'summary': 'Inventory, Logistics, Warehousing',
|
'summary': 'Inventory, Logistics, Warehousing',
|
||||||
'description': "",
|
'description': "",
|
||||||
'website': 'https://flectrahq.com/page/warehouse',
|
'website': 'https://flectrahq.com/page/warehouse',
|
||||||
'depends': ['product', 'barcodes', 'web_planner'],
|
'depends': ['product', 'barcodes', 'web_planner', 'base_branch_company'],
|
||||||
'category': 'Warehouse',
|
'category': 'Warehouse',
|
||||||
'sequence': 13,
|
'sequence': 13,
|
||||||
'demo': [
|
'demo': [
|
||||||
|
@ -135,7 +135,7 @@ class Location(models.Model):
|
|||||||
('lot_stock_id', 'in', record.ids),
|
('lot_stock_id', 'in', record.ids),
|
||||||
('wh_output_stock_loc_id', 'in', record.ids)])
|
('wh_output_stock_loc_id', 'in', record.ids)])
|
||||||
for warehouse_id in warehouses_ids:
|
for warehouse_id in warehouses_ids:
|
||||||
if record.branch_id and record.branch_id != warehouse_id.branch_id:
|
if record.branch_id and warehouse_id.branch_id and record.branch_id != warehouse_id.branch_id:
|
||||||
raise ValidationError(
|
raise ValidationError(
|
||||||
_('Configuration Error of Branch:\n'
|
_('Configuration Error of Branch:\n'
|
||||||
'The Location Branch (%s) and '
|
'The Location Branch (%s) and '
|
||||||
|
Loading…
Reference in New Issue
Block a user