19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:30:07 +01:00
parent ba20ce7443
commit 768b70e05e
2357 changed files with 1057103 additions and 712486 deletions

View file

@ -8,11 +8,11 @@ class AccountAnalyticAccount(models.Model):
_inherit = 'account.analytic.account'
_description = 'Analytic Account'
production_ids = fields.One2many('mrp.production', 'analytic_account_id', string='Manufacturing Orders')
production_ids = fields.Many2many('mrp.production')
production_count = fields.Integer("Manufacturing Orders Count", compute='_compute_production_count')
bom_ids = fields.One2many('mrp.bom', 'analytic_account_id', string='Bills of Materials')
bom_ids = fields.Many2many('mrp.bom')
bom_count = fields.Integer("BoM Count", compute='_compute_bom_count')
workcenter_ids = fields.One2many('mrp.workcenter', 'costs_hour_account_id', string='Workcenters')
workcenter_ids = fields.Many2many('mrp.workcenter')
workorder_count = fields.Integer("Work Order Count", compute='_compute_workorder_count')
@api.depends('production_ids')
@ -37,7 +37,7 @@ class AccountAnalyticAccount(models.Model):
"res_model": "mrp.production",
"domain": [['id', 'in', self.production_ids.ids]],
"name": _("Manufacturing Orders"),
'view_mode': 'tree,form',
'view_mode': 'list,form',
"context": {'default_analytic_account_id': self.id},
}
if len(self.production_ids) == 1:
@ -52,7 +52,7 @@ class AccountAnalyticAccount(models.Model):
"res_model": "mrp.bom",
"domain": [['id', 'in', self.bom_ids.ids]],
"name": _("Bills of Materials"),
'view_mode': 'tree,form',
'view_mode': 'list,form',
"context": {'default_analytic_account_id': self.id},
}
if self.bom_count == 1:
@ -68,7 +68,7 @@ class AccountAnalyticAccount(models.Model):
"domain": [['id', 'in', (self.workcenter_ids.order_ids | self.production_ids.workorder_ids).ids]],
"context": {"create": False},
"name": _("Work Orders"),
'view_mode': 'tree',
'view_mode': 'list',
}
return result
@ -77,3 +77,15 @@ class AccountAnalyticLine(models.Model):
_inherit = 'account.analytic.line'
category = fields.Selection(selection_add=[('manufacturing_order', 'Manufacturing Order')])
class AccountAnalyticApplicability(models.Model):
_inherit = 'account.analytic.applicability'
_description = "Analytic Plan's Applicabilities"
business_domain = fields.Selection(
selection_add=[
('manufacturing_order', 'Manufacturing Order'),
],
ondelete={'manufacturing_order': 'cascade'},
)