diff --git a/sale_planner_calendar/__manifest__.py b/sale_planner_calendar/__manifest__.py index f9ee7bbac96..df16150c240 100644 --- a/sale_planner_calendar/__manifest__.py +++ b/sale_planner_calendar/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Sale planner calendar", "summary": "Sale planner calendar", - "version": "15.0.2.3.0", + "version": "15.0.3.0.0", "development_status": "Beta", "category": "Sale", "website": "https://github.com/OCA/sale-workflow", @@ -18,12 +18,10 @@ "data/sale_planner_calendar_action_server.xml", "data/sale_planner_calendar_cron.xml", "data/sale_planner_calendar_data.xml", - "data/sale_planner_calendar_event_profile.xml", "views/calendar_event_type_view.xml", "views/calendar_view.xml", "views/res_config_settings_views.xml", "views/res_partner_view.xml", - "views/sale_planner_calendar_event_profile_view.xml", "views/sale_planner_calendar_event_view.xml", "views/sale_planner_calendar_issue_type_view.xml", "views/sale_planner_calendar_summary_view.xml", diff --git a/sale_planner_calendar/data/sale_planner_calendar_data.xml b/sale_planner_calendar/data/sale_planner_calendar_data.xml index 9a3b3d5e182..b961407d78c 100644 --- a/sale_planner_calendar/data/sale_planner_calendar_data.xml +++ b/sale_planner_calendar/data/sale_planner_calendar_data.xml @@ -3,14 +3,22 @@ Commercial visit 0.25 + fa-car Remote selling 0.25 + fa-phone Delivery 0.25 + fa-truck + + + Message + 0.25 + fa-envelope diff --git a/sale_planner_calendar/data/sale_planner_calendar_event_profile.xml b/sale_planner_calendar/data/sale_planner_calendar_event_profile.xml deleted file mode 100644 index 061746ee3d4..00000000000 --- a/sale_planner_calendar/data/sale_planner_calendar_event_profile.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - Face-to-Face - fa-car - - - Telephone - fa-phone - - - Message - fa-envelope - - diff --git a/sale_planner_calendar/i18n/es.po b/sale_planner_calendar/i18n/es.po index 7296dae8da1..1622ba801f7 100644 --- a/sale_planner_calendar/i18n/es.po +++ b/sale_planner_calendar/i18n/es.po @@ -4,18 +4,18 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 13.0\n" +"Project-Id-Version: Odoo Server 15.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-30 16:12+0000\n" -"PO-Revision-Date: 2024-10-30 17:12+0100\n" -"Last-Translator: Sergio Teruel \n" +"POT-Creation-Date: 2024-11-17 14:09+0000\n" +"PO-Revision-Date: 2024-11-17 15:17+0100\n" +"Last-Translator: Carlos Dauden \n" "Language-Team: \n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Poedit 3.0.1\n" +"X-Generator: Poedit 3.4.2\n" #. module: sale_planner_calendar #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_summary_kanban @@ -26,15 +26,6 @@ msgstr "" "\n" " Pedido" -#. module: sale_planner_calendar -#: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_calendar_event_kanban -msgid "" -"\n" -" Event" -msgstr "" -"\n" -" Evento" - #. module: sale_planner_calendar #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_form msgid "Invoices" @@ -97,8 +88,8 @@ msgstr "Asignar nuevo comercial al cliente" #. module: sale_planner_calendar #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_reassign_wiz -msgid "Assign new commercial to selected lines" -msgstr "Asignar nuevo comercial en las líneas seleccionadas" +msgid "Assign new values to selected lines" +msgstr "Asignar nuevos valores en las líneas seleccionadas" #. module: sale_planner_calendar #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_summary__message_attachment_count @@ -115,34 +106,22 @@ msgstr "" #. module: sale_planner_calendar #: model:ir.model,name:sale_planner_calendar.model_calendar_attendee msgid "Calendar Attendee Information" -msgstr "" +msgstr "Información del Calendario de Asistentes" #. module: sale_planner_calendar #: model:ir.model,name:sale_planner_calendar.model_calendar_event -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__calendar_event_id #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz__calendar_event_id #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_wizard__calendar_event_ids msgid "Calendar Event" msgstr "Evento calendario" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__calendar_event_date -msgid "Calendar Event Date" -msgstr "Fecha evento calendario" - -#. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__calendar_event_profile_id -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__calendar_event_profile_id -msgid "Calendar Event Profile" -msgstr "Perfil de Evento" - -#. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__calendar_issue_type_id +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__calendar_issue_type_id msgid "Calendar Issue Type" msgstr "Tipo incidencia rutero" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__calendar_summary_id +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__calendar_summary_id msgid "Calendar Summary" msgstr "Resumen rutero" @@ -170,13 +149,18 @@ msgid "Cancel" msgstr "Cancelar" #. module: sale_planner_calendar -#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_event__state__cancel +#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__calendar_event__sale_planner_state__cancel #: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_summary__state__cancel msgid "Cancelled" msgstr "Cancelado" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__partner_city +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__categ_icons +msgid "Categ Icons" +msgstr "Iconos categorías" + +#. module: sale_planner_calendar +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__partner_city #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_kanban msgid "City" msgstr "Ciudad" @@ -192,7 +176,7 @@ msgid "Closed" msgstr "Cerrado" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__comment +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__comment #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_summary__comment #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_summary_form msgid "Comment" @@ -204,7 +188,7 @@ msgid "Commercial name" msgstr "Nombre comercial" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__partner_commercial_name +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__partner_commercial_name msgid "Commercial partner name" msgstr "Nombre entidad comercial" @@ -214,7 +198,6 @@ msgid "Companies" msgstr "Compañías" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__company_id #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_summary__company_id msgid "Company" msgstr "Compañía" @@ -229,21 +212,12 @@ msgstr "Opciones de Configuración" msgid "Configuration" msgstr "Configuración" -#. module: sale_planner_calendar -#. openerp-web -#: code:addons/sale_planner_calendar/static/src/js/basic_controller.js:0 -#, python-format -msgid "Confirm" -msgstr "" - #. module: sale_planner_calendar #: model:ir.model,name:sale_planner_calendar.model_res_partner msgid "Contact" msgstr "Contacto" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__create_uid -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event_profile__create_uid #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_issue_type__create_uid #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz__create_uid #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_wiz__create_uid @@ -253,8 +227,6 @@ msgid "Created by" msgstr "Creado por" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__create_date -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event_profile__create_date #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_issue_type__create_date #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz__create_date #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_wiz__create_date @@ -264,8 +236,7 @@ msgid "Created on" msgstr "Creado el" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__currency_id -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__currency_id +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__sale_planner_currency_id #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_summary__currency_id msgid "Currency" msgstr "Moneda" @@ -286,14 +257,11 @@ msgid "Cycle Skip" msgstr "Saltar ciclos" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__date #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_summary__date msgid "Date" msgstr "Fecha" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__display_name -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event_profile__display_name #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_issue_type__display_name #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz__display_name #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_wiz__display_name @@ -308,7 +276,7 @@ msgid "Documents" msgstr "Documentos" #. module: sale_planner_calendar -#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_event__state__done +#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__calendar_event__sale_planner_state__done #: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_summary__state__done #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_form #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_search @@ -326,13 +294,6 @@ msgstr "Deuda" msgid "Duration" msgstr "Duración" -#. module: sale_planner_calendar -#. openerp-web -#: code:addons/sale_planner_calendar/static/src/js/basic_controller.js:0 -#, python-format -msgid "Edit Recurrent event" -msgstr "" - #. module: sale_planner_calendar #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_summary_form msgid "Effective" @@ -358,17 +319,6 @@ msgstr "Tipo de Reunión" msgid "Event Off Planning Count" msgstr "Cuenta evento no planeado" -#. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__event_planner_state -msgid "Event Planner State" -msgstr "Estado evento rutero" - -#. module: sale_planner_calendar -#: model:ir.actions.act_window,name:sale_planner_calendar.action_sale_planner_calendar_event_profile -#: model:ir.ui.menu,name:sale_planner_calendar.menu_sale_planner_calendar_event_profile -msgid "Event Profile" -msgstr "Perfil de Evento" - #. module: sale_planner_calendar #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz__event_start msgid "Event Start" @@ -385,11 +335,6 @@ msgstr "Cuenta evento total" msgid "Event planner summary today" msgstr "Resumen para hoy" -#. module: sale_planner_calendar -#: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_form -msgid "Event schedule" -msgstr "Planificación" - #. module: sale_planner_calendar #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_wiz__event_type_id #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_summary__event_type_id @@ -429,11 +374,19 @@ msgid "Followers (Partners)" msgstr "Seguidores (Socios)" #. module: sale_planner_calendar -#: model:ir.model.fields,help:sale_planner_calendar.field_sale_planner_calendar_event__profile_icon -#: model:ir.model.fields,help:sale_planner_calendar.field_sale_planner_calendar_event_profile__icon +#: model:ir.model.fields,help:sale_planner_calendar.field_calendar_event_type__icon msgid "Font awesome icon e.g. fa-tasks" msgstr "Icono font awesome ej: fa-tasks" +#. module: sale_planner_calendar +#: model:ir.model.fields,help:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz__new_event_categ_ids +#: model:ir.model.fields,help:sale_planner_calendar.field_sale_planner_calendar_reassign_wiz__new_event_categ_ids +msgid "" +"Forces new tags for the specified period. Leave empty to keep current tags." +msgstr "" +"Forzar nuevas etiquetas para el periodo especificado. Dejar vacío para " +"mantener las etiquetas actuales." + #. module: sale_planner_calendar #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.res_config_settings_view_form msgid "Forward months to create calendar events" @@ -446,6 +399,12 @@ msgid "Friday" msgstr "Viernes" #. module: sale_planner_calendar +#: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_search +msgid "Future" +msgstr "Futuro" + +#. module: sale_planner_calendar +#: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_search #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_summary_search msgid "Group By" msgstr "Agrupar por" @@ -461,8 +420,6 @@ msgid "Hour" msgstr "Hora" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__id -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event_profile__id #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_issue_type__id #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz__id #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_wiz__id @@ -472,14 +429,12 @@ msgid "ID" msgstr "ID (identificación)" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__profile_icon -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event_profile__icon +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event_type__icon msgid "Icon" msgstr "Icono" #. module: sale_planner_calendar #: model:ir.model.fields,help:sale_planner_calendar.field_sale_planner_calendar_summary__message_needaction -#: model:ir.model.fields,help:sale_planner_calendar.field_sale_planner_calendar_summary__message_unread msgid "If checked, new messages require your attention." msgstr "Si está marcado hay nuevos mensajes que requieren su atención." @@ -507,7 +462,7 @@ msgid "Info" msgstr "Información" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__invoice_amount_residual +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__invoice_amount_residual msgid "Invoice amount due" msgstr "Importe adeudado" @@ -559,8 +514,6 @@ msgid "Issues" msgstr "Incidencias" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event____last_update -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event_profile____last_update #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_issue_type____last_update #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz____last_update #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_wiz____last_update @@ -570,8 +523,6 @@ msgid "Last Modified on" msgstr "Última modificación el" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__write_uid -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event_profile__write_uid #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_issue_type__write_uid #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz__write_uid #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_wiz__write_uid @@ -581,8 +532,6 @@ msgid "Last Updated by" msgstr "Última actualización por" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__write_date -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event_profile__write_date #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_issue_type__write_date #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz__write_date #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_wiz__write_date @@ -602,15 +551,25 @@ msgid "Location" msgstr "Localización" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__location_url +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__location_url msgid "Location Url" -msgstr "" +msgstr "Ubicación URL" #. module: sale_planner_calendar #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_summary__message_main_attachment_id msgid "Main Attachment" msgstr "Adjunto principal" +#. module: sale_planner_calendar +#: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_search +msgid "Meeting" +msgstr "Reunión" + +#. module: sale_planner_calendar +#: model:ir.ui.menu,name:sale_planner_calendar.menu_calendar_event_type +msgid "Meeting Types" +msgstr "Tipos de reunión" + #. module: sale_planner_calendar #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_summary__message_has_error msgid "Message Delivery error" @@ -656,7 +615,6 @@ msgid "My summaries" msgstr "Mis resúmenes" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event_profile__name #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_issue_type__name msgid "Name" msgstr "Nombre" @@ -693,6 +651,12 @@ msgstr "Nuevo pedido" msgid "New salesperson" msgstr "Nuevo comercial" +#. module: sale_planner_calendar +#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz__new_event_categ_ids +#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_wiz__new_event_categ_ids +msgid "New tags" +msgstr "Nuevas etiquetas" + #. module: sale_planner_calendar #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_reassign_wiz msgid "New values" @@ -710,7 +674,7 @@ msgstr "Numero de errores" #. module: sale_planner_calendar #: model:ir.model.fields,help:sale_planner_calendar.field_sale_planner_calendar_summary__message_needaction_counter -msgid "Number of messages which requires an action" +msgid "Number of messages requiring action" msgstr "Número de mensajes que requieren una acción" #. module: sale_planner_calendar @@ -718,18 +682,13 @@ msgstr "Número de mensajes que requieren una acción" msgid "Number of messages with delivery error" msgstr "Número de mensajes con error de envío" -#. module: sale_planner_calendar -#: model:ir.model.fields,help:sale_planner_calendar.field_sale_planner_calendar_summary__message_unread_counter -msgid "Number of unread messages" -msgstr "Número de mensajes no leidos" - #. module: sale_planner_calendar #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_wizard msgid "OK" msgstr "OK" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__off_planning +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__off_planning msgid "Off Planning" msgstr "No planeado" @@ -754,7 +713,6 @@ msgid "Orders" msgstr "Pedidos" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__partner_id #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz__partner_id #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_wiz__partner_id #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_kanban @@ -762,29 +720,31 @@ msgid "Partner" msgstr "Empresa" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__partner_contact_name +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__partner_contact_name msgid "Partner Contact Name" msgstr "Nombre del contacto" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__partner_mobile +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__partner_mobile msgid "Partner Mobile" msgstr "Móvil de contacto" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__partner_name +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__partner_name msgid "Partner Name" msgstr "Nombre del cliente" #. module: sale_planner_calendar +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__partner_user_id +#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz__partner_user_id #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_wiz__partner_user_id -msgid "Partner User" +msgid "Partner salesperson" msgstr "Comercial del cliente" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz__partner_user_id -msgid "Partner salesperson" -msgstr "Comercial del cliente" +#: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_search +msgid "Past" +msgstr "Pasado" #. module: sale_planner_calendar #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_summary__payment_amount @@ -802,7 +762,7 @@ msgid "Payment Sheet" msgstr "Hoja de pagos" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__payment_sheet_line_ids +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__payment_sheet_line_ids msgid "Payment Sheet Line" msgstr "Líneas de la hoja de pagos" @@ -812,32 +772,26 @@ msgid "Payments" msgstr "Pagos" #. module: sale_planner_calendar -#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_event__state__pending +#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__calendar_event__sale_planner_state__pending #: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_summary__state__pending #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_form #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_search msgid "Pending" msgstr "Pendiente" -#. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz__event_user_id -msgid "Planned user" -msgstr "Comercial rutero" - #. module: sale_planner_calendar #: model:ir.ui.menu,name:sale_planner_calendar.menu_sale_planner_calendar_summary_general msgid "Planner" msgstr "Rutero" #. module: sale_planner_calendar -#: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_calendar_event_kanban -msgid "Planner event" -msgstr "Evento rutero" - -#. module: sale_planner_calendar -#: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_summary_form -msgid "Process" -msgstr "Procesar" +#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz__event_user_id +#: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_form +#: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_issue_tree +#: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_search +#: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_tree +msgid "Planner salesperson" +msgstr "Comercial de rutero" #. module: sale_planner_calendar #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz__reassign_wiz_id @@ -857,12 +811,12 @@ msgid "Recurrent calendar events" msgstr "Eventos de calendario recurrentes" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__partner_ref +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__partner_ref msgid "Reference" msgstr "Referencia" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__sale_ids +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__sale_ids #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_summary__sale_ids msgid "Sale" msgstr "Venta" @@ -873,7 +827,7 @@ msgid "Sale Order Count" msgstr "Cuenta pedido venta" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__sale_order_subtotal +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__sale_order_subtotal #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_summary__sale_order_subtotal msgid "Sale Order Subtotal" msgstr "Base imponible pedido" @@ -889,7 +843,6 @@ msgid "Sale Planner Calendar" msgstr "Rutero" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__sale_planner_calendar_event_id #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_invoice_payment_wiz__sale_planner_calendar_event_id #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_order__sale_planner_calendar_event_id #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_payment_sheet_line__sale_planner_calendar_event_id @@ -897,11 +850,6 @@ msgstr "Rutero" msgid "Sale Planner Calendar Event" msgstr "Eventos rutero" -#. module: sale_planner_calendar -#: model:ir.model,name:sale_planner_calendar.model_sale_planner_calendar_event_profile -msgid "Sale Planner Calendar Event Profile" -msgstr "Perfil de Evento de Calendario" - #. module: sale_planner_calendar #: model:ir.model.fields,field_description:sale_planner_calendar.field_res_company__sale_planner_forward_months #: model:ir.model.fields,field_description:sale_planner_calendar.field_res_config_settings__sale_planner_forward_months @@ -914,6 +862,11 @@ msgstr "Meses siguientes rutero" msgid "Sale Planner Order Cut Hour" msgstr "Hora de corte pedidos rutero" +#. module: sale_planner_calendar +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__sale_planner_state +msgid "Sale Planner State" +msgstr "Estado rutero" + #. module: sale_planner_calendar #: model:ir.model,name:sale_planner_calendar.model_sale_invoice_payment_wiz msgid "Sale invoice payment wizard" @@ -931,7 +884,6 @@ msgid "Sale planner calendar Wizard" msgstr "Asistente de planificación" #. module: sale_planner_calendar -#: model:ir.model,name:sale_planner_calendar.model_sale_planner_calendar_event #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_form #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_issue_form msgid "Sale planner calendar event" @@ -982,20 +934,20 @@ msgstr "Asistente de planificación" #. module: sale_planner_calendar #: model:ir.actions.server,name:sale_planner_calendar.sale_planner_calendar_cron_unsubscribe_ir_actions_server #: model:ir.cron,cron_name:sale_planner_calendar.sale_planner_calendar_cron_unsubscribe -#: model:ir.cron,name:sale_planner_calendar.sale_planner_calendar_cron_unsubscribe msgid "Sale planner calendar: Unsubscribe documents" msgstr "Rutero: Desuscripción de documentos" #. module: sale_planner_calendar #: model:ir.actions.server,name:sale_planner_calendar.cron_update_dynamic_final_date_ir_actions_server #: model:ir.cron,cron_name:sale_planner_calendar.cron_update_dynamic_final_date -#: model:ir.cron,name:sale_planner_calendar.cron_update_dynamic_final_date msgid "Sale planner calendar: Update dynamic event final date" msgstr "Sale planner calendar: Actualizar fecha final de los eventos dinámicos" #. module: sale_planner_calendar #: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__target_partner_id #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_calendar_event_form +#: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_calendar_event_search +#: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_search msgid "Sale planner partner" msgstr "Empresa rutero" @@ -1011,9 +963,9 @@ msgid "Salesperson" msgstr "Comercial" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__sanitized_partner_mobile +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__sanitized_partner_mobile msgid "Sanitized Partner Mobile" -msgstr "" +msgstr "Móvil de contacto" #. module: sale_planner_calendar #: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_reassign_wiz__week_list__sat @@ -1073,25 +1025,28 @@ msgstr "" "Mostrar un mensaje de aviso cuando la duración sea mayor que este tiempo.\n" " Establecer 00:00 para desactivar aviso." +#. module: sale_planner_calendar +#: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_search +msgid "Start" +msgstr "Inicio" + #. module: sale_planner_calendar #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_calendar_event_tree_primary_only msgid "Start Date" msgstr "Fecha inicio" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__state #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_summary__state msgid "State" msgstr "Estado" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__partner_street +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__partner_street #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_kanban msgid "Street" msgstr "Calle" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__name #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_calendar_event_tree_primary_only msgid "Subject" msgstr "Asunto" @@ -1108,6 +1063,13 @@ msgstr "Domingo" msgid "Susbscriptions Backward Days" msgstr "Suscripciones días anteriores" +#. module: sale_planner_calendar +#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz__event_categ_ids +#: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_calendar_event_search +#: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_search +msgid "Tags" +msgstr "Etiquetas" + #. module: sale_planner_calendar #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_reassign_wiz msgid "" @@ -1117,7 +1079,7 @@ msgstr "" "rellenado." #. module: sale_planner_calendar -#: model:ir.model.fields,help:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz__partner_user_id +#: model:ir.model.fields,help:sale_planner_calendar.field_calendar_event__partner_user_id msgid "The internal user in charge of this contact." msgstr "El usuario interno a cargo de este contacto." @@ -1179,16 +1141,6 @@ msgstr "Totales" msgid "Tuesday" msgstr "Martes" -#. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_summary__message_unread -msgid "Unread Messages" -msgstr "Mensajes sin leer" - -#. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_summary__message_unread_counter -msgid "Unread Messages Counter" -msgstr "Contador de mensajes sin leer" - #. module: sale_planner_calendar #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_reassign_wiz msgid "Unselect all lines" @@ -1210,17 +1162,11 @@ msgid "Until" msgstr "Hasta" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__user_id +#: model:ir.model,name:sale_planner_calendar.model_res_users #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_summary__user_id msgid "User" msgstr "Usuario" -#. module: sale_planner_calendar -#: model:ir.model.fields,help:sale_planner_calendar.field_calendar_event__currency_id -#: model:ir.model.fields,help:sale_planner_calendar.field_sale_planner_calendar_event__currency_id -msgid "Utility field to express amount currency" -msgstr "Campo útil para expresar importe en divisa" - #. module: sale_planner_calendar #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_summary__website_message_ids msgid "Website Messages" diff --git a/sale_planner_calendar/i18n/sale_planner_calendar.pot b/sale_planner_calendar/i18n/sale_planner_calendar.pot index 3f9ff503f62..ee1b726257a 100644 --- a/sale_planner_calendar/i18n/sale_planner_calendar.pot +++ b/sale_planner_calendar/i18n/sale_planner_calendar.pot @@ -6,6 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 15.0\n" "Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-17 14:09+0000\n" +"PO-Revision-Date: 2024-11-17 14:09+0000\n" "Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -20,13 +22,6 @@ msgid "" " Order" msgstr "" -#. module: sale_planner_calendar -#: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_calendar_event_kanban -msgid "" -"\n" -" Event" -msgstr "" - #. module: sale_planner_calendar #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_form msgid "Invoices" @@ -87,7 +82,7 @@ msgstr "" #. module: sale_planner_calendar #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_reassign_wiz -msgid "Assign new commercial to selected lines" +msgid "Assign new values to selected lines" msgstr "" #. module: sale_planner_calendar @@ -107,30 +102,18 @@ msgstr "" #. module: sale_planner_calendar #: model:ir.model,name:sale_planner_calendar.model_calendar_event -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__calendar_event_id #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz__calendar_event_id #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_wizard__calendar_event_ids msgid "Calendar Event" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__calendar_event_date -msgid "Calendar Event Date" -msgstr "" - -#. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__calendar_event_profile_id -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__calendar_event_profile_id -msgid "Calendar Event Profile" -msgstr "" - -#. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__calendar_issue_type_id +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__calendar_issue_type_id msgid "Calendar Issue Type" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__calendar_summary_id +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__calendar_summary_id msgid "Calendar Summary" msgstr "" @@ -158,13 +141,18 @@ msgid "Cancel" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_event__state__cancel +#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__calendar_event__sale_planner_state__cancel #: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_summary__state__cancel msgid "Cancelled" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__partner_city +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__categ_icons +msgid "Categ Icons" +msgstr "" + +#. module: sale_planner_calendar +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__partner_city #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_kanban msgid "City" msgstr "" @@ -180,7 +168,7 @@ msgid "Closed" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__comment +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__comment #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_summary__comment #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_summary_form msgid "Comment" @@ -192,7 +180,7 @@ msgid "Commercial name" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__partner_commercial_name +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__partner_commercial_name msgid "Commercial partner name" msgstr "" @@ -202,7 +190,6 @@ msgid "Companies" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__company_id #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_summary__company_id msgid "Company" msgstr "" @@ -217,21 +204,12 @@ msgstr "" msgid "Configuration" msgstr "" -#. module: sale_planner_calendar -#. openerp-web -#: code:addons/sale_planner_calendar/static/src/js/basic_controller.js:0 -#, python-format -msgid "Confirm" -msgstr "" - #. module: sale_planner_calendar #: model:ir.model,name:sale_planner_calendar.model_res_partner msgid "Contact" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__create_uid -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event_profile__create_uid #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_issue_type__create_uid #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz__create_uid #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_wiz__create_uid @@ -241,8 +219,6 @@ msgid "Created by" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__create_date -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event_profile__create_date #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_issue_type__create_date #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz__create_date #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_wiz__create_date @@ -252,8 +228,7 @@ msgid "Created on" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__currency_id -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__currency_id +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__sale_planner_currency_id #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_summary__currency_id msgid "Currency" msgstr "" @@ -274,14 +249,11 @@ msgid "Cycle Skip" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__date #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_summary__date msgid "Date" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__display_name -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event_profile__display_name #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_issue_type__display_name #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz__display_name #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_wiz__display_name @@ -296,7 +268,7 @@ msgid "Documents" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_event__state__done +#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__calendar_event__sale_planner_state__done #: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_summary__state__done #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_form #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_search @@ -314,13 +286,6 @@ msgstr "" msgid "Duration" msgstr "" -#. module: sale_planner_calendar -#. openerp-web -#: code:addons/sale_planner_calendar/static/src/js/basic_controller.js:0 -#, python-format -msgid "Edit Recurrent event" -msgstr "" - #. module: sale_planner_calendar #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_summary_form msgid "Effective" @@ -346,17 +311,6 @@ msgstr "" msgid "Event Off Planning Count" msgstr "" -#. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__event_planner_state -msgid "Event Planner State" -msgstr "" - -#. module: sale_planner_calendar -#: model:ir.actions.act_window,name:sale_planner_calendar.action_sale_planner_calendar_event_profile -#: model:ir.ui.menu,name:sale_planner_calendar.menu_sale_planner_calendar_event_profile -msgid "Event Profile" -msgstr "" - #. module: sale_planner_calendar #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz__event_start msgid "Event Start" @@ -373,11 +327,6 @@ msgstr "" msgid "Event planner summary today" msgstr "" -#. module: sale_planner_calendar -#: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_form -msgid "Event schedule" -msgstr "" - #. module: sale_planner_calendar #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_wiz__event_type_id #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_summary__event_type_id @@ -417,11 +366,17 @@ msgid "Followers (Partners)" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,help:sale_planner_calendar.field_sale_planner_calendar_event__profile_icon -#: model:ir.model.fields,help:sale_planner_calendar.field_sale_planner_calendar_event_profile__icon +#: model:ir.model.fields,help:sale_planner_calendar.field_calendar_event_type__icon msgid "Font awesome icon e.g. fa-tasks" msgstr "" +#. module: sale_planner_calendar +#: model:ir.model.fields,help:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz__new_event_categ_ids +#: model:ir.model.fields,help:sale_planner_calendar.field_sale_planner_calendar_reassign_wiz__new_event_categ_ids +msgid "" +"Forces new tags for the specified period. Leave empty to keep current tags." +msgstr "" + #. module: sale_planner_calendar #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.res_config_settings_view_form msgid "Forward months to create calendar events" @@ -434,6 +389,12 @@ msgid "Friday" msgstr "" #. module: sale_planner_calendar +#: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_search +msgid "Future" +msgstr "" + +#. module: sale_planner_calendar +#: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_search #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_summary_search msgid "Group By" msgstr "" @@ -449,8 +410,6 @@ msgid "Hour" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__id -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event_profile__id #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_issue_type__id #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz__id #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_wiz__id @@ -460,14 +419,12 @@ msgid "ID" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__profile_icon -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event_profile__icon +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event_type__icon msgid "Icon" msgstr "" #. module: sale_planner_calendar #: model:ir.model.fields,help:sale_planner_calendar.field_sale_planner_calendar_summary__message_needaction -#: model:ir.model.fields,help:sale_planner_calendar.field_sale_planner_calendar_summary__message_unread msgid "If checked, new messages require your attention." msgstr "" @@ -489,7 +446,7 @@ msgid "Info" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__invoice_amount_residual +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__invoice_amount_residual msgid "Invoice amount due" msgstr "" @@ -541,8 +498,6 @@ msgid "Issues" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event____last_update -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event_profile____last_update #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_issue_type____last_update #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz____last_update #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_wiz____last_update @@ -552,8 +507,6 @@ msgid "Last Modified on" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__write_uid -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event_profile__write_uid #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_issue_type__write_uid #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz__write_uid #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_wiz__write_uid @@ -563,8 +516,6 @@ msgid "Last Updated by" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__write_date -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event_profile__write_date #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_issue_type__write_date #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz__write_date #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_wiz__write_date @@ -584,7 +535,7 @@ msgid "Location" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__location_url +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__location_url msgid "Location Url" msgstr "" @@ -593,6 +544,16 @@ msgstr "" msgid "Main Attachment" msgstr "" +#. module: sale_planner_calendar +#: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_search +msgid "Meeting" +msgstr "" + +#. module: sale_planner_calendar +#: model:ir.ui.menu,name:sale_planner_calendar.menu_calendar_event_type +msgid "Meeting Types" +msgstr "" + #. module: sale_planner_calendar #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_summary__message_has_error msgid "Message Delivery error" @@ -638,7 +599,6 @@ msgid "My summaries" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event_profile__name #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_issue_type__name msgid "Name" msgstr "" @@ -675,6 +635,12 @@ msgstr "" msgid "New salesperson" msgstr "" +#. module: sale_planner_calendar +#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz__new_event_categ_ids +#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_wiz__new_event_categ_ids +msgid "New tags" +msgstr "" + #. module: sale_planner_calendar #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_reassign_wiz msgid "New values" @@ -692,7 +658,7 @@ msgstr "" #. module: sale_planner_calendar #: model:ir.model.fields,help:sale_planner_calendar.field_sale_planner_calendar_summary__message_needaction_counter -msgid "Number of messages which requires an action" +msgid "Number of messages requiring action" msgstr "" #. module: sale_planner_calendar @@ -700,18 +666,13 @@ msgstr "" msgid "Number of messages with delivery error" msgstr "" -#. module: sale_planner_calendar -#: model:ir.model.fields,help:sale_planner_calendar.field_sale_planner_calendar_summary__message_unread_counter -msgid "Number of unread messages" -msgstr "" - #. module: sale_planner_calendar #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_wizard msgid "OK" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__off_planning +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__off_planning msgid "Off Planning" msgstr "" @@ -736,7 +697,6 @@ msgid "Orders" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__partner_id #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz__partner_id #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_wiz__partner_id #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_kanban @@ -744,28 +704,30 @@ msgid "Partner" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__partner_contact_name +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__partner_contact_name msgid "Partner Contact Name" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__partner_mobile +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__partner_mobile msgid "Partner Mobile" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__partner_name +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__partner_name msgid "Partner Name" msgstr "" #. module: sale_planner_calendar +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__partner_user_id +#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz__partner_user_id #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_wiz__partner_user_id -msgid "Partner User" +msgid "Partner salesperson" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz__partner_user_id -msgid "Partner salesperson" +#: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_search +msgid "Past" msgstr "" #. module: sale_planner_calendar @@ -784,7 +746,7 @@ msgid "Payment Sheet" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__payment_sheet_line_ids +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__payment_sheet_line_ids msgid "Payment Sheet Line" msgstr "" @@ -794,31 +756,25 @@ msgid "Payments" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_event__state__pending +#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__calendar_event__sale_planner_state__pending #: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_summary__state__pending #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_form #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_search msgid "Pending" msgstr "" -#. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz__event_user_id -msgid "Planned user" -msgstr "" - #. module: sale_planner_calendar #: model:ir.ui.menu,name:sale_planner_calendar.menu_sale_planner_calendar_summary_general msgid "Planner" msgstr "" #. module: sale_planner_calendar -#: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_calendar_event_kanban -msgid "Planner event" -msgstr "" - -#. module: sale_planner_calendar -#: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_summary_form -msgid "Process" +#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz__event_user_id +#: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_form +#: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_issue_tree +#: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_search +#: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_tree +msgid "Planner salesperson" msgstr "" #. module: sale_planner_calendar @@ -839,12 +795,12 @@ msgid "Recurrent calendar events" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__partner_ref +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__partner_ref msgid "Reference" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__sale_ids +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__sale_ids #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_summary__sale_ids msgid "Sale" msgstr "" @@ -855,7 +811,7 @@ msgid "Sale Order Count" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__sale_order_subtotal +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__sale_order_subtotal #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_summary__sale_order_subtotal msgid "Sale Order Subtotal" msgstr "" @@ -871,7 +827,6 @@ msgid "Sale Planner Calendar" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__sale_planner_calendar_event_id #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_invoice_payment_wiz__sale_planner_calendar_event_id #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_order__sale_planner_calendar_event_id #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_payment_sheet_line__sale_planner_calendar_event_id @@ -879,11 +834,6 @@ msgstr "" msgid "Sale Planner Calendar Event" msgstr "" -#. module: sale_planner_calendar -#: model:ir.model,name:sale_planner_calendar.model_sale_planner_calendar_event_profile -msgid "Sale Planner Calendar Event Profile" -msgstr "" - #. module: sale_planner_calendar #: model:ir.model.fields,field_description:sale_planner_calendar.field_res_company__sale_planner_forward_months #: model:ir.model.fields,field_description:sale_planner_calendar.field_res_config_settings__sale_planner_forward_months @@ -896,6 +846,11 @@ msgstr "" msgid "Sale Planner Order Cut Hour" msgstr "" +#. module: sale_planner_calendar +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__sale_planner_state +msgid "Sale Planner State" +msgstr "" + #. module: sale_planner_calendar #: model:ir.model,name:sale_planner_calendar.model_sale_invoice_payment_wiz msgid "Sale invoice payment wizard" @@ -913,7 +868,6 @@ msgid "Sale planner calendar Wizard" msgstr "" #. module: sale_planner_calendar -#: model:ir.model,name:sale_planner_calendar.model_sale_planner_calendar_event #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_form #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_issue_form msgid "Sale planner calendar event" @@ -964,20 +918,20 @@ msgstr "" #. module: sale_planner_calendar #: model:ir.actions.server,name:sale_planner_calendar.sale_planner_calendar_cron_unsubscribe_ir_actions_server #: model:ir.cron,cron_name:sale_planner_calendar.sale_planner_calendar_cron_unsubscribe -#: model:ir.cron,name:sale_planner_calendar.sale_planner_calendar_cron_unsubscribe msgid "Sale planner calendar: Unsubscribe documents" msgstr "" #. module: sale_planner_calendar #: model:ir.actions.server,name:sale_planner_calendar.cron_update_dynamic_final_date_ir_actions_server #: model:ir.cron,cron_name:sale_planner_calendar.cron_update_dynamic_final_date -#: model:ir.cron,name:sale_planner_calendar.cron_update_dynamic_final_date msgid "Sale planner calendar: Update dynamic event final date" msgstr "" #. module: sale_planner_calendar #: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__target_partner_id #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_calendar_event_form +#: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_calendar_event_search +#: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_search msgid "Sale planner partner" msgstr "" @@ -993,7 +947,7 @@ msgid "Salesperson" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__sanitized_partner_mobile +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__sanitized_partner_mobile msgid "Sanitized Partner Mobile" msgstr "" @@ -1051,25 +1005,28 @@ msgid "" " Set 00:00 to disable warning." msgstr "" +#. module: sale_planner_calendar +#: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_search +msgid "Start" +msgstr "" + #. module: sale_planner_calendar #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_calendar_event_tree_primary_only msgid "Start Date" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__state #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_summary__state msgid "State" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__partner_street +#: model:ir.model.fields,field_description:sale_planner_calendar.field_calendar_event__partner_street #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_kanban msgid "Street" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__name #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_calendar_event_tree_primary_only msgid "Subject" msgstr "" @@ -1086,6 +1043,13 @@ msgstr "" msgid "Susbscriptions Backward Days" msgstr "" +#. module: sale_planner_calendar +#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz__event_categ_ids +#: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_calendar_event_search +#: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_search +msgid "Tags" +msgstr "" + #. module: sale_planner_calendar #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_reassign_wiz msgid "" @@ -1094,7 +1058,7 @@ msgid "" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,help:sale_planner_calendar.field_sale_planner_calendar_reassign_line_wiz__partner_user_id +#: model:ir.model.fields,help:sale_planner_calendar.field_calendar_event__partner_user_id msgid "The internal user in charge of this contact." msgstr "" @@ -1153,16 +1117,6 @@ msgstr "" msgid "Tuesday" msgstr "" -#. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_summary__message_unread -msgid "Unread Messages" -msgstr "" - -#. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_summary__message_unread_counter -msgid "Unread Messages Counter" -msgstr "" - #. module: sale_planner_calendar #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_reassign_wiz msgid "Unselect all lines" @@ -1184,17 +1138,10 @@ msgid "Until" msgstr "" #. module: sale_planner_calendar -#: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_event__user_id #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_summary__user_id msgid "User" msgstr "" -#. module: sale_planner_calendar -#: model:ir.model.fields,help:sale_planner_calendar.field_calendar_event__currency_id -#: model:ir.model.fields,help:sale_planner_calendar.field_sale_planner_calendar_event__currency_id -msgid "Utility field to express amount currency" -msgstr "" - #. module: sale_planner_calendar #: model:ir.model.fields,field_description:sale_planner_calendar.field_sale_planner_calendar_summary__website_message_ids msgid "Website Messages" @@ -1221,8 +1168,3 @@ msgstr "" #: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_kanban msgid "Whatsapp" msgstr "" - -#. module: sale_planner_calendar -#: model_terms:ir.ui.view,arch_db:sale_planner_calendar.view_sale_planner_calendar_reassign_wiz -msgid "or" -msgstr "" diff --git a/sale_planner_calendar/migrations/15.0.3.0.0/post-migration.py b/sale_planner_calendar/migrations/15.0.3.0.0/post-migration.py new file mode 100644 index 00000000000..a7d54239315 --- /dev/null +++ b/sale_planner_calendar/migrations/15.0.3.0.0/post-migration.py @@ -0,0 +1,114 @@ +# Copyright 2024 Tecnativa - Sergio Teruel +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +from openupgradelib import openupgrade +from psycopg2.extensions import AsIs + + +def _sale_planner_calendar_event_to_calendar_event(env): + """Move all data from sale_planner_calendar_event to code model calendar_event""" + sql = """ + UPDATE calendar_event SET + sale_planner_state = spce.state, + calendar_issue_type_id = spce.calendar_issue_type_id, + calendar_event_profile_id = spce.calendar_event_profile_id, + comment = spce.comment, + calendar_summary_id = spce.calendar_summary_id, + off_planning = spce.off_planning + FROM sale_planner_calendar_event spce + WHERE spce.calendar_event_id = calendar_event.id + """ + openupgrade.logged_query(env.cr, sql) + + +def _sale_order_to_calendar_event(env): + """Link sale order to calendar events instead of sale planner calendar event model""" + # drop_constraint(env.cr, 'sale_order', 'sale_order_sale_planner_calendar_event_id_fkey') + openupgrade.logged_query( + env.cr, + """ + UPDATE sale_order SET + sale_planner_calendar_event_id = spce.calendar_event_id + FROM sale_planner_calendar_event spce + WHERE sale_order.%(old_column)s = spce.id + """, + { + "old_column": AsIs( + openupgrade.get_legacy_name("sale_planner_calendar_event_id") + ) + }, + ) + + +def _payment_sheet_to_calendar_event(env): + """Link sale payment sheet to calendar events instead of sale planner calendar + event model + """ + # drop_constraint(env.cr, 'sale_payment_sheet_line', + # 'sale_payment_sheet_line_sale_planner_calendar_event_id_fkey') + openupgrade.logged_query( + env.cr, + """ + UPDATE sale_payment_sheet_line SET + sale_planner_calendar_event_id = spce.calendar_event_id + FROM sale_planner_calendar_event spce + WHERE sale_payment_sheet_line.%(old_column)s = spce.id + """, + { + "old_column": AsIs( + openupgrade.get_legacy_name("sale_planner_calendar_event_id") + ) + }, + ) + + +def _profiles_to_calendar_event_type(env): + openupgrade.logged_query( + env.cr, + """ + INSERT INTO calendar_event_type (name, icon, old_sale_planner_profile_id) + SELECT name, icon, id FROM sale_planner_calendar_event_profile + ON CONFLICT (name) + DO UPDATE SET + icon = EXCLUDED.icon, + old_sale_planner_profile_id = EXCLUDED.old_sale_planner_profile_id; + """, + ) + + # Update event linked to profiles + openupgrade.logged_query( + env.cr, + """ + INSERT INTO meeting_category_rel (event_id, type_id) + SELECT ce.id, cet.id + FROM calendar_event ce + JOIN calendar_event_type cet + ON cet.old_sale_planner_profile_id = ce.calendar_event_profile_id + """, + ) + + +def _remove_renamed_selection_values(env): + """After rename value from upper to lower the values are duplicated. + This method removes old upper values""" + week_list_field = env.ref( + "sale_planner_calendar.field_sale_planner_calendar_wizard__week_list" + ) + value_ids = week_list_field.selection_ids.filtered(lambda x: x.value.isupper()).ids + if value_ids: + openupgrade.logged_query( + env.cr, + """ + DELETE FROM ir_model_fields_selection + WHERE id in %(selection_value_ids)s + """, + {"selection_value_ids": tuple(value_ids)}, + ) + + +@openupgrade.migrate() +def migrate(env, version): + _sale_planner_calendar_event_to_calendar_event(env) + _sale_order_to_calendar_event(env) + _payment_sheet_to_calendar_event(env) + _profiles_to_calendar_event_type(env) + _remove_renamed_selection_values(env) diff --git a/sale_planner_calendar/migrations/15.0.3.0.0/pre-migration.py b/sale_planner_calendar/migrations/15.0.3.0.0/pre-migration.py new file mode 100644 index 00000000000..5f3571db763 --- /dev/null +++ b/sale_planner_calendar/migrations/15.0.3.0.0/pre-migration.py @@ -0,0 +1,37 @@ +# Copyright 2024 Tecnativa - Sergio Teruel +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +from openupgradelib import openupgrade + +_column_renames = { + "sale_order": [ + ("sale_planner_calendar_event_id", None), + ], + "sale_payment_sheet_line": [("sale_planner_calendar_event_id", None)], +} + + +def _remove_selection_field_values(env): + sql = """ + DELETE FROM ir_model_fields_selection + WHERE field_id IN + (SELECT id + FROM ir_model_fields + WHERE ttype='selection' AND model='sale.planner.calendar.event') + """ + openupgrade.logged_query(env.cr, sql) + + +def _add_event_profile_helper_column(env): + openupgrade.logged_query( + env.cr, + """ + ALTER TABLE calendar_event_type + ADD COLUMN old_sale_planner_profile_id integer""", + ) + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.rename_columns(env.cr, _column_renames) + _remove_selection_field_values(env) + _add_event_profile_helper_column(env) diff --git a/sale_planner_calendar/models/__init__.py b/sale_planner_calendar/models/__init__.py index e812663a94f..29fa5771974 100644 --- a/sale_planner_calendar/models/__init__.py +++ b/sale_planner_calendar/models/__init__.py @@ -1,12 +1,10 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -from . import calendar +from . import calendar_event from . import calendar_event_type from . import calendar_attendee from . import res_config_settings from . import res_partner from . import sale_order from . import sale_payment_sheet -from . import sale_planner_calendar_event_profile -from . import sale_planner_calendar_event from . import sale_planner_calendar_issue_type from . import sale_planner_calendar_summary diff --git a/sale_planner_calendar/models/calendar.py b/sale_planner_calendar/models/calendar.py deleted file mode 100644 index 142c81f96c7..00000000000 --- a/sale_planner_calendar/models/calendar.py +++ /dev/null @@ -1,211 +0,0 @@ -# Copyright 2021 Tecnativa - Sergio Teruel -# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). - -from datetime import timedelta - -import pytz - -from odoo import api, fields, models -from odoo.tools.date_utils import relativedelta - -# from odoo.addons.calendar.models.calendar import calendar_id2real_id - - -class CalendarEvent(models.Model): - _inherit = "calendar.event" - - target_partner_id = fields.Many2one( - comodel_name="res.partner", - string="Sale planner partner", - help="Is the partner used in planner", - ) - calendar_event_profile_id = fields.Many2one( - comodel_name="sale.planner.calendar.event.profile" - ) - currency_id = fields.Many2one( - comodel_name="res.currency", related="target_partner_id.currency_id" - ) - hour = fields.Float(compute="_compute_hour", inverse="_inverse_hour") - target_partner_mobile = fields.Char(related="target_partner_id.mobile") - sale_planner_calendar_event_id = fields.Many2one( - comodel_name="sale.planner.calendar.event", - compute="_compute_sale_planner_calendar_event_id", - ) - event_planner_state = fields.Char( - compute="_compute_sale_planner_calendar_event_id", - ) - # When arrive this date we will unsubscribe user from partner documents - unsubscribe_date = fields.Date() - is_dynamic_end_date = fields.Boolean(copy=False) - # dynamic_end_date = fields.Date(compute="_compute_dynamic_end_date") - advanced_cycle = fields.Boolean() - cycle_number = fields.Integer() - cycle_skip = fields.Integer() - # Field to know which event creates the recurrence - is_base_recurrent_event = fields.Boolean( - compute="_compute_is_base_recurrent_event", store=True - ) - - def _apply_recurrence_values(self, values, future=True): - """Method to apply recurrence when 'create_recurrence_new_user' key is set on - the context. - """ - if not self.env.context.get("create_recurrence_new_user") or not future: - return super()._apply_recurrence_values(values, future=future) - to_update = self.env["calendar.recurrence"] - for event in self: - to_update |= event.recurrence_id._split_from(event, values) - self.with_context(create_recurrence_new_user=False).write( - {"recurrency": True, "follow_recurrence": True} - ) - return to_update.with_context( - create_recurrence_new_user=False - )._apply_recurrence() - - @api.depends("recurrence_id", "recurrence_id.calendar_event_ids") - def _compute_is_base_recurrent_event(self): - for record in self: - record.is_base_recurrent_event = ( - record == record.recurrence_id.calendar_event_ids.sorted("start")[:1] - ) - - @api.depends("start") - def _compute_hour(self): - for rec in self: - date = rec._get_hour_tz_offset() - rec.hour = date.hour + date.minute / 60 - - @api.depends("start", "target_partner_id", "user_id") - def _compute_sale_planner_calendar_event_id(self): - # TODO: Adjust order or use [:1] or [-1:] when know model order - domain = [ - ("calendar_event_date", "in", self.mapped("start")), - ("partner_id", "in", self.mapped("target_partner_id").ids), - ("user_id", "=", self.user_id.id), - ] - events = self.env["sale.planner.calendar.event"].search(domain) - for rec in self: - rec.sale_planner_calendar_event_id = events.filtered( - lambda r: ( - r.calendar_event_date == fields.Datetime.to_datetime(rec.start) - and r.partner_id == rec.target_partner_id - and r.user_id == rec.user_id - ) - )[:1] - rec.event_planner_state = rec.sale_planner_calendar_event_id.state - - def _get_hour_tz_offset(self): - timezone = self._context.get("tz") or self.env.user.partner_id.tz or "UTC" - self_tz = self.with_context(tz=timezone) - date = fields.Datetime.context_timestamp(self_tz, self.start) - return date - - def _inverse_hour(self): - for rec in self: - duration = rec.duration - date = self._get_hour_tz_offset() - new_time = date.replace( - hour=int(rec.hour), minute=int(round((rec.hour % 1) * 60)) - ) - # Force to onchange get correct value - new_time = new_time.astimezone(pytz.utc).replace(tzinfo=None) - rec.write( - { - "recurrence_update": "all_events", - "start": new_time, - "stop": new_time + timedelta(minutes=round((duration or 0.5) * 60)), - } - ) - - def _create_event_planner(self): - return self.env["sale.planner.calendar.event"].create( - { - "name": self.name, - "partner_id": self.target_partner_id.id, - "user_id": self.user_id.id, - "calendar_event_date": self.start, - "calendar_event_id": self.id, - "calendar_event_profile_id": self.calendar_event_profile_id.id, - } - ) - - def get_planner_calendar_event(self): - return self.sale_planner_calendar_event_id or self._create_event_planner() - - @api.onchange("start", "stop", "duration") - def _onchange_duration(self): - """Show warning if duration more than max duration set in config.""" - if not self.target_partner_id: - return - max_duration = float( - self.env["ir.config_parameter"] - .sudo() - .get_param( - "sale_planner_calendar.max_duration", - default="0.0", - ) - ) - if max_duration and self.duration > max_duration: - return { - "warning": { - "title": "Max duration exceeded", - "message": "Max duration set in config parameters is {} hours".format( - max_duration - ), - "type": "notification", - } - } - - def action_create_sale_order(self): - """ - Search or Create an event planner linked to sale order - """ - planner_event = self.get_planner_calendar_event() - return planner_event.action_open_sale_order() - - def action_create_event_planner(self): - planner_event = self.get_planner_calendar_event() - return planner_event.get_formview_action() - - @api.model - def cron_update_dynamic_final_date(self): - events_to_update = self.search( - [("is_dynamic_end_date", "=", True), ("is_base_recurrent_event", "=", True)] - ) - new_date = fields.Date.today() + relativedelta( - months=self.env.company.sale_planner_forward_months, day=31 - ) - events_to_update.until = new_date - - def get_week_days_count(self): - days = ["mo", "tu", "we", "th", "fr", "sa"] - days_count = 0 - for day in days: - if self[day]: - days_count += 1 - return days_count - - def _get_recurrent_dates_by_event(self): - dates_list = super()._get_recurrent_dates_by_event() - if not self.advanced_cycle: - return dates_list - new_dates = [] - index = 0 - skip_count = 0 - - cycle_number = self.cycle_number - cycle_skip = self.cycle_skip - if self.rrule_type == "weekly": - days_count = self.get_week_days_count() - cycle_number *= days_count - cycle_skip *= days_count - for dates in dates_list: - if index < cycle_number: - new_dates.append(dates) - index += 1 - else: - skip_count += 1 - if skip_count >= cycle_skip: - index = 0 - skip_count = 0 - return new_dates diff --git a/sale_planner_calendar/models/calendar_event.py b/sale_planner_calendar/models/calendar_event.py new file mode 100644 index 00000000000..8d7760baaa4 --- /dev/null +++ b/sale_planner_calendar/models/calendar_event.py @@ -0,0 +1,421 @@ +# Copyright 2021-2024 Tecnativa - Sergio Teruel +# Copyright 2021-2024 Tecnativa - Carlos Dauden +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +import re +from datetime import timedelta + +import pytz +from dateutil.relativedelta import relativedelta + +from odoo import api, fields, models +from odoo.tools.safe_eval import safe_eval + + +class CalendarEvent(models.Model): + _inherit = "calendar.event" + + target_partner_id = fields.Many2one( + comodel_name="res.partner", + string="Sale planner partner", + help="Is the partner used in planner", + ) + hour = fields.Float(compute="_compute_hour", inverse="_inverse_hour") + target_partner_mobile = fields.Char(related="target_partner_id.mobile") + # When arrive this date we will unsubscribe user from partner documents + unsubscribe_date = fields.Date() + is_dynamic_end_date = fields.Boolean(copy=False) + # dynamic_end_date = fields.Date(compute="_compute_dynamic_end_date") + advanced_cycle = fields.Boolean() + cycle_number = fields.Integer() + cycle_skip = fields.Integer() + # Field to know which event creates the recurrence + is_base_recurrent_event = fields.Boolean( + compute="_compute_is_base_recurrent_event", store=True + ) + sale_planner_currency_id = fields.Many2one( + comodel_name="res.currency", + related="target_partner_id.currency_id", + ) + sale_ids = fields.One2many( + comodel_name="sale.order", + inverse_name="sale_planner_calendar_event_id", + ) + sale_planner_state = fields.Selection( + [ + ("pending", "Pending"), + ("done", "Done"), + ("cancel", "Cancelled"), + ], + default="pending", + readonly=True, + tracking=True, + ) + calendar_issue_type_id = fields.Many2one( + comodel_name="sale.planner.calendar.issue.type", ondelete="restrict" + ) + comment = fields.Text() + sale_order_subtotal = fields.Monetary( + compute="_compute_sale_order_subtotal", + currency_field="sale_planner_currency_id", + ) + calendar_summary_id = fields.Many2one( + comodel_name="sale.planner.calendar.summary", + copy=False, + ) + invoice_amount_residual = fields.Monetary( + string="Invoice amount due", + compute="_compute_invoice_amount_residual", + compute_sudo=True, + currency_field="sale_planner_currency_id", + ) + invoice_date_due = fields.Date( + string="Due Date", + compute="_compute_invoice_amount_residual", + compute_sudo=True, + ) + off_planning = fields.Boolean(copy=False) + payment_sheet_line_ids = fields.One2many( + comodel_name="sale.payment.sheet.line", + inverse_name="sale_planner_calendar_event_id", + ) + # Helper fields for kanban views + partner_ref = fields.Char(related="target_partner_id.ref") + partner_name = fields.Char(compute="_compute_partner_name") + partner_commercial_name = fields.Char( + string="Commercial partner name", + related="target_partner_id.commercial_partner_id.name", + ) + partner_street = fields.Char(related="target_partner_id.street") + partner_mobile = fields.Char(compute="_compute_contact") + partner_contact_name = fields.Char(compute="_compute_contact") + partner_city = fields.Char(related="target_partner_id.city") + partner_user_id = fields.Many2one( + related="target_partner_id.user_id", string="Partner salesperson" + ) + sanitized_partner_mobile = fields.Char(compute="_compute_sanitized_partner_mobile") + location_url = fields.Char(compute="_compute_location_url") + profile_icon = fields.Char(related="categ_ids.icon") + + @api.depends("recurrence_id", "recurrence_id.calendar_event_ids") + def _compute_is_base_recurrent_event(self): + for record in self: + record.is_base_recurrent_event = ( + record == record.recurrence_id.calendar_event_ids.sorted("start")[:1] + ) + + @api.depends("start") + def _compute_hour(self): + for rec in self: + date = rec._get_hour_tz_offset() + rec.hour = date.hour + date.minute / 60 + + @api.depends("sale_ids.amount_untaxed") + def _compute_sale_order_subtotal(self): + for rec in self: + rec.sale_order_subtotal = sum(rec.mapped("sale_ids.amount_untaxed")) + + @api.depends("target_partner_id") + def _compute_invoice_amount_residual(self): + partner_ids = self.mapped("target_partner_id.commercial_partner_id").ids + groups = self.env["account.move"].read_group( + domain=[ + ("state", "=", "posted"), + ("payment_state", "!=", "paid"), + ("partner_id", "in", partner_ids), + ], + fields=["amount_residual_signed", "invoice_date_due:min"], + groupby=["partner_id"], + orderby="id", + ) + invoice_dic = { + g["partner_id"][0]: { + "amount_residual_signed": g["amount_residual_signed"], + "invoice_date_due": g["invoice_date_due"], + } + for g in groups + } + for rec in self: + partner_vals = invoice_dic.get( + rec.target_partner_id.commercial_partner_id.id, + {"amount_residual_signed": 0.0, "invoice_date_due": False}, + ) + amount_residual = partner_vals["amount_residual_signed"] + payment_amount = sum( + rec.payment_sheet_line_ids.filtered( + lambda p: p.sheet_id.state == "open" + ).mapped("amount") + ) + rec.invoice_amount_residual = amount_residual - payment_amount + rec.invoice_date_due = partner_vals["invoice_date_due"] + + @api.depends("target_partner_id") + def _compute_partner_name(self): + field_name = ( + self.env["ir.config_parameter"] + .sudo() + .get_param( + "sale_planner_calendar.partner_name_field", + default="name", + ) + ) + for event in self: + # If more flexibility is needed use event.mapped(field_name)[0] + event.partner_name = ( + event.target_partner_id[field_name] + or event.target_partner_id.name + or event.target_partner_id.commercial_partner_id.name + ) + + @api.depends("target_partner_id") + def _compute_contact(self): + for rec in self: + contact = rec.target_partner_id.child_ids.filtered( + "is_sale_planner_contact" + )[:1] + rec.partner_mobile = (contact.mobile or contact.phone) or ( + rec.target_partner_id.mobile or rec.target_partner_id.phone + ) + rec.partner_contact_name = contact.name + + @api.depends("partner_mobile") + def _compute_sanitized_partner_mobile(self): + self.sanitized_partner_mobile = False + for rec in self.filtered("partner_mobile"): + rec.sanitized_partner_mobile = re.sub(r"\W+", "", rec.partner_mobile) + + @api.depends("target_partner_id") + def _compute_location_url(self): + # The url is built to access the location from a google link. This will be done + # taking into account the location of the calendar event associated with the calendar + # planner event. If this location is not defined, the client's coordinates will + # be taken into account if they are defined, otherwise the client's address + # will be taken into account. + self.location_url = False + for event in self: + event_location = event.location + partner_latitude = str(event.target_partner_id.partner_latitude).replace( + ",", "." + ) + partner_longitude = str(event.target_partner_id.partner_longitude).replace( + ",", "." + ) + partner_location = f"{event.partner_city}+{event.partner_street}" + if event_location: + event.location_url = event_location.replace(" ", "+") + elif partner_latitude != "0.0" or partner_longitude != "0.0": + event.location_url = f"{partner_latitude}%2C{partner_longitude}" + elif partner_location: + event.location_url = partner_location.replace(" ", "+") + + def _inverse_hour(self): + for rec in self: + duration = rec.duration + date = self._get_hour_tz_offset() + new_time = date.replace( + hour=int(rec.hour), minute=int(round((rec.hour % 1) * 60)) + ) + # Force to onchange get correct value + new_time = new_time.astimezone(pytz.utc).replace(tzinfo=None) + rec.write( + { + "recurrence_update": "all_events", + "start": new_time, + "stop": new_time + timedelta(minutes=round((duration or 0.5) * 60)), + } + ) + + @api.onchange("start", "stop", "duration") + def _onchange_duration(self): + """Show warning if duration more than max duration set in config.""" + if not self.target_partner_id: + return + max_duration = float( + self.env["ir.config_parameter"] + .sudo() + .get_param( + "sale_planner_calendar.max_duration", + default="0.0", + ) + ) + if max_duration and self.duration > max_duration: + return { + "warning": { + "title": "Max duration exceeded", + "message": "Max duration set in config parameters is {} hours".format( + max_duration + ), + "type": "notification", + } + } + + @api.onchange("categ_ids") + def _onchange_categ_ids(self): + if not self.name and self.categ_ids: + self.name = self.categ_ids[:1].name + # Clean name if is equal to stored categ name and this categ is removed + elif not self.categ_ids and self.name == self._origin.categ_ids[:1].name: + self.name = False + + def action_open_sale_order(self, new_order=False): + """ + Search or Create an event planner linked to sale order + """ + action_xml_id = ( + self.env["ir.config_parameter"] + .sudo() + .get_param( + "sale_planner_calendar.action_open_sale_order", + "sale.action_quotations_with_onboarding", + ) + ) + action = self.env["ir.actions.act_window"]._for_xml_id(action_xml_id) + if new_order: + action["name"] = "New Quotation" + action["context"] = self.env.context + return action + # Create sale order to planner partner or commercial partner depending of the + # system parameter + create_so_to_commercial_partner = ( + self.env["ir.config_parameter"] + .sudo() + .get_param("sale_planner_calendar.create_so_to_commercial_partner", "False") + ) + partner = ( + self.target_partner_id + if create_so_to_commercial_partner == "False" + else self.target_partner_id.commercial_partner_id + ) + action["context"] = { + "default_sale_planner_calendar_event_id": self.id, + "default_partner_id": partner.id, + "default_partner_shipping_id": self.target_partner_id.id, + "default_user_id": self.user_id.id, + } + if len(self.sale_ids) > 1: + action["domain"] = [("sale_planner_calendar_event_id", "=", self.id)] + else: + action["views"] = list(filter(lambda v: v[1] == "form", action["views"])) + action["res_id"] = self.sale_ids.id + return action + + def action_open_invoices(self): + action = self.env["ir.actions.act_window"]._for_xml_id( + "sale_payment_sheet.action_invoice_sale_payment_sheet" + ) + ctx = safe_eval(action["context"]) + ctx.update( + { + "default_partner_id": self.target_partner_id.id, + } + ) + action["context"] = ctx + domain = safe_eval(action["domain"]) + domain.append( + ("partner_id", "=", self.target_partner_id.commercial_partner_id.id), + ) + action["domain"] = domain + return action + + def action_open_unpaid_invoice(self): + domain = [ + ("state", "=", "posted"), + ("move_type", "in", ["out_invoice", "out_refund"]), + ("partner_id", "=", self.target_partner_id.commercial_partner_id.id), + ("payment_state", "!=", "paid"), + ] + unpaid_invoices = self.env["account.move"].search(domain) + action = self.env["ir.actions.act_window"]._for_xml_id( + "sale_payment_sheet.action_sale_invoice_payment_wiz" + ) + ctx = safe_eval(action["context"]) + ctx.update( + { + "invoice_ids": unpaid_invoices.ids, + "default_sale_planner_calendar_event_id": self.id, + "default_partner_id": self.target_partner_id.id, + } + ) + action["context"] = ctx + return action + + def action_done(self): + self.write( + { + "sale_planner_state": "done", + } + ) + + def action_cancel(self): + self.write( + { + "sale_planner_state": "cancel", + "comment": "Not done", + } + ) + + def action_pending(self): + self.write( + { + "sale_planner_state": "pending", + "comment": False, + } + ) + + def action_open_issue(self): + action = self.env["ir.actions.act_window"]._for_xml_id( + "sale_planner_calendar.action_sale_planner_calendar_issue" + ) + action["res_id"] = self.id + return action + + def action_apply_issue(self): + pass + + def _get_hour_tz_offset(self): + timezone = self._context.get("tz") or self.env.user.partner_id.tz or "UTC" + self_tz = self.with_context(tz=timezone) + date = fields.Datetime.context_timestamp(self_tz, self.start) + return date + + def get_week_days_count(self): + days = ["mo", "tu", "we", "th", "fr", "sa"] + days_count = 0 + for day in days: + if self[day]: + days_count += 1 + return days_count + + def _get_recurrent_dates_by_event(self): + dates_list = super()._get_recurrent_dates_by_event() + if not self.advanced_cycle: + return dates_list + new_dates = [] + index = 0 + skip_count = 0 + + cycle_number = self.cycle_number + cycle_skip = self.cycle_skip + if self.rrule_type == "weekly": + days_count = self.get_week_days_count() + cycle_number *= days_count + cycle_skip *= days_count + for dates in dates_list: + if index < cycle_number: + new_dates.append(dates) + index += 1 + else: + skip_count += 1 + if skip_count >= cycle_skip: + index = 0 + skip_count = 0 + return new_dates + + @api.model + def cron_update_dynamic_final_date(self): + events_to_update = self.search( + [("is_dynamic_end_date", "=", True), ("is_base_recurrent_event", "=", True)] + ) + new_date = fields.Date.today() + relativedelta( + months=self.env.company.sale_planner_forward_months, day=31 + ) + events_to_update.until = new_date diff --git a/sale_planner_calendar/models/calendar_event_type.py b/sale_planner_calendar/models/calendar_event_type.py index ad75dfab021..97e3b5e1be1 100644 --- a/sale_planner_calendar/models/calendar_event_type.py +++ b/sale_planner_calendar/models/calendar_event_type.py @@ -1,4 +1,5 @@ -# Copyright 2021 Tecnativa - Sergio Teruel +# Copyright 2021-2024 Tecnativa - Sergio Teruel +# Copyright 2021-2024 Tecnativa - Carlos Dauden # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from odoo import fields, models @@ -8,3 +9,4 @@ class CalendarEventType(models.Model): _inherit = "calendar.event.type" duration = fields.Float() + icon = fields.Char(help="Font awesome icon e.g. fa-tasks") diff --git a/sale_planner_calendar/models/res_config_settings.py b/sale_planner_calendar/models/res_config_settings.py index a48364ce713..3396c74ccb1 100644 --- a/sale_planner_calendar/models/res_config_settings.py +++ b/sale_planner_calendar/models/res_config_settings.py @@ -28,6 +28,10 @@ class ResConfigSettings(models.TransientModel): string="Calendar event max duration", config_parameter="sale_planner_calendar.max_duration", ) + sale_planner_done_on_sale_confirm = fields.Boolean( + related="company_id.sale_planner_done_on_sale_confirm", + readonly=False, + ) class ResCompany(models.Model): @@ -43,3 +47,6 @@ class ResCompany(models.Model): string="Send invitation to attendees", default=True ) sale_planner_order_cut_hour = fields.Float() + sale_planner_done_on_sale_confirm = fields.Boolean( + string="Event done when confirm sale" + ) diff --git a/sale_planner_calendar/models/res_partner.py b/sale_planner_calendar/models/res_partner.py index 06f75857835..e4ef4e61091 100644 --- a/sale_planner_calendar/models/res_partner.py +++ b/sale_planner_calendar/models/res_partner.py @@ -2,9 +2,10 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from datetime import timedelta +from dateutil.relativedelta import relativedelta + from odoo import _, fields, models from odoo.exceptions import ValidationError -from odoo.tools.date_utils import relativedelta class ResPartner(models.Model): @@ -22,7 +23,8 @@ def action_calendar_planner(self): action["context"] = { "default_target_partner_id": self.id, "default_categ_ids": [(4, categ.id)], - "default_location": self._display_address(), + # Passing True omits the partner name, ensuring precise calculation of GPS location. + "default_location": self._display_address(True).replace("\n", " "), "default_duration": categ.duration, "default_name": categ.name, "default_start": fields.Datetime.now(), diff --git a/sale_planner_calendar/models/sale_order.py b/sale_planner_calendar/models/sale_order.py index c30c09ccf4d..85a7ed0df1f 100644 --- a/sale_planner_calendar/models/sale_order.py +++ b/sale_planner_calendar/models/sale_order.py @@ -1,16 +1,16 @@ # Copyright 2021 Tecnativa - Sergio Teruel # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from datetime import timedelta + +from dateutil.relativedelta import relativedelta from odoo import _, api, fields, models -from odoo.tools import relativedelta class SaleOrder(models.Model): _inherit = "sale.order" - sale_planner_calendar_event_id = fields.Many2one( - comodel_name="sale.planner.calendar.event" - ) + sale_planner_calendar_event_id = fields.Many2one(comodel_name="calendar.event") def _action_confirm(self): event_obj = self.env["calendar.event"] @@ -29,16 +29,21 @@ def _action_confirm(self): ) if delivery_event: order.commitment_date = delivery_event.start + if order.company_id.sale_planner_done_on_sale_confirm: + delivery_event.action_done() return super()._action_confirm() def _prepare_calendar_event_planner(self): + categ = self.env.ref("sale_planner_calendar.event_type_commercial_visit") return { "name": _("Sale off planning"), - "partner_id": self.partner_id.id, + "target_partner_id": self.partner_id.id, "user_id": self.user_id.id, - "date": self.date_order, + "start": self.date_order, + "stop": self.date_order + + timedelta(minutes=round((categ.duration or 1.0) * 60)), "off_planning": True, - "state": "done", + "sale_planner_state": "done", } def action_set_planner_calendar_event(self, planner_summary=False): @@ -55,20 +60,17 @@ def action_set_planner_calendar_event(self, planner_summary=False): max(order_dates), self.env.company.sale_planner_order_cut_hour ) + relativedelta(days=1) calendar_event_domain = [ - ("partner_id", "in", orders.partner_id.ids), + ("target_partner_id", "in", orders.partner_id.ids), ("user_id", "in", orders.user_id.ids), - ("date", ">=", date_from), - ("date", "<", date_to), + ("start", ">=", date_from), + ("start", "<", date_to), ] if planner_summary.event_type_id: calendar_event_domain.append( - ("calendar_event_id.categ_ids", "in", planner_summary.event_type_id.ids) + ("categ_ids", "in", planner_summary.event_type_id.ids) ) - calendar_events = self.env["sale.planner.calendar.event"].search( - calendar_event_domain - ) + calendar_events = self.env["calendar.event"].search(calendar_event_domain) planner_summary_domain = [ - ("user_id", "in", orders.user_id.ids), ("user_id", "in", orders.user_id.ids), ("date", ">=", date_from.date()), ("date", "<", date_to.date()), @@ -85,11 +87,11 @@ def action_set_planner_calendar_event(self, planner_summary=False): cut_time = date_from.time() for order in orders: event = calendar_events.filtered( - lambda ev: ev.partner_id == order.partner_id + lambda ev: ev.target_partner_id == order.partner_id and ev.user_id == order.user_id - and (ev.date.combine(ev.date.date(), cut_time) <= order.date_order) + and (ev.start.combine(ev.start.date(), cut_time) <= order.date_order) and ( - ev.date.combine(ev.date.date(), cut_time) + relativedelta(days=1) + ev.start.combine(ev.start.date(), cut_time) + relativedelta(days=1) > order.date_order ) )[:1] @@ -114,7 +116,7 @@ def action_set_planner_calendar_event(self, planner_summary=False): continue event_vals = order._prepare_calendar_event_planner() event_vals["calendar_summary_id"] = event_summary.id - event = self.env["sale.planner.calendar.event"].create(event_vals) + event = self.env["calendar.event"].create(event_vals) order.sale_planner_calendar_event_id = event @api.model_create_multi diff --git a/sale_planner_calendar/models/sale_payment_sheet.py b/sale_planner_calendar/models/sale_payment_sheet.py index 48b1dccf9ba..0669c75480b 100644 --- a/sale_planner_calendar/models/sale_payment_sheet.py +++ b/sale_planner_calendar/models/sale_payment_sheet.py @@ -7,6 +7,4 @@ class SalePaymentSheetLine(models.Model): _inherit = "sale.payment.sheet.line" - sale_planner_calendar_event_id = fields.Many2one( - comodel_name="sale.planner.calendar.event" - ) + sale_planner_calendar_event_id = fields.Many2one(comodel_name="calendar.event") diff --git a/sale_planner_calendar/models/sale_planner_calendar_event.py b/sale_planner_calendar/models/sale_planner_calendar_event.py deleted file mode 100644 index 4fca31e02e8..00000000000 --- a/sale_planner_calendar/models/sale_planner_calendar_event.py +++ /dev/null @@ -1,282 +0,0 @@ -# Copyright 2021 Tecnativa - Sergio Teruel -# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). - -import re - -from odoo import api, fields, models -from odoo.tools.safe_eval import safe_eval - - -class SalePlannerCalendarEvent(models.Model): - _name = "sale.planner.calendar.event" - _description = "Sale planner calendar event" - - name = fields.Char(string="Subject") - company_id = fields.Many2one( - comodel_name="res.company", default=lambda self: self.env.company.id - ) - currency_id = fields.Many2one( - comodel_name="res.currency", - related="partner_id.currency_id", - ) - date = fields.Datetime(default=fields.Datetime.now) - calendar_event_id = fields.Many2one( - comodel_name="calendar.event", - ) - calendar_event_date = fields.Datetime(index=True) - user_id = fields.Many2one( - comodel_name="res.users", - default=lambda self: self.env.user.id, - index=True, - domain="[('share','=',False)]", - ) - partner_id = fields.Many2one(comodel_name="res.partner", index=True) - sale_ids = fields.One2many( - comodel_name="sale.order", - inverse_name="sale_planner_calendar_event_id", - ) - state = fields.Selection( - [ - ("pending", "Pending"), - ("done", "Done"), - ("cancel", "Cancelled"), - ], - default="pending", - readonly=True, - ) - calendar_issue_type_id = fields.Many2one( - comodel_name="sale.planner.calendar.issue.type", ondelete="restrict" - ) - calendar_event_profile_id = fields.Many2one( - comodel_name="sale.planner.calendar.event.profile" - ) - comment = fields.Text() - sale_order_subtotal = fields.Monetary( - compute="_compute_sale_order_subtotal", currency_field="currency_id" - ) - calendar_summary_id = fields.Many2one( - comodel_name="sale.planner.calendar.summary", - ) - invoice_amount_residual = fields.Monetary( - string="Invoice amount due", - compute="_compute_invoice_amount_residual", - compute_sudo=True, - ) - off_planning = fields.Boolean() - payment_sheet_line_ids = fields.One2many( - comodel_name="sale.payment.sheet.line", - inverse_name="sale_planner_calendar_event_id", - ) - # Helper fields to kanban views - partner_ref = fields.Char(related="partner_id.ref") - partner_name = fields.Char(compute="_compute_partner_name") - partner_commercial_name = fields.Char( - string="Commercial partner name", - related="partner_id.commercial_partner_id.name", - ) - partner_street = fields.Char(related="partner_id.street") - partner_mobile = fields.Char(compute="_compute_contact") - partner_contact_name = fields.Char(compute="_compute_contact") - partner_city = fields.Char(related="partner_id.city") - sanitized_partner_mobile = fields.Char(compute="_compute_sanitized_partner_mobile") - location_url = fields.Char(compute="_compute_location_url") - profile_icon = fields.Char(related="calendar_event_profile_id.icon") - - @api.depends("sale_ids.amount_untaxed") - def _compute_sale_order_subtotal(self): - for rec in self: - rec.sale_order_subtotal = sum(rec.mapped("sale_ids.amount_untaxed")) - - # @api.depends("target_partner_id") - def _compute_invoice_amount_residual(self): - groups = self.env["account.move"].read_group( - [ - ("state", "=", "posted"), - ("payment_state", "!=", "paid"), - ( - "partner_id", - "in", - self.mapped("partner_id.commercial_partner_id").ids, - ), - ], - ["amount_residual_signed"], - ["partner_id"], - ) - invoice_dic = {g["partner_id"][0]: g["amount_residual_signed"] for g in groups} - for rec in self: - amount_residual = invoice_dic.get( - rec.partner_id.commercial_partner_id.id, 0.0 - ) - rec.invoice_amount_residual = amount_residual - sum( - rec.payment_sheet_line_ids.filtered( - lambda p: p.sheet_id.state == "open" - ).mapped("amount") - ) - - def _compute_partner_name(self): - field_name = ( - self.env["ir.config_parameter"] - .sudo() - .get_param( - "sale_planner_calendar.partner_name_field", - default="name", - ) - ) - for event in self: - # If more flexibility is needed use event.mapped(field_name)[0] - event.partner_name = ( - event.partner_id[field_name] - or event.partner_id.name - or event.partner_id.commercial_partner_id.name - ) - - def _compute_contact(self): - for rec in self: - contact = rec.partner_id.child_ids.filtered("is_sale_planner_contact")[:1] - rec.partner_mobile = (contact.mobile or contact.phone) or ( - rec.partner_id.mobile or rec.partner_id.phone - ) - rec.partner_contact_name = contact.name - - def _compute_sanitized_partner_mobile(self): - self.sanitized_partner_mobile = False - for rec in self.filtered("partner_mobile"): - rec.sanitized_partner_mobile = re.sub(r"\W+", "", rec.partner_mobile) - - def _compute_location_url(self): - # The url is built to access the location from a google link. This will be done - # taking into account the location of the calendar event associated with the calendar - # planner event. If this location is not defined, the client's coordinates will - # be taken into account if they are defined, otherwise the client's address - # will be taken into account. - self.location_url = False - for rec in self: - event_location = rec.calendar_event_id.location - partner_latitude = str(rec.partner_id.partner_latitude).replace(",", ".") - partner_longitude = str(rec.partner_id.partner_longitude).replace(",", ".") - partner_location = f"{rec.partner_city}+{rec.partner_street}" - if event_location: - self.location_url = event_location.replace(" ", "+") - elif partner_latitude != "0.0" or partner_longitude != "0.0": - self.location_url = f"{partner_latitude}%2C{partner_longitude}" - elif partner_location: - self.location_url = partner_location.replace(" ", "+") - - def action_open_sale_order(self, new_order=False): - """ - Search or Create an event planner linked to sale order - """ - action_xml_id = ( - self.env["ir.config_parameter"] - .sudo() - .get_param( - "sale_planner_calendar.action_open_sale_order", - "sale.action_quotations_with_onboarding", - ) - ) - action = self.env["ir.actions.act_window"]._for_xml_id(action_xml_id) - if new_order: - action["name"] = "New Quotation" - action["context"] = self.env.context - return action - # Create sale order to planner partner or commercial partner depending of the - # system parameter - create_so_to_commercial_partner = ( - self.env["ir.config_parameter"] - .sudo() - .get_param("sale_planner_calendar.create_so_to_commercial_partner", "False") - ) - partner = ( - self.partner_id - if create_so_to_commercial_partner == "False" - else self.partner_id.commercial_partner_id - ) - action["context"] = { - "default_sale_planner_calendar_event_id": self.id, - "default_partner_id": partner.id, - "default_partner_shipping_id": self.partner_id.id, - "default_user_id": self.user_id.id, - } - if len(self.sale_ids) > 1: - action["domain"] = [("sale_planner_calendar_event_id", "=", self.id)] - else: - action["views"] = list(filter(lambda v: v[1] == "form", action["views"])) - action["res_id"] = self.sale_ids.id - return action - - def action_open_invoices(self): - action = self.env["ir.actions.act_window"]._for_xml_id( - "sale_payment_sheet.action_invoice_sale_payment_sheet" - ) - ctx = safe_eval(action["context"]) - ctx.update( - { - "default_partner_id": self.partner_id.id, - } - ) - action["context"] = ctx - domain = safe_eval(action["domain"]) - domain.append( - ("partner_id", "=", self.partner_id.commercial_partner_id.id), - ) - action["domain"] = domain - return action - - def action_open_unpaid_invoice(self): - domain = [ - ("state", "=", "posted"), - ("move_type", "in", ["out_invoice", "out_refund"]), - ("partner_id", "=", self.partner_id.commercial_partner_id.id), - ("payment_state", "!=", "paid"), - ] - unpaid_invoices = self.env["account.move"].search(domain) - action = self.env["ir.actions.act_window"]._for_xml_id( - "sale_payment_sheet.action_sale_invoice_payment_wiz" - ) - ctx = safe_eval(action["context"]) - ctx.update( - { - "invoice_ids": unpaid_invoices.ids, - "default_sale_planner_calendar_event_id": self.id, - "default_partner_id": self.partner_id.id, - } - ) - action["context"] = ctx - return action - - def action_done(self): - self.write( - { - "state": "done", - "date": fields.Datetime.now(), - # "comment": 'Done', - } - ) - - def action_cancel(self): - self.write( - { - "state": "cancel", - "comment": "Not done", - "date": fields.Datetime.now(), - } - ) - - def action_pending(self): - self.write( - { - "state": "pending", - "comment": False, - "date": self.calendar_event_date, - } - ) - - def action_open_issue(self): - action = self.env["ir.actions.act_window"]._for_xml_id( - "sale_planner_calendar.action_sale_planner_calendar_issue" - ) - action["res_id"] = self.id - return action - - def action_apply_issue(self): - pass diff --git a/sale_planner_calendar/models/sale_planner_calendar_event_profile.py b/sale_planner_calendar/models/sale_planner_calendar_event_profile.py deleted file mode 100644 index 44fdb778abf..00000000000 --- a/sale_planner_calendar/models/sale_planner_calendar_event_profile.py +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright 2024 Tecnativa - Pilar Vargas -# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). - -from odoo import fields, models - - -class CalendarEventType(models.Model): - """ - Calendar planner event profiles are used to categorise such events. Each type is a - type of activity, e.g. face-to-face, telephone, message. This will allow an icon - identifying the event to be displayed - """ - - _name = "sale.planner.calendar.event.profile" - _description = "Sale Planner Calendar Event Profile" - - name = fields.Char(required=True) - icon = fields.Char(help="Font awesome icon e.g. fa-tasks") diff --git a/sale_planner_calendar/models/sale_planner_calendar_summary.py b/sale_planner_calendar/models/sale_planner_calendar_summary.py index 7e060543cf7..df2c5f0dbf4 100644 --- a/sale_planner_calendar/models/sale_planner_calendar_summary.py +++ b/sale_planner_calendar/models/sale_planner_calendar_summary.py @@ -22,7 +22,7 @@ class SalePlannerCalendarSummary(models.Model): ) date = fields.Date(default=fields.Date.context_today) sale_planner_calendar_event_ids = fields.One2many( - comodel_name="sale.planner.calendar.event", + comodel_name="calendar.event", inverse_name="calendar_summary_id", ) user_id = fields.Many2one( @@ -70,7 +70,7 @@ def _compute_sale_ids(self): @api.depends( "sale_planner_calendar_event_ids", - "sale_planner_calendar_event_ids.state", + "sale_planner_calendar_event_ids.sale_planner_state", "sale_planner_calendar_event_ids.sale_ids", "sale_planner_calendar_event_ids.off_planning", ) @@ -84,7 +84,7 @@ def _compute_event_planner_count(self): payment_amount = 0.0 for event in summary.sale_planner_calendar_event_ids: event_total_count += 1 - if event.state == "done": + if event.sale_planner_state == "done": event_done_count += 1 if event.sale_ids: event_effective_count += 1 @@ -215,53 +215,56 @@ def action_process(self): ), ("user_id", "=", self.user_id.id), ("target_partner_id", "!=", False), + ("calendar_summary_id", "=", False), ] if self.event_type_id: calendar_event_domain.append(("categ_ids", "in", self.event_type_id.ids)) calendar_events = self.env["calendar.event"].search(calendar_event_domain) + calendar_events.calendar_summary_id = self + # + # event_planner_domain = [ + # ( + # "start", + # ">=", + # self._get_datetime_from_date_tz_hour(self.date, "00:00:00"), + # ), + # ( + # "start", + # "<=", + # self._get_datetime_from_date_tz_hour(self.date, "23:59:59"), + # ), + # ("user_id", "=", self.user_id.id), + # "|", + # ("calendar_summary_id", "=", False), + # ("calendar_summary_id", "=", self.id), + # ] + # events_planner = self.env["calendar.event"].search( + # event_planner_domain + # ) + # # We can not do a typical search due to returned virtual ids like this + # # ("calendar_event_id.categ_ids", "in", self.event_type_id.ids) + # if self.event_type_id: + # events_planner = events_planner.filtered( + # lambda p: self.event_type_id.id in p.calendar_event_id.categ_ids.ids + # ) + # + # for calendar_event in calendar_events: + # event_planner = events_planner.filtered( + # lambda r: r.start + # == fields.Datetime.to_datetime(calendar_event.start) + # and r.partner_id == calendar_event.target_partner_id + # and r.user_id == calendar_event.user_id + # ) + # if event_planner: + # if event_planner.calendar_summary_id != self: + # event_planner.calendar_summary_id = self + # event_planner.off_planning = True + # else: + # calendar_event.with_context( + # default_calendar_summary_id=self.id, + # default_date=calendar_event.start, + # )._create_event_planner() - event_planner_domain = [ - ( - "calendar_event_date", - ">=", - self._get_datetime_from_date_tz_hour(self.date, "00:00:00"), - ), - ( - "calendar_event_date", - "<=", - self._get_datetime_from_date_tz_hour(self.date, "23:59:59"), - ), - ("user_id", "=", self.user_id.id), - "|", - ("calendar_summary_id", "=", False), - ("calendar_summary_id", "=", self.id), - ] - events_planner = self.env["sale.planner.calendar.event"].search( - event_planner_domain - ) - # We can not do a typical search due to returned virtual ids like this - # ("calendar_event_id.categ_ids", "in", self.event_type_id.ids) - if self.event_type_id: - events_planner = events_planner.filtered( - lambda p: self.event_type_id.id in p.calendar_event_id.categ_ids.ids - ) - - for calendar_event in calendar_events: - event_planner = events_planner.filtered( - lambda r: r.calendar_event_date - == fields.Datetime.to_datetime(calendar_event.start) - and r.partner_id == calendar_event.target_partner_id - and r.user_id == calendar_event.user_id - ) - if event_planner: - if event_planner.calendar_summary_id != self: - event_planner.calendar_summary_id = self - event_planner.off_planning = True - else: - calendar_event.with_context( - default_calendar_summary_id=self.id, - default_date=calendar_event.start, - )._create_event_planner() # Search sale orders off planning date_from = self._get_datetime_from_date_tz_hour( self.date, self.env.company.sale_planner_order_cut_hour @@ -295,8 +298,7 @@ def _get_datetime_from_date_tz_hour(self, date, hour_float): return time_utc def action_event_planner(self): - if not self.sale_planner_calendar_event_ids: - self.action_process() + self.action_process() action = self.env["ir.actions.act_window"]._for_xml_id( "sale_planner_calendar.action_sale_planner_calendar_event" ) diff --git a/sale_planner_calendar/security/ir.model.access.csv b/sale_planner_calendar/security/ir.model.access.csv index 28a46962e6b..e57738cdc0f 100644 --- a/sale_planner_calendar/security/ir.model.access.csv +++ b/sale_planner_calendar/security/ir.model.access.csv @@ -1,8 +1,6 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_sale_planner_calendar_event,access_sale_planner_calendar_event,model_sale_planner_calendar_event,sales_team.group_sale_salesman,1,1,1,1 access_sale_planner_calendar_summary,access_sale_planner_calendar_summary,model_sale_planner_calendar_summary,sales_team.group_sale_salesman,1,1,1,1 access_sale_planner_calendar_issue_type,access_sale_planner_calendar_issue_type,model_sale_planner_calendar_issue_type,sales_team.group_sale_salesman,1,1,1,1 access_sale_planner_calendar_reassign_wiz,access_sale_planner_calendar_reassign_wiz,model_sale_planner_calendar_reassign_wiz,sales_team.group_sale_salesman,1,1,1,1 access_sale_planner_calendar_reassign_line_wiz,access_sale_planner_calendar_reassign_line_wiz,model_sale_planner_calendar_reassign_line_wiz,sales_team.group_sale_salesman,1,1,1,1 access_sale_planner_calendar_wizard,access_sale_planner_calendar_wizard,model_sale_planner_calendar_wizard,sales_team.group_sale_salesman,1,1,1,1 -sale_planner_calendar.access_sale_planner_calendar_event_profile,access_sale_planner_calendar_event_profile,sale_planner_calendar.model_sale_planner_calendar_event_profile,sales_team.group_sale_salesman,1,1,1,1 diff --git a/sale_planner_calendar/static/src/js/sale_planner_calendar_event_sales.js b/sale_planner_calendar/static/src/js/sale_planner_calendar_event_sales.js index c0912e711c4..23bf102e13d 100644 --- a/sale_planner_calendar/static/src/js/sale_planner_calendar_event_sales.js +++ b/sale_planner_calendar/static/src/js/sale_planner_calendar_event_sales.js @@ -16,7 +16,7 @@ odoo.define( var calendar_summary_id = self.initialState.getContext().default_calendar_summary_id; this._rpc({ - model: "sale.planner.calendar.event", + model: "calendar.event", method: "action_open_sale_order", args: [false, {new_order: true}], context: {calendar_summary_id: calendar_summary_id || false}, diff --git a/sale_planner_calendar/tests/test_sale_planner_calendar.py b/sale_planner_calendar/tests/test_sale_planner_calendar.py index 5f27b89ac1a..9eab0fc867f 100644 --- a/sale_planner_calendar/tests/test_sale_planner_calendar.py +++ b/sale_planner_calendar/tests/test_sale_planner_calendar.py @@ -1,7 +1,7 @@ # Copyright 2021 Tecnativa - Sergio Teruel # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -from datetime import date +from datetime import date, timedelta from freezegun import freeze_time @@ -34,7 +34,10 @@ def setUpClass(cls): cls.AccountInvoiceLine = cls.env["account.move.line"] cls.AccountJournal = cls.env["account.journal"] cls.SaleOrder = cls.env["sale.order"] - cls.SalePlannerCalendarEvent = cls.env["sale.planner.calendar.event"] + cls.SalePlannerCalendarEvent = cls.env["calendar.event"] + + account_group = cls.env.ref("account.group_account_user") + cls.env.user.write({"groups_id": [(4, account_group.id)]}) cls.event_type_commercial_visit = cls.env.ref( "sale_planner_calendar.event_type_commercial_visit" @@ -168,7 +171,7 @@ def _create_sale_order_from_planner(self, event_planner_id): self.SaleOrder.with_context( default_user_id=event_planner_id.user_id.id, default_sale_planner_calendar_event_id=event_planner_id.id, - default_partner_id=event_planner_id.partner_id.id, + default_partner_id=event_planner_id.target_partner_id.id, ) ) with so_form.order_line.new() as line_form: @@ -195,7 +198,10 @@ def test_create_calendar_planner_event(self): event = self.planned_events[0] self.assertTrue(event.user_id in self.commercial_users) self.assertEqual(event.rrule_type, "weekly") - self.assertEqual(event.location, event.target_partner_id._display_address()) + self.assertEqual( + event.location, + event.target_partner_id._display_address(True).replace("\n", " "), + ) def test_planner_calendar_wizard(self): wiz_form = Form(self.env["sale.planner.calendar.wizard"]) @@ -224,7 +230,7 @@ def test_summary_and_event_today(self): self.assertEqual(summary.sale_order_count, 2) self.assertEqual(summary.sale_order_subtotal, 200) # Create a new invoice from planner event - self.invoice1 = self._create_invoice(event_planner_id.partner_id) + self.invoice1 = self._create_invoice(event_planner_id.target_partner_id) self.invoice1.action_post() self.assertEqual(event_planner_id.invoice_amount_residual, 100) # Set event to done state @@ -245,16 +251,62 @@ def test_reassign_wizard(self): wiz_form.new_user_id = self.commercial_user_2 record = wiz_form.save() record.select_all_lines() - record.action_assign_new_salesperson() + record.action_assign_new_values() self.assertEqual(len(record.line_ids.mapped("new_user_id")), 1) wiz_form.new_user_id = self.commercial_user_2 record = wiz_form.save() record.line_ids = False record.action_get_lines() record.line_ids[0].selected = True - record.action_assign_new_salesperson() + record.action_assign_new_values() self.assertEqual(len(record.line_ids.filtered(lambda ln: ln.new_user_id)), 1) + def test_reassign_wizard_apply(self): + # When creating new recurring events for reallocated changes, + # each event must have a new recurrence. This test is + # incorporated to control that no event is left without recurrence. + wiz_form = Form(self.env["sale.planner.calendar.reassign.wiz"]) + wiz_form.user_id = self.commercial_user_1 + wiz_form.assign_new_salesperson_to_partner = True + wiz_form.new_start = date.today() + timedelta(days=8) + wiz_form.new_end = wiz_form.new_start + timedelta(days=20) + record = wiz_form.save() + record.action_get_lines() + record.line_ids[0].new_user_id = self.commercial_user_2 + old_event = record.line_ids[0].calendar_event_id + recurrence_events = old_event.recurrence_id.calendar_event_ids + new_base_event_start = recurrence_events.filtered( + lambda ce: ce.start.date() >= record.new_start + ).sorted("start")[:1] + self.assertTrue(new_base_event_start.recurrence_id) + self.assertEqual(new_base_event_start.recurrence_id, old_event.recurrence_id) + new_base_event_end = recurrence_events.filtered( + lambda ce: ce.start.date() >= record.new_end + ).sorted("start")[:1] + self.assertTrue(new_base_event_end.recurrence_id) + self.assertEqual(new_base_event_end.recurrence_id, old_event.recurrence_id) + record.apply() + # Events created for changes must have a new recurrence created from the old event + self.assertTrue( + self.env["calendar.event"].browse(new_base_event_start.id).recurrence_id + ) + self.assertNotEqual( + self.env["calendar.event"].browse(new_base_event_start.id).recurrence_id, + old_event.recurrence_id, + ) + self.assertTrue( + self.env["calendar.event"].browse(new_base_event_end.id).recurrence_id + ) + self.assertNotEqual( + self.env["calendar.event"].browse(new_base_event_end.id).recurrence_id, + old_event.recurrence_id, + ) + # The original event must maintain its recurrence + self.assertEqual( + self.env["calendar.event"].browse(old_event.id).recurrence_id, + old_event.recurrence_id, + ) + def test_reassign_wizard_subscriptions(self): # Create a SO for partner 1 and user commercial 1 sale_order = self._create_sale_order() @@ -287,7 +339,7 @@ def test_reassign_wizard_subscriptions(self): lambda ln: ln.partner_id == self.partner_1 ) event_planner_partner_1.selected = True - record.action_assign_new_salesperson() + record.action_assign_new_values() record.apply() # Check document permissions based on followers # Sale order @@ -309,15 +361,9 @@ def test_parter_sale_order(self): """User can setup a system parameter to create sale order from a event planner for a event planner partner or commercial partner """ - calendar_event = self.planned_events.filtered( + sale_planned_event = self.planned_events.filtered( lambda p: p.target_partner_id == self.partner_3 )[:1] - sale_planned_event = self.SalePlannerCalendarEvent.create( - { - "partner_id": self.partner_3.id, - "calendar_event_id": calendar_event.id, - } - ) so_action = sale_planned_event.action_open_sale_order() self.assertEqual(so_action["context"]["default_partner_id"], self.partner_3.id) # Set parameter to create sale order to commercial partner diff --git a/sale_planner_calendar/views/calendar_event_type_view.xml b/sale_planner_calendar/views/calendar_event_type_view.xml index 64d1fc96919..84d41fcba46 100644 --- a/sale_planner_calendar/views/calendar_event_type_view.xml +++ b/sale_planner_calendar/views/calendar_event_type_view.xml @@ -8,6 +8,7 @@ + diff --git a/sale_planner_calendar/views/calendar_view.xml b/sale_planner_calendar/views/calendar_view.xml index 0a6bb7d0dce..4da45120c8f 100644 --- a/sale_planner_calendar/views/calendar_view.xml +++ b/sale_planner_calendar/views/calendar_view.xml @@ -22,7 +22,12 @@ - + @@ -43,7 +48,7 @@ 'choose_unlink_method': True, } [('recurrency', '=', True), - ("is_base_recurrent_event", "=", True), '|', ('recurrence_id.until', '>=', datetime.date.today().strftime("%Y-%m-%d")), ('recurrence_id.until', '=', False)] + ("is_base_recurrent_event", "=", True), ('target_partner_id', '!=', False), '|', ('recurrence_id.until', '>=', datetime.date.today().strftime("%Y-%m-%d")), ('recurrence_id.until', '=', False)] @@ -67,6 +72,20 @@ /> + + + + @@ -77,7 +96,6 @@ - @@ -114,12 +132,9 @@ - - + - + @@ -148,19 +167,6 @@ - - - - - Event - - - @@ -171,16 +177,22 @@ My Calendar calendar.event - tree,kanban,form + calendar,tree,kanban,form Schedule a new calendar event + { 'search_default_start_today': 1, 'choose_unlink_method': True, } - [('user_id', '=', uid)] + [('user_id', '=', uid), ('target_partner_id', '!=', False)] diff --git a/sale_planner_calendar/views/res_config_settings_views.xml b/sale_planner_calendar/views/res_config_settings_views.xml index 0e1c36b0077..c4ece8b5d4a 100644 --- a/sale_planner_calendar/views/res_config_settings_views.xml +++ b/sale_planner_calendar/views/res_config_settings_views.xml @@ -90,6 +90,22 @@ + + + + + Set event as done when related sale order is confirmed. + + + + + + + + diff --git a/sale_planner_calendar/views/sale_planner_calendar_event_profile_view.xml b/sale_planner_calendar/views/sale_planner_calendar_event_profile_view.xml deleted file mode 100644 index 80e838d8b10..00000000000 --- a/sale_planner_calendar/views/sale_planner_calendar_event_profile_view.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - sale.planner.calendar.event.profile.tree - sale.planner.calendar.event.profile - - - - - - - - - - Event Profile - sale.planner.calendar.event.profile - tree - - - diff --git a/sale_planner_calendar/views/sale_planner_calendar_event_view.xml b/sale_planner_calendar/views/sale_planner_calendar_event_view.xml index f90422f5731..2758cd16a30 100644 --- a/sale_planner_calendar/views/sale_planner_calendar_event_view.xml +++ b/sale_planner_calendar/views/sale_planner_calendar_event_view.xml @@ -3,12 +3,23 @@ sale.planner.calendar.event - sale.planner.calendar.event + calendar.event + 40 - + + + + + + + - + + + + + + + + + sale.planner.calendar.event.tree - sale.planner.calendar.event + calendar.event - - - + + + + - + + + sale.planner.calendar.event.form - sale.planner.calendar.event + calendar.event @@ -74,7 +124,7 @@ class="oe_stat_button" name="action_done" type="object" - attrs="{'invisible':[('state', 'not in', ['pending'])]}" + attrs="{'invisible':[('sale_planner_state', 'not in', ['pending'])]}" icon="fa-check" > @@ -83,7 +133,7 @@ name="action_cancel" string="Cancel" type="object" - attrs="{'invisible':[('state', 'in', ['cancel', 'done'])]}" + attrs="{'invisible':[('sale_planner_state', 'in', ['cancel', 'done'])]}" icon="fa-close" /> @@ -104,11 +154,7 @@ > - + Sales @@ -121,62 +167,58 @@ > - + Invoices - + - - - - - + + + + + + + + - - - - - - - - - + + + + sale.planner.calendar.issue.form - sale.planner.calendar.event + calendar.event - + @@ -204,22 +246,22 @@ sale.planner.calendar.issue.tree - sale.planner.calendar.event + calendar.event - - - + + + - + Sale planner calendar issue - sale.planner.calendar.event + calendar.event form new Sale planner calendar issue - sale.planner.calendar.event + calendar.event tree,form sale.planner.calendar.event.kanban - sale.planner.calendar.event + calendar.event - - + + - - + @@ -265,7 +306,7 @@ - + @@ -282,9 +323,9 @@ - @@ -292,17 +333,17 @@ - + @@ -444,8 +483,15 @@ + + + @@ -495,6 +541,15 @@ /> Issue + + + @@ -508,10 +563,20 @@ Sale planner calendar events - sale.planner.calendar.event - tree,form,kanban + calendar.event + kanban,tree,form + {'search_default_start_today': 1, 'search_default_my_event_planner': 1} + >{'search_default_my_event_planner': 1, 'search_default_planner_today': 1, + 'search_default_state_pending': 1, + 'tree_view_ref':'sale_planner_calendar.view_sale_planner_calendar_tree', + 'form_view_ref':'sale_planner_calendar.view_sale_planner_calendar_form', + 'kanban_view_ref':'sale_planner_calendar.view_sale_planner_calendar_kanban' + } + [('target_partner_id', '!=', False)] diff --git a/sale_planner_calendar/views/sale_planner_calendar_menu.xml b/sale_planner_calendar/views/sale_planner_calendar_menu.xml index 3618aaa43e3..a20b43477d4 100644 --- a/sale_planner_calendar/views/sale_planner_calendar_menu.xml +++ b/sale_planner_calendar/views/sale_planner_calendar_menu.xml @@ -45,6 +45,19 @@ action="account.res_partner_action_customer" sequence="40" /> + + - + @@ -61,14 +56,6 @@ - - + Subtotal diff --git a/sale_planner_calendar/wizard/sale_invoice_payment.py b/sale_planner_calendar/wizard/sale_invoice_payment.py index 93914077ce0..a7f291c98cd 100644 --- a/sale_planner_calendar/wizard/sale_invoice_payment.py +++ b/sale_planner_calendar/wizard/sale_invoice_payment.py @@ -8,9 +8,7 @@ class SaleInvoicePaymentWiz(models.TransientModel): _inherit = "sale.invoice.payment.wiz" - sale_planner_calendar_event_id = fields.Many2one( - comodel_name="sale.planner.calendar.event" - ) + sale_planner_calendar_event_id = fields.Many2one(comodel_name="calendar.event") def _prepare_sheet_line_values(self, invoice, amount_pay): values = super()._prepare_sheet_line_values(invoice, amount_pay) diff --git a/sale_planner_calendar/wizard/sale_planner_calendar_reassign.py b/sale_planner_calendar/wizard/sale_planner_calendar_reassign.py index 4fe1cdf34e4..7d840ba5f49 100644 --- a/sale_planner_calendar/wizard/sale_planner_calendar_reassign.py +++ b/sale_planner_calendar/wizard/sale_planner_calendar_reassign.py @@ -10,6 +10,7 @@ class SalePlannerCalendarReassignWiz(models.TransientModel): _name = "sale.planner.calendar.reassign.wiz" _description = "Sale planner calendar reassign wizard" + _rec_name = "user_id" user_id = fields.Many2one( comodel_name="res.users", @@ -35,6 +36,7 @@ class SalePlannerCalendarReassignWiz(models.TransientModel): partner_id = fields.Many2one(comodel_name="res.partner") partner_user_id = fields.Many2one( comodel_name="res.users", + string="Partner salesperson", domain="[('share','=',False)]", ) new_user_id = fields.Many2one( @@ -50,6 +52,11 @@ class SalePlannerCalendarReassignWiz(models.TransientModel): comodel_name="sale.planner.calendar.reassign.line.wiz", inverse_name="reassign_wiz_id", ) + new_event_categ_ids = fields.Many2many( + comodel_name="calendar.event.type", + string="New tags", + help="Forces new tags for the specified period. Leave empty to keep current tags.", + ) @api.onchange( "user_id", "event_type_id", "week_list", "partner_user_id", "partner_id" @@ -62,6 +69,7 @@ def action_get_lines(self): ("recurrency", "=", True), ("recurrence_id.until", ">", self.new_start or fields.Date.today()), ("is_base_recurrent_event", "=", True), + ("target_partner_id", "!=", False), ] if self.user_id: domain.append(("user_id", "=", self.user_id.id)) @@ -80,18 +88,20 @@ def action_get_lines(self): { "reassign_wiz_id": self.id, "calendar_event_id": calendar_event.id, + # "event_categ_ids": [(6, 0, calendar_event.categ_ids.ids)], "event_user_id": calendar_event.user_id.id, "partner_id": calendar_event.target_partner_id.id, + "partner_user_id": calendar_event.partner_user_id.id, "event_start": calendar_event.start, "until": calendar_event.until, } ) - def action_assign_new_salesperson(self): + def action_assign_new_values(self): lines = self.line_ids.filtered("selected") lines.new_user_id = self.new_user_id + lines.new_event_categ_ids = self.new_event_categ_ids lines.selected = False - self.new_user_id = False def select_all_lines(self): self.line_ids.selected = True @@ -115,29 +125,6 @@ def apply(self): continue old_event = line.calendar_event_id recurrence_events = old_event.recurrence_id.calendar_event_ids - new_base_event_start = recurrence_events.filtered( - lambda ce: ce.start.date() >= self.new_start - ).sorted("start")[:1] - partner_ids = ( - new_base_event_start.partner_ids - - line.event_user_id.partner_id - + line.new_user_id.partner_id - ).ids - new_base_event_start.with_context(create_recurrence_new_user=True).write( - { - "recurrence_update": "future_events", - "user_id": line.new_user_id.id, - "partner_ids": [ - (6, False, partner_ids), - ], - # Next fields has different behavior if 'self.new_end' field has a - # value - "is_dynamic_end_date": False - if self.new_end - else old_event.is_dynamic_end_date, - "unsubscribe_date": self.new_end, - } - ) if self.new_end: new_base_event_end = recurrence_events.filtered( lambda ce: ce.start.date() >= self.new_end @@ -147,7 +134,7 @@ def apply(self): + line.event_user_id.partner_id - line.new_user_id.partner_id ).ids - new_base_event_end.with_context(create_recurrence_new_user=True).write( + new_base_event_end.write( { "recurrence_update": "future_events", "user_id": line.event_user_id.id, @@ -157,6 +144,33 @@ def apply(self): "is_dynamic_end_date": old_event.is_dynamic_end_date, } ) + new_base_event_start = recurrence_events.filtered( + lambda ce: ce.start.date() >= self.new_start + ).sorted("start")[:1] + partner_ids = ( + new_base_event_start.partner_ids + - line.event_user_id.partner_id + + line.new_user_id.partner_id + ).ids + new_base_event_vals = { + "recurrence_update": "future_events", + "user_id": line.new_user_id.id, + "partner_ids": [ + (6, False, partner_ids), + ], + # Next fields has different behavior if 'self.new_end' field has a + # value + "is_dynamic_end_date": False + if self.new_end + else old_event.is_dynamic_end_date, + "unsubscribe_date": self.new_end, + } + if line.new_event_categ_ids: + new_base_event_vals["categ_ids"] = [ + (6, 0, line.new_event_categ_ids.ids) + ] + new_base_event_start.write(new_base_event_vals) + old_event_vals = { "recurrence_update": "all_events", "is_dynamic_end_date": False, @@ -206,15 +220,17 @@ class SalePlannerCalendarReassignLineWiz(models.TransientModel): reassign_wiz_id = fields.Many2one(comodel_name="sale.planner.calendar.reassign.wiz") selected = fields.Boolean() calendar_event_id = fields.Many2one(comodel_name="calendar.event", readonly=True) + event_categ_ids = fields.Many2many( + comodel_name="calendar.event.type", related="calendar_event_id.categ_ids" + ) partner_id = fields.Many2one(comodel_name="res.partner", readonly=True) partner_user_id = fields.Many2one( - string="Partner salesperson", comodel_name="res.users", - related="partner_id.user_id", + string="Partner salesperson", ) event_user_id = fields.Many2one( comodel_name="res.users", - string="Planned user", + string="Planner salesperson", readonly=True, domain="[('share','=',False)]", ) @@ -222,6 +238,12 @@ class SalePlannerCalendarReassignLineWiz(models.TransientModel): comodel_name="res.users", domain="[('share','=',False)]", ) + new_event_categ_ids = fields.Many2many( + comodel_name="calendar.event.type", + string="New tags", + help="Forces new tags for the specified period. Leave empty to keep current tags.", + ) + event_start = fields.Datetime(readonly=True) until = fields.Datetime(readonly=True) diff --git a/sale_planner_calendar/wizard/sale_planner_calendar_reassign.xml b/sale_planner_calendar/wizard/sale_planner_calendar_reassign.xml index 66af145db9c..9695af91a2a 100644 --- a/sale_planner_calendar/wizard/sale_planner_calendar_reassign.xml +++ b/sale_planner_calendar/wizard/sale_planner_calendar_reassign.xml @@ -57,46 +57,63 @@ - - - - - + + + + - + + + + + + + + + + + - + + + + + + - - - - - - - - - - - - - - + +
Schedule a new calendar event