From 8c5a3645c3924155c865e02e61e7bb51d6904ffc Mon Sep 17 00:00:00 2001 From: Angelika Bacher Date: Tue, 5 Jun 2018 13:46:33 +0200 Subject: [PATCH] Fall 5558: Information - Neuer Kunde vom Portal --- .../dp_custom/models/res_partner.py | 24 +++++++++++++++---- .../dp_custom/security/security.xml | 4 ++++ ext/custom-addons/dp_dmi/res.users.role.csv | 2 +- setup/lib/environments.py | 4 ++++ 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/ext/custom-addons/dp_custom/models/res_partner.py b/ext/custom-addons/dp_custom/models/res_partner.py index 10c4d60f..0c8cdc17 100644 --- a/ext/custom-addons/dp_custom/models/res_partner.py +++ b/ext/custom-addons/dp_custom/models/res_partner.py @@ -99,7 +99,22 @@ class Partner(models.Model): vals['active'] = False vals['is_company'] = True vals['portal_pending'] = True - self.create(vals) + + # send mail activity to usergroup(with group 'informieren bei neuem Portalkunden, if new company was created + recordset = self.create(vals) + users = self.env.ref('dp_custom.group_inform_on_new_partner').users + + for user in users: + values = {'user_id': user.id, + 'date_deadline': fields.datetime.now(), + 'note': "New Company has been created", + 'activity_type_id': self.env.ref('mail.mail_activity_data_email').id, + 'res_id': recordset.id, + 'res_model': recordset._name, + 'res_model_id': self.env.ref('base_partner_sequence.model_res_partner').id + } + self.env['mail.activity'].create(values) + return True @api.model @@ -261,9 +276,10 @@ class Partner(models.Model): common_list.extend(['name', 'name2', 'info_kundennr', 'info_uid', 'comment', 'retail_partner_id']) return common_list elif self.env.context.get('sst_11', False): - common_list.extend(['name', 'ref', 'partner_sector_id', 'info_uid', 'comment', 'vat', 'property_payment_term_id', - 'date_vat_check', 'active', 'property_product_pricelist', 'retail_partner_id', - 'is_retailer', 'name2', 'carrier_id', 'collective_bill', 'fiscal_position']) + common_list.extend( + ['name', 'ref', 'partner_sector_id', 'info_uid', 'comment', 'vat', 'property_payment_term_id', + 'date_vat_check', 'active', 'property_product_pricelist', 'retail_partner_id', + 'is_retailer', 'name2', 'carrier_id', 'collective_bill', 'fiscal_position']) return common_list elif self.env.context.get('sst_14', False): common_list = ['firstname', 'lastname', 'midname', 'email', 'company_odoo_id', 'portal_id', 'opt_out'] diff --git a/ext/custom-addons/dp_custom/security/security.xml b/ext/custom-addons/dp_custom/security/security.xml index 1597ff6e..0ebadfc0 100644 --- a/ext/custom-addons/dp_custom/security/security.xml +++ b/ext/custom-addons/dp_custom/security/security.xml @@ -8,4 +8,8 @@ Löschen von Angeboten erlauben Löschen von Angeboten erlauben + + Informieren bei neuem Portalkunden + Informieren bei neuem Portalkunden + diff --git a/ext/custom-addons/dp_dmi/res.users.role.csv b/ext/custom-addons/dp_dmi/res.users.role.csv index 8697d0f8..bd17c0fc 100644 --- a/ext/custom-addons/dp_dmi/res.users.role.csv +++ b/ext/custom-addons/dp_dmi/res.users.role.csv @@ -1,3 +1,3 @@ "id","name","implied_ids/id" -"role_sachbearbeiter","Sachbearbeiter","account.group_account_invoice,sales_team.group_sale_manager,stock.group_stock_user,base.group_partner_manager,stock.group_stock_manager,website.group_website_designer,purchase.group_purchase_manager" +"role_sachbearbeiter","Sachbearbeiter","dp_custom.group_inform_on_new_company,account.group_account_invoice,sales_team.group_sale_manager,stock.group_stock_user,base.group_partner_manager,stock.group_stock_manager,website.group_website_designer,purchase.group_purchase_manager" "role_admin","Admin","base.group_partner_manager,base.group_system,account.group_account_manager,account.group_account_user,sales_team.group_sale_manager,stock.group_stock_manager,website.group_website_designer,connector.group_connector_manager,queue_job.group_queue_job_manager,purchase.group_purchase_manager,dp_custom.group_allow_delete_so_attachments,dp_custom.group_allow_delete_so_drafts" diff --git a/setup/lib/environments.py b/setup/lib/environments.py index c11b2e87..1994ebc8 100644 --- a/setup/lib/environments.py +++ b/setup/lib/environments.py @@ -48,6 +48,10 @@ ENVIRONMENTS = { 'rw-tz' : Environment('http://localhost', '8080', 'tz-austria_1', 'tz-admin', 'x', 'admin', config = ConfigTZA()), 'rw-glaser' : Environment('http://localhost', '8080', 'tz-austria_1', 'glaser-admin', 'x', 'admin', config = ConfigGlaser()), + 'ab' : Environment('http://localhost', '8080', 'tz-austria_1', 'admin', 'x', 'admin', config = ConfigTZA()), + 'ab-tz' : Environment('http://localhost', '8080', 'tz-austria_1', 'tz-admin', 'x', 'admin', config = ConfigTZA()), + 'ab-glaser' : Environment('http://localhost', '8080', 'tz-austria_1', 'glaser-admin', 'x', 'admin', config = ConfigGlaser()), + # Remote environments are always listed without passwords! # Do not store them here, you have to type them anyway! 'test': Environment('https://erp.tzaustria.info', '443', 'odoo-test', 'admin', config = ConfigTZA()),