diff options
| author | Ankita Raval <anr@odoo.com> | 2019-10-30 06:11:02 +0000 |
|---|---|---|
| committer | Jigar Vaghela <jva@odoo.com> | 2020-02-19 09:09:20 +0000 |
| commit | d675dbaa4c7174591e0e7c1a3caf3e76877312ce (patch) | |
| tree | 40840df0a36cb9a6ba3b918835da2a40a07e3a3b /addons/sale_crm | |
| parent | 8f6bf2087e50020bfad4e336b1d4c5a98a4fa84f (diff) | |
[IMP] account,* : Change type field to move_type in account.move
task-id: 2028z813
Diffstat (limited to 'addons/sale_crm')
| -rw-r--r-- | addons/sale_crm/models/crm_lead.py | 6 | ||||
| -rw-r--r-- | addons/sale_crm/views/crm_lead_views.xml | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/addons/sale_crm/models/crm_lead.py b/addons/sale_crm/models/crm_lead.py index 0c4dd37297a..56ca8677d3f 100644 --- a/addons/sale_crm/models/crm_lead.py +++ b/addons/sale_crm/models/crm_lead.py @@ -45,15 +45,15 @@ class CrmLead(models.Model): ('state', '=', 'posted'), ('invoice_user_id', '=', self.env.uid), ('invoice_date', '>=', date_today.replace(day=1) - relativedelta(months=+1)), - ('type', 'in', ['out_invoice', 'out_refund']) + ('move_type', 'in', ['out_invoice', 'out_refund']) ] - invoice_data = self.env['account.move'].search_read(account_invoice_domain, ['invoice_date', 'amount_untaxed', 'type']) + invoice_data = self.env['account.move'].search_read(account_invoice_domain, ['invoice_date', 'amount_untaxed', 'move_type']) for invoice in invoice_data: if invoice['invoice_date']: invoice_date = fields.Date.from_string(invoice['invoice_date']) - sign = 1 if invoice['type'] == 'out_invoice' else -1 + sign = 1 if invoice['move_type'] == 'out_invoice' else -1 if invoice_date <= date_today and invoice_date >= date_today.replace(day=1): res['invoiced']['this_month'] += sign * invoice['amount_untaxed'] elif invoice_date < date_today.replace(day=1) and invoice_date >= date_today.replace(day=1) - relativedelta(months=+1): diff --git a/addons/sale_crm/views/crm_lead_views.xml b/addons/sale_crm/views/crm_lead_views.xml index a1efb360f44..b3bbac55a9b 100644 --- a/addons/sale_crm/views/crm_lead_views.xml +++ b/addons/sale_crm/views/crm_lead_views.xml @@ -29,7 +29,7 @@ <!-- add needaction_menu_ref to reload quotation needaction when opportunity needaction is reloaded --> <record id="crm.crm_lead_opportunities" model="ir.actions.act_window"> - <field name="context">{'default_type': 'opportunity', 'default_user_id': uid}</field> + <field name="context">{'default_move_type': 'opportunity', 'default_user_id': uid}</field> </record> <record id="sales_team.mail_activity_type_action_config_sales" model="ir.actions.act_window"> |
