diff --git a/crm_dashboard/models/crm_dashboard.py b/crm_dashboard/models/crm_dashboard.py index a49900553..b985ca4fe 100644 --- a/crm_dashboard/models/crm_dashboard.py +++ b/crm_dashboard/models/crm_dashboard.py @@ -32,23 +32,35 @@ from datetime import datetime class CRMSalesTeam(models.Model): + """CRMSalesTeam model extends the base crm.team model to add a field, + crm_lead_state_id, which represents the default CRM Lead stage for + leads associated with this sales team. + """ _inherit = 'crm.team' crm_lead_state_id = fields.Many2one("crm.stage", string="CRM Lead", - store=True) + store=True, + help="CRM Lead stage for leads " + "associated with this sales team.") class ResUser(models.Model): + """ResUser model extends the base res.users model to add a field 'sales' + that represents the target for the salesperson.""" _inherit = 'res.users' - sales = fields.Float(string="Target") + sales = fields.Float(string="Target", help="The target value for the " + "salesperson.") class SalesOrder(models.Model): _inherit = 'sale.order' def action_confirm(self): - """Supering the Confirm Button for Changing CRM Stage""" + """Override the action_confirm method to change CRM Stage. + Returns: + dict: A dictionary containing the result of the original + action_confirm method.""" res = super(SalesOrder, self).action_confirm() self.opportunity_id.stage_id = self.team_id.crm_lead_state_id return res @@ -57,13 +69,14 @@ class SalesOrder(models.Model): class CRMLead(models.Model): _inherit = 'crm.lead' - crm_manager_id = fields.Many2one("res.users", string="CRM Manager", - store=True) monthly_goal = fields.Float(string="Monthly Goal") achievement_amount = fields.Float(string="Monthly Achievement") @api.model def _get_currency(self): + """Get the currency symbol and position for the current user's company. + Returns: + list: A list containing the currency symbol and its position.""" currency_array = [self.env.user.company_id.currency_id.symbol, self.env.user.company_id.currency_id.position] return currency_array diff --git a/crm_dashboard/views/dashboard_view.xml b/crm_dashboard/views/dashboard_view.xml index 4bbbb2d2a..24dc89646 100644 --- a/crm_dashboard/views/dashboard_view.xml +++ b/crm_dashboard/views/dashboard_view.xml @@ -1,65 +1,53 @@ - - - crm.manager.select - crm.lead - - - - - + + + sales.team.inherit.view + crm.team + + + + - + + + + + res.users.form.inherit + res.users + + + + + + + + + + + + CRM + crm_dashboard + + + + Campaign Win Lose Smart Button + utm.campaign + + +
+ +
+
+
+ + - - sales.team.inherit.view - crm.team - - - - - - - - - - res.users.form.inherit - res.users - - - - - - - - - - - - CRM - crm_dashboard - - - - Campaign Win Lose Smart Button - utm.campaign - - -
- -
-
-
- - -
\ No newline at end of file