diff --git a/addons/account/models/chart_template.py b/addons/account/models/chart_template.py index 21fcbff39a7..7512bf15f3b 100644 --- a/addons/account/models/chart_template.py +++ b/addons/account/models/chart_template.py @@ -770,7 +770,7 @@ class WizardMultiChartsAccounts(models.TransientModel): if company_id: company = self.env['res.company'].browse(company_id) currency_id = company.on_change_country(company.country_id.id)['value']['currency_id'] - res.update({'currency_id': currency_id.id}) + res.update({'currency_id': currency_id}) chart_templates = account_chart_template.search([('visible', '=', True)]) if chart_templates: diff --git a/addons/account/static/src/js/reconciliation/reconciliation_renderer.js b/addons/account/static/src/js/reconciliation/reconciliation_renderer.js index 91139aa0926..048d6ce9387 100644 --- a/addons/account/static/src/js/reconciliation/reconciliation_renderer.js +++ b/addons/account/static/src/js/reconciliation/reconciliation_renderer.js @@ -613,7 +613,7 @@ var LineRenderer = Widget.extend(FieldManagerMixin, { /** * @private */ - _onFilterChange: function () { + _onFilterChange: function (event) { this.trigger_up('change_filter', {'data': _.str.strip($(event.target).val())}); }, /** diff --git a/addons/base_vat_autocomplete/models/res_partner.py b/addons/base_vat_autocomplete/models/res_partner.py index 41b40ec9c1d..93d74c497f8 100644 --- a/addons/base_vat_autocomplete/models/res_partner.py +++ b/addons/base_vat_autocomplete/models/res_partner.py @@ -30,16 +30,23 @@ class ResPartner(models.Model): city = lines.pop() return (cp, city) else: - result = re.match('((?:L-|AT-)?[0-9\-]+) (.+)', lines[-1]) + result = re.match('((?:L-|AT-)?[0-9\-]+[A-Z]{,2}) (.+)', lines[-1]) if result: lines.pop() return (result.group(1), result.group(2)) return False + def _set_address_field(partner, field, value): + partner[field] = value + non_set_address_fields.remove(field) + if stdnum_vat is None: return {} for partner in self: + # If a field is non set in this algorithm + # wipe it anyway + non_set_address_fields = set(['street', 'street2', 'city', 'zip', 'state_id', 'country_id']) if not partner.vat: return {} if len(partner.vat) > 5 and partner.vat[:2].lower() in stdnum_vat.country_codes: @@ -68,14 +75,20 @@ class ResPartner(models.Model): lines = [x.strip() for x in lines[0].split(',') if x] if len(lines) == 1: lines = [x.strip() for x in lines[0].split(' ') if x] - partner.street = lines.pop(0) + + _set_address_field(partner, 'street', lines.pop(0)) + if len(lines) > 0: res = _check_city(lines, result['countryCode']) if res: - partner.zip = res[0] - partner.city = res[1] + _set_address_field(partner, 'zip', res[0]) + _set_address_field(partner, 'city', res[1]) if len(lines) > 0: - partner.street2 = lines.pop(0) + _set_address_field(partner, 'street2', lines.pop(0)) country = self.env['res.country'].search([('code', '=', result['countryCode'])], limit=1) - partner.country_id = country and country.id or False + _set_address_field(partner, 'country_id', country and country.id or False) + + for field in non_set_address_fields: + if partner[field]: + partner[field] = False diff --git a/addons/calendar/i18n/calendar.pot b/addons/calendar/i18n/calendar.pot index b7f2a7cfe3d..f13382c3979 100644 --- a/addons/calendar/i18n/calendar.pot +++ b/addons/calendar/i18n/calendar.pot @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-11-30 13:12+0000\n" -"PO-Revision-Date: 2017-11-30 13:12+0000\n" +"POT-Creation-Date: 2018-02-07 10:30+0000\n" +"PO-Revision-Date: 2018-02-07 10:30+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -272,11 +272,6 @@ msgid "\n" "" msgstr "" -#. module: calendar -#: model:ir.model.fields,field_description:calendar.field_calendar_event_is_highlighted -msgid "# Meetings Highlight" -msgstr "" - #. module: calendar #: model:mail.template,subject:calendar.calendar_template_meeting_reminder msgid "${object.event_id.name} - Reminder" @@ -805,6 +800,11 @@ msgstr "" msgid "Invite wizard" msgstr "" +#. module: calendar +#: model:ir.model.fields,field_description:calendar.field_calendar_event_is_highlighted +msgid "Is the Event Highlighted" +msgstr "" + #. module: calendar #: selection:calendar.event,byday:0 msgid "Last" diff --git a/addons/calendar/models/calendar.py b/addons/calendar/models/calendar.py index 97676349df9..6fcf24f2c35 100644 --- a/addons/calendar/models/calendar.py +++ b/addons/calendar/models/calendar.py @@ -823,7 +823,7 @@ class Meeting(models.Model): attendee_ids = fields.One2many('calendar.attendee', 'event_id', 'Participant', ondelete='cascade') partner_ids = fields.Many2many('res.partner', 'calendar_event_res_partner_rel', string='Attendees', states={'done': [('readonly', True)]}, default=_default_partners) alarm_ids = fields.Many2many('calendar.alarm', 'calendar_alarm_calendar_event_rel', string='Reminders', ondelete="restrict", copy=False) - is_highlighted = fields.Boolean(compute='_compute_is_highlighted', string='# Meetings Highlight') + is_highlighted = fields.Boolean(compute='_compute_is_highlighted', string='Is the Event Highlighted') @api.multi def _compute_attendee(self): @@ -1478,7 +1478,7 @@ class Meeting(models.Model): partners_to_notify = meeting.partner_ids.ids event_attendees_changes = attendees_create and real_ids and attendees_create[real_ids[0]] if event_attendees_changes: - partners_to_notify.append(event_attendees_changes['removed_partners'].ids) + partners_to_notify.extend(event_attendees_changes['removed_partners'].ids) self.env['calendar.alarm_manager'].notify_next_alarm(partners_to_notify) if (values.get('start_date') or values.get('start_datetime') or diff --git a/addons/crm_phone_validation/__manifest__.py b/addons/crm_phone_validation/__manifest__.py index 7c729bfae3e..72a21dbfcfa 100644 --- a/addons/crm_phone_validation/__manifest__.py +++ b/addons/crm_phone_validation/__manifest__.py @@ -13,6 +13,7 @@ CRM Phone Numbers Validation This module allows for validate and format phone numbers for leads and contacts.""", 'data': [ 'views/res_config_settings_views.xml', + 'views/crm_lead_views.xml' ], 'depends': [ 'phone_validation', diff --git a/addons/crm_phone_validation/models/crm_lead.py b/addons/crm_phone_validation/models/crm_lead.py index a652f1bd5ca..76c1617c5f2 100644 --- a/addons/crm_phone_validation/models/crm_lead.py +++ b/addons/crm_phone_validation/models/crm_lead.py @@ -8,13 +8,12 @@ class Lead(models.Model): _name = 'crm.lead' _inherit = ['crm.lead', 'phone.validation.mixin'] - @api.onchange('phone', 'country_id') + @api.onchange('phone', 'country_id', 'company_id') def _onchange_phone_validation(self): if self.phone: self.phone = self.phone_format(self.phone) - @api.onchange('mobile', 'country_id') + @api.onchange('mobile', 'country_id', 'company_id') def _onchange_mobile_validation(self): if self.mobile: self.mobile = self.phone_format(self.mobile) - diff --git a/addons/crm_phone_validation/models/res_partner.py b/addons/crm_phone_validation/models/res_partner.py index 97f5eaf891d..5328fe9e7d8 100644 --- a/addons/crm_phone_validation/models/res_partner.py +++ b/addons/crm_phone_validation/models/res_partner.py @@ -8,12 +8,12 @@ class Contact(models.Model): _name = 'res.partner' _inherit = ['res.partner', 'phone.validation.mixin'] - @api.onchange('phone', 'country_id') + @api.onchange('phone', 'country_id', 'company_id') def _onchange_phone_validation(self): if self.phone: self.phone = self.phone_format(self.phone) - @api.onchange('mobile', 'country_id') + @api.onchange('mobile', 'country_id', 'company_id') def _onchange_mobile_validation(self): if self.mobile: self.mobile = self.phone_format(self.mobile) diff --git a/addons/crm_phone_validation/views/crm_lead_views.xml b/addons/crm_phone_validation/views/crm_lead_views.xml new file mode 100644 index 00000000000..bcf1840bd7a --- /dev/null +++ b/addons/crm_phone_validation/views/crm_lead_views.xml @@ -0,0 +1,13 @@ + + + + crm.lead.form.opportunity.inherit.crm.phone.validation + crm.lead + + + + + + + + diff --git a/addons/hr_maintenance/__manifest__.py b/addons/hr_maintenance/__manifest__.py index 71be2347203..5554d8e2dec 100644 --- a/addons/hr_maintenance/__manifest__.py +++ b/addons/hr_maintenance/__manifest__.py @@ -14,5 +14,5 @@ ], 'demo': [], 'installable': True, - 'auto-install': True, + 'auto_install': True, } diff --git a/addons/l10n_be/i18n_extra/nl_BE.po b/addons/l10n_be/i18n_extra/nl_BE.po index 08330c05d08..88d6c4b61ee 100644 --- a/addons/l10n_be/i18n_extra/nl_BE.po +++ b/addons/l10n_be/i18n_extra/nl_BE.po @@ -147,7 +147,7 @@ msgstr "12% Diverse goederen" #: model:account.tax,name:l10n_be.1_attn_VAT-IN-V83-12-CC #: model:account.tax.template,name:l10n_be.attn_VAT-IN-V83-12-CC msgid "12% Cocont. - Biens d'investissement" -msgstr "0% Medecont. - Investeringsgoederen" +msgstr "12% Medecont. - Investeringsgoederen" #. module: l10n_be #: model:account.tax,name:l10n_be.1_attn_VAT-IN-V83-12-CC-C1 @@ -389,7 +389,7 @@ msgstr "21% Medecont. G." #: model:account.tax,name:l10n_be.1_attn_VAT-IN-V83-21-CC-C2 #: model:account.tax.template,name:l10n_be.attn_VAT-IN-V83-21-CC-C2 msgid "21% Cocont. Récupérable - Biens d'investissement" -msgstr "12% Medecont. Verhaalbaar - Investeringsgoederen" +msgstr "21% Medecont. Verhaalbaar - Investeringsgoederen" #. module: l10n_be #: model:account.tax,name:l10n_be.1_attn_VAT-IN-V81-21-CC-C2 diff --git a/addons/l10n_co/data/account.account.template.csv b/addons/l10n_co/data/account.account.template.csv index 4bb5aedf148..e73728e96cf 100644 --- a/addons/l10n_co/data/account.account.template.csv +++ b/addons/l10n_co/data/account.account.template.csv @@ -58,6 +58,34 @@ co_puc_235510,235510,Socios,TRUE,account.data_account_type_payable,l10n_co_chart co_puc_236005,236005,Dividendos,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic co_puc_236505,236505,Salarios y Pagos Laborales,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic co_puc_236510,236510,Dividendos y/o Participaciones,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic +co_puc_23651505,23651505,Retencion en la fuente por honorarios persona natural 10%,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic +co_puc_23651510,23651510,Retencion en la fuente por honorarios persona Juridica 11%,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic +co_puc_23651515,23651515,Retencion en la fuente por servicios de licencias software 3.5%,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic +co_puc_23651520,23651520,Retencion en la fuente por servicios de diseño web y consultorí informática 3.5%,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic +co_puc_23652005,23652005,Retencion en la fuente por comisiones persona natural 10%,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic +co_puc_23652010,23652010,Retencion en la fuente por comisiones persona juridica 11%,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic +co_puc_23652505,23652505,Retencion en la fuente por servicios en general 4%,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic +co_puc_23652510,23652510,Retencion en la fuente por servicios en general personas naturales no declarantes Renta 6%,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic +co_puc_23652515,23652515,Retencion en la fuente por servicio transporte nacional carga 1%,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic +co_puc_23652520,23652520,Retencion en la fuente por servicio transporte terrestre nacional pasajeros 3.5%,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic +co_puc_23652525,23652525,Retencion en la fuente por servicio transporte aereo y maritimo nacional pasajeros 1%,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic +co_puc_23652530,23652530,Retencion en la fuente por servicio temporales de empleo (sobre AIU) 1%,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic +co_puc_23652535,23652535,Retencion en la fuente por servicio de vigilancia y aseo (sobre AIU) 2%,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic +co_puc_23652540,23652540,Retencion en la fuente por servicio integrales de salud 2%,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic +co_puc_23652545,23652545,Retencion en la fuente por servicio de hoteles y restaurantes 3.5%,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic +co_puc_23652550,23652550,Retencion en la fuente por contratos de obra inmuebles 2%,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic +co_puc_23653005,23653005,Retencion en la fuente por arrendamientos Bienes Muebles 4%,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic +co_puc_23653010,23653010,Retencion en la fuente por arrendamientos Bienes Inmuebles 3.5%,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic +co_puc_23653510,23653510,Retencion en la fuente por rendimientos financieros generales 7%,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic +co_puc_23654005,23654005,Retencion en la fuente por compras declarantes 2.5%,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic +co_puc_23654010,23654010,Retencion en la fuente por compras no declarantes 3.5%,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic +co_puc_23654015,23654015,Retencion en la fuente por compras bienes agricolas 1.5%,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic +co_puc_23654020,23654020,Retencion en la fuente por compra cafe 0.5%,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic +co_puc_23654025,23654025,Retencion en la fuente por compra combustibles 0.1%,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic +co_puc_23654030,23654030,Retencion en la fuente por adquisicion de vehiculos 1%,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic +co_puc_23654035,23654035,Retencion en la fuente por adquisicion de bienes raices comerciales 2.5%,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic +co_puc_23654040,23654040,Retencion en la fuente por ventas de activos fijos 1%,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic +co_puc_23655005,23655005,Retencion en la fuente por consultorias servicios tecnicos y asistencia tecnica pagos al exterior 10%,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic co_puc_236575,236575,Autorretenciones,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic co_puc_236705,236705,Impuesto a Las Ventas Retenido,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic co_puc_236805,236805,Impuesto de Industria y Comercio Retenido,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic @@ -81,6 +109,7 @@ co_puc_2408101005,2408101005,Compra Anulada Iva 19%,FALSE,account.data_account_t co_puc_2408101010,2408101010,Compra Anulada Iva 5%,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic co_puc_2408101015,2408101015,Compra Anulada Iva 16%,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic co_puc_240820,240820,Iva Descontable a Regimen Simplificado (Commun/Proporcional) - Solo Esta la DIAN lo Interpreta Utilizable,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic +co_puc_24082005,24082005,Iva retenido a regimen simplificado,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic co_puc_241205,241205,Vigencia Fiscal Corriente,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic co_puc_245605,245605,a Las Importaciones,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic co_puc_249505,249505,Otros,FALSE,account.data_account_type_current_liabilities,l10n_co_chart_template_generic @@ -107,8 +136,45 @@ co_puc_340515,340515,de Reservas,FALSE,account.data_account_type_equity,l10n_co_ co_puc_340520,340520,de Resultados de Ejercicios Anteriores,FALSE,account.data_account_type_equity,l10n_co_chart_template_generic co_puc_360505,360505,Utilidad Del Ejercicio,FALSE,account.data_account_type_equity,l10n_co_chart_template_generic co_puc_370505,370505,Utilidades Acumuladas,FALSE,account.data_account_type_equity,l10n_co_chart_template_generic -co_puc_415505,415505,Arrendamientos de Bienes Inmuebles,FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413502,413502,Venta de vehículos automotores,FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413504,413504,"Mantenimiento, reparación y lavado de vehículos automotores",FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413506,413506,"Venta de partes, piezas y accesorios de vehículos automotores",FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413508,413508,"Venta de combustibles sólidos, líquidos, gaseosos",FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413510,413510,"Venta de lubricantes, aditivos, llantas y lujos para automotores",FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413512,413512,Venta a cambio de retribución o por contrata,FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413514,413514,"Venta de insumos, materias primas agropecuarias y flores",FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413516,413516,Venta de otros insumos y materias primas no agropecuarias,FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413518,413518,Venta de animales vivos y cueros,FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413520,413520,Venta de productos en almacenes no especializados,FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413522,413522,Venta de productos agropecuarios,FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413524,413524,"Venta de productos textiles, de vestir, de cuero y calzado",FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413526,413526,Venta de papel y cartón,FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413528,413528,"Venta de libros, revistas, elementos de papelería, útiles y textos escolares",FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413530,413530,"Venta de juegos, juguetes y artículos deportivos",FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413532,413532,Venta de instrumentos quirúrgicos y ortopédicos,FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413534,413534,Venta de artículos en relojerías y joyerías,FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413536,413536,Venta de electrodomésticos y muebles,FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413538,413538,"Venta de productos de aseo, farmacéuticos, medicinales, y artículos de tocador",FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413540,413540,"Venta de cubiertos, vajillas, cristalería, porcelanas, cerámicas y otros artículos de uso doméstico",FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413542,413542,"Venta de materiales de construcción, fontanería y calefacción",FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413544,413544,Venta de pinturas y lacas,FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413546,413546,Venta de productos de vidrios y marquetería,FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413548,413548,Venta de herramientas y artículos de ferretría,FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413550,413550,Venta de químicos,FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413552,413552,"Venta de productos intermedios, desperdicios y desechos",FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413554,413554,"Venta de maquinaria, equipo de oficina y programas de computador",FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413556,413556,Venta de artículos en cacharrerías y misceláneas,FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413558,413558,Venta de instrumentos musicales,FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413560,413560,Venta de artículos en casas de empeño y prenderías,FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413562,413562,Venta de equipo fotográfico,FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413564,413564,Venta de equipo óptico y de precisión,FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413566,413566,Venta de empaques,FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413568,413568,Venta de equipo profesional y científico,FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413570,413570,"Venta de loterías, rifas, chance, apuestas y similares",FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413572,413572,Reparación de efectos personales y electrodomésticos,FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic co_puc_413595,413595,Venta de Otros Productos,FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_413595,413595,Venta de otros productos,FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic +co_puc_415505,415505,Arrendamientos de Bienes Inmuebles,FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic co_puc_421005,421005,Intereses,FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic co_puc_421020,421020,Diferencia en Cambio,FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic co_puc_421040,421040,Descuentos Comerciales Condicionados,FALSE,account.data_account_type_revenue,l10n_co_chart_template_generic diff --git a/addons/l10n_co/data/account.tax.template.csv b/addons/l10n_co/data/account.tax.template.csv index de0f14ca931..cf435a1232c 100644 --- a/addons/l10n_co/data/account.tax.template.csv +++ b/addons/l10n_co/data/account.tax.template.csv @@ -1,54 +1,54 @@ -id,amount,account_id:id,refund_account_id:id,name,type_tax_use,amount_type,children_tax_ids:id,chart_template_id:id -l10n_co_tax_0,5.0,co_puc_2408100510,co_puc_2408101010,IVA Compra 5%,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_1,19.0,co_puc_2408100505,co_puc_2408101005,IVA Compra 19%,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_2,16.0,co_puc_2408100515,co_puc_2408101015,IVA Descontable Compra 16% (2016 y Enero 2017),purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_3,0.0,co_puc_236505,co_puc_236505,RteFte Salarios y Pagos Laborales,None,fixed,,l10n_co_chart_template_generic -l10n_co_tax_4,16.0,,,IVA Devoluciones Ventas 16% 2016,sale,percent,,l10n_co_chart_template_generic -l10n_co_tax_5,0.0,,,IVA Compra Importaciones,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_6,0.0,,,IVA Compra Excluido,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_7,0.0,,,IVA Compra Exento,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_8,19.0,co_puc_2408050505,co_puc_2408051005,IVA Ventas 19%,sale,percent,,l10n_co_chart_template_generic -l10n_co_tax_9,5.0,co_puc_2408050510,co_puc_2408051010,IVA Ventas 5%,sale,percent,,l10n_co_chart_template_generic -l10n_co_tax_10,0.0,,,IVA Excento,sale,percent,,l10n_co_chart_template_generic -l10n_co_tax_11,0.0,,,IVA Excluido,sale,percent,,l10n_co_chart_template_generic -l10n_co_tax_12,-2.85,co_puc_236705,co_puc_236705,RteIVA 15% sobre el 19% IVA,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_13,-0.75,co_puc_236705,co_puc_236705,RteIVA 15% sobre el 5% IVA,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_14,0.75,,,RteIVA 15% sobre el 5% IVA Contrapartida,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_15,2.85,,,RteIVA 15% sobre el 19% IVA Contrapartida,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_16,-0.1,,,RteFte Compra Combustibles 0.1%,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_17,-0.5,,,RteFte Compra Cafe 0.5%,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_18,-10.0,,,RteFte Comisiones Persona Natural 10%,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_19,-2.5,,,RteFte Compras Declarantes 2.5%,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_20,-10.0,,,"RteFte Consultorias, Servicios Tecnicos y Asistencia Tecnica Pagos al Exterior 10%",purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_21,-1.0,,,RteFte Adquisicion de Vehiculos 1%,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_22,-1.0,,,RteFte Compras de Bienes Raices 1%,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_23,-4.0,,,RteFte Servicios P Jurídicas y PN Declarantes 4%,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_24,-1.0,,,RteFte Servicio Transporte Nacional Carga 1%,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_25,-6.0,,,RteFte Servicios en General Personas Naturales No Declarantes Renta 6%,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_26,-2.0,,,RteFte Servicio de Vigilancia y Aseo (Sobre AIU) 2%,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_27,-3.5,,,RteFte Honorarios Servicios Licencias Software 3.5%,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_28,-2.0,,,RteFte Contratos de Obra Inmuebles 2%,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_29,-4.0,,,RteFte Arrendamientos Bienes Muebles 4%,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_30,-3.5,,,RteFte Arrendamientos Bienes Inmuebles 3.5%,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_31,-7.0,,,RteFte Rendimientos Financieros Generales 7%,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_32,-10.0,,,RteFte Honorarios Persona Natural 10%,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_33,-3.5,,,RteFte Honorarios Diseno Web y Consultoria Informatica 3.5%,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_34,-2.5,,,RteFte Adquisicion de Bienes Raices Comerciales 2.5%,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_35,-3.5,,,RteFte Compras No Declarantes 3.5%,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_36,-11.0,,,RteFte Comisiones Persona Juridica 11%,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_37,-1.5,,,RteFte Compras Bienes Agricolas 1.5%,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_38,-3.5,,,RteFte Servicio Transporte Terrestre Nacional Pasajeros 3.5%,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_39,-1.0,,,RteFte Servicio Temporales de Empleo (Sobre AIU) 1%,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_40,-11.0,,,RteFte Honorarios Persona Juridica 11%,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_41,-2.0,,,RteFte Servicio Integrales de Salud 2%,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_42,-3.5,,,RteFte Servicio de Hoteles y Restaurantes 3.5%,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_43,0.0,co_puc_236805,co_puc_236805,RteICA,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_44,-0.69,co_puc_236805,co_puc_236805,RteICA 0.69%,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_45,-1.104,co_puc_236805,co_puc_236805,RteICA 1.104%,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_46,-0.414,co_puc_236805,co_puc_236805,RteICA 0.414%,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_47,-1.38,co_puc_236805,co_puc_236805,RteICA 1.38%,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_48,-0.966,co_puc_236805,co_puc_236805,RteICA 0.966%,purchase,percent,,l10n_co_chart_template_generic -l10n_co_tax_49,16.0,,,IVA Compra 16% RC,purchase,group,"l10n_co_tax_1,l10n_co_tax_12",l10n_co_chart_template_generic -l10n_co_tax_50,16.0,,,IVA Compra 16% RS,purchase,group,"l10n_co_tax_12,l10n_co_tax_15",l10n_co_chart_template_generic -l10n_co_tax_51,5.0,,,IVA Compra 5% RS,purchase,group,"l10n_co_tax_13,l10n_co_tax_14",l10n_co_chart_template_generic -l10n_co_tax_52,5.0,,,IVA Compra 5% RC,purchase,group,"l10n_co_tax_0,l10n_co_tax_13",l10n_co_chart_template_generic +id,sequence,amount,account_id:id,refund_account_id:id,name,type_tax_use,amount_type,children_tax_ids:id,chart_template_id:id +l10n_co_tax_0,1,5.0,co_puc_2408100510,co_puc_2408101010,IVA Compra 5%,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_1,0,19.0,co_puc_2408100505,co_puc_2408101005,IVA Compra 19%,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_2,1,16.0,co_puc_2408100515,co_puc_2408101015,IVA Descontable Compra 16% (2016 y Enero 2017),purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_3,1,0.0,co_puc_236505,co_puc_236505,RteFte Salarios y Pagos Laborales,None,fixed,,l10n_co_chart_template_generic +l10n_co_tax_4,1,16.0,,,IVA Devoluciones Ventas 16% 2016,sale,percent,,l10n_co_chart_template_generic +l10n_co_tax_5,1,0.0,,,IVA Compra Importaciones,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_6,1,0.0,,,IVA Compra Excluido,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_7,1,0.0,,,IVA Compra Exento,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_8,0,19.0,co_puc_2408050505,co_puc_2408051005,IVA Ventas 19%,sale,percent,,l10n_co_chart_template_generic +l10n_co_tax_9,1,5.0,co_puc_2408050510,co_puc_2408051010,IVA Ventas 5%,sale,percent,,l10n_co_chart_template_generic +l10n_co_tax_10,1,0.0,,,IVA Excento,sale,percent,,l10n_co_chart_template_generic +l10n_co_tax_11,1,0.0,,,IVA Excluido,sale,percent,,l10n_co_chart_template_generic +l10n_co_tax_12,1,-2.85,co_puc_236705,co_puc_236705,RteIVA 15% sobre el 19% IVA,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_13,1,-0.75,co_puc_236705,co_puc_236705,RteIVA 15% sobre el 5% IVA,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_14,1,0.75,co_puc_24082005,co_puc_24082005,RteIVA 15% sobre el 5% IVA Contrapartida,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_15,1,2.85,co_puc_24082005,co_puc_24082005,RteIVA 15% sobre el 19% IVA Contrapartida,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_16,1,-0.1,co_puc_23654025,co_puc_23654025,RteFte Compra Combustibles 0.1%,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_17,1,-0.5,co_puc_23654020,co_puc_23654020,RteFte Compra Cafe 0.5%,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_18,1,-10.0,co_puc_23652005,co_puc_23652005,RteFte Comisiones Persona Natural 10%,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_19,1,-2.5,co_puc_23654005,co_puc_23654005,RteFte Compras Declarantes 2.5%,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_20,1,-10.0,co_puc_23655005,co_puc_23655005,"RteFte Consultorias, Servicios Tecnicos y Asistencia Tecnica Pagos al Exterior 10%",purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_21,1,-1.0,co_puc_23654030,co_puc_23654030,RteFte Adquisicion de Vehiculos 1%,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_22,1,-1.0,co_puc_23654040,co_puc_23654040,RteFte Compras de Bienes Raices 1%,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_23,1,-4.0,co_puc_23652505,co_puc_23652505,RteFte Servicios P Jurídicas y PN Declarantes 4%,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_24,1,-1.0,co_puc_23652515,co_puc_23652515,RteFte Servicio Transporte Nacional Carga 1%,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_25,1,-6.0,co_puc_23652510,co_puc_23652510,RteFte Servicios en General Personas Naturales No Declarantes Renta 6%,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_26,1,-2.0,co_puc_23652535,co_puc_23652535,RteFte Servicio de Vigilancia y Aseo (Sobre AIU) 2%,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_27,1,-3.5,co_puc_23651515,co_puc_23651515,RteFte Honorarios Servicios Licencias Software 3.5%,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_28,1,-2.0,co_puc_23652550,co_puc_23652550,RteFte Contratos de Obra Inmuebles 2%,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_29,1,-4.0,co_puc_23653005,co_puc_23653005,RteFte Arrendamientos Bienes Muebles 4%,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_30,1,-3.5,co_puc_23653010,co_puc_23653010,RteFte Arrendamientos Bienes Inmuebles 3.5%,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_31,1,-7.0,co_puc_23653510,co_puc_23653510,RteFte Rendimientos Financieros Generales 7%,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_32,1,-10.0,co_puc_23651505,co_puc_23651505,RteFte Honorarios Persona Natural 10%,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_33,1,-3.5,co_puc_23651520,co_puc_23651520,RteFte Honorarios Diseno Web y Consultoria Informatica 3.5%,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_34,1,-2.5,co_puc_23654035,co_puc_23654035,RteFte Adquisicion de Bienes Raices Comerciales 2.5%,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_35,1,-3.5,co_puc_23654010,co_puc_23654010,RteFte Compras No Declarantes 3.5%,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_36,1,-11.0,co_puc_23652010,co_puc_23652010,RteFte Comisiones Persona Juridica 11%,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_37,1,-1.5,co_puc_23654015,co_puc_23654015,RteFte Compras Bienes Agricolas 1.5%,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_38,1,-3.5,co_puc_23652520,co_puc_23652520,RteFte Servicio Transporte Terrestre Nacional Pasajeros 3.5%,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_39,1,-1.0,co_puc_23652530,co_puc_23652530,RteFte Servicio Temporales de Empleo (Sobre AIU) 1%,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_40,1,-11.0,co_puc_23651510,co_puc_23651510,RteFte Honorarios Persona Juridica 11%,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_41,1,-2.0,co_puc_23652540,co_puc_23652540,RteFte Servicio Integrales de Salud 2%,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_42,1,-3.5,co_puc_23652545,co_puc_23652545,RteFte Servicio de Hoteles y Restaurantes 3.5%,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_43,1,0.0,co_puc_236805,co_puc_236805,RteICA,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_44,1,-0.69,co_puc_236805,co_puc_236805,RteICA 0.69%,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_45,1,-1.104,co_puc_236805,co_puc_236805,RteICA 1.104%,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_46,1,-0.414,co_puc_236805,co_puc_236805,RteICA 0.414%,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_47,1,-1.38,co_puc_236805,co_puc_236805,RteICA 1.38%,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_48,1,-0.966,co_puc_236805,co_puc_236805,RteICA 0.966%,purchase,percent,,l10n_co_chart_template_generic +l10n_co_tax_49,1,19.0,,,IVA Compra 19% RC,purchase,group,"l10n_co_tax_1,l10n_co_tax_12",l10n_co_chart_template_generic +l10n_co_tax_50,1,19.0,,,IVA Compra 19% RS,purchase,group,"l10n_co_tax_12,l10n_co_tax_15",l10n_co_chart_template_generic +l10n_co_tax_51,1,5.0,,,IVA Compra 5% RS,purchase,group,"l10n_co_tax_13,l10n_co_tax_14",l10n_co_chart_template_generic +l10n_co_tax_52,1,5.0,,,IVA Compra 5% RC,purchase,group,"l10n_co_tax_0,l10n_co_tax_13",l10n_co_chart_template_generic diff --git a/addons/l10n_co/models/res_partner.py b/addons/l10n_co/models/res_partner.py index ab7ff0c3c24..b2a23a08f9d 100644 --- a/addons/l10n_co/models/res_partner.py +++ b/addons/l10n_co/models/res_partner.py @@ -12,7 +12,7 @@ class ResPartner(models.Model): ('foreign_id_card', 'Cedula de Extranjeria'), ('external_id', 'ID del Exterior')], string='Document Type', help='Indicates to what document the information in here belongs to.') - l10n_co_verification_code = fields.Char(compute='_compute_verification_code', string='VC', + l10n_co_verification_code = fields.Char(compute='_compute_verification_code', string='VC', # todo remove this field in master help='Redundancy check to verify the vat number has been typed in correctly.') @api.depends('vat') @@ -40,3 +40,16 @@ class ResPartner(models.Model): partner.l10n_co_verification_code = 11 - number except ValueError: partner.l10n_co_verification_code = False + + @api.constrains('vat', 'commercial_partner_country_id', 'l10n_co_document_type') + def check_vat(self): + # check_vat is implemented by base_vat which this localization + # doesn't directly depend on. It is however automatically + # installed for Colombia. + if self.sudo().env.ref('base.module_base_vat').state == 'installed': + # don't check Colombian partners unless they have RUT (= Colombian VAT) set as document type + self = self.filtered(lambda partner: partner.country_id != self.env.ref('base.co') or\ + partner.l10n_co_document_type == 'rut') + return super(ResPartner, self).check_vat() + else: + return True diff --git a/addons/l10n_co/views/res_partner.xml b/addons/l10n_co/views/res_partner.xml index 9912521fcca..5c55043fb44 100644 --- a/addons/l10n_co/views/res_partner.xml +++ b/addons/l10n_co/views/res_partner.xml @@ -9,7 +9,7 @@ - + diff --git a/addons/mail/models/mail_message.py b/addons/mail/models/mail_message.py index 9fa6701be16..45d07d5b97c 100644 --- a/addons/mail/models/mail_message.py +++ b/addons/mail/models/mail_message.py @@ -757,9 +757,10 @@ class Message(models.Model): 'datas_fname': name, 'res_model': 'mail.message', }) + attachment.generate_access_token() values['attachment_ids'].append((4, attachment.id)) - data_to_url[key] = '/web/image/%s' % attachment.id - return '%s%s alt="%s"' % (data_to_url[key], match.group(3), name) + data_to_url[key] = ['/web/image/%s?access_token=%s' % (attachment.id, attachment.access_token), name] + return '%s%s alt="%s"' % (data_to_url[key][0], match.group(3), data_to_url[key][1]) values['body'] = _image_dataurl.sub(base64_to_boundary, tools.ustr(values['body'])) # delegate creation of tracking after the create as sudo to avoid access rights issues diff --git a/addons/mail/static/src/js/systray.js b/addons/mail/static/src/js/systray.js index 2006ae297ef..edd9cd3f56c 100644 --- a/addons/mail/static/src/js/systray.js +++ b/addons/mail/static/src/js/systray.js @@ -126,7 +126,7 @@ var MessagingMenu = Widget.extend({ this.do_action({ type: 'ir.actions.act_window', res_model: resModel, - views: [[false, 'form'], [false, 'kanban']], + views: [[false, 'form']], res_id: resID }); } else { diff --git a/addons/payment_stripe/static/src/js/stripe.js b/addons/payment_stripe/static/src/js/stripe.js index 2c22dcfa0f4..a9395ea7bd6 100644 --- a/addons/payment_stripe/static/src/js/stripe.js +++ b/addons/payment_stripe/static/src/js/stripe.js @@ -148,15 +148,12 @@ odoo.define('payment_stripe.stripe', function(require) { }); } create_tx.done(function () { - if (!_.contains(int_currencies, currency)) { - amount = amount*100; - } getStripeHandler().open({ name: $("input[name='merchant']").val(), description: $("input[name='invoice_num']").val(), email: $("input[name='email']").val(), currency: currency, - amount: amount, + amount: _.contains(int_currencies, currency) ? amount : amount * 100, }); }); } diff --git a/addons/phone_validation/models/phone_validation_mixin.py b/addons/phone_validation/models/phone_validation_mixin.py index 1003ab929f2..4cd9d8eb2bb 100644 --- a/addons/phone_validation/models/phone_validation_mixin.py +++ b/addons/phone_validation/models/phone_validation_mixin.py @@ -11,20 +11,21 @@ class PhoneValidationMixin(models.AbstractModel): def _phone_get_country(self): if 'country_id' in self: return self.country_id - return self.env.user.company_id.country_id def _phone_get_always_international(self): - if 'company_id' in self: + if 'company_id' in self and self.country_id: return self.company_id.phone_international_format == 'prefix' return self.env.user.company_id.phone_international_format == 'prefix' def phone_format(self, number, country=None, company=None): country = country or self._phone_get_country() + if not country: + return number always_international = company.phone_international_format == 'prefix' if company else self._phone_get_always_international() return phone_validation.phone_format( number, country.code if country else None, country.phone_code if country else None, always_international=always_international, - raise_exception=True + raise_exception=False ) diff --git a/addons/phone_validation/tools/phone_validation.py b/addons/phone_validation/tools/phone_validation.py index 940c4300f26..7ca7bed6ea8 100644 --- a/addons/phone_validation/tools/phone_validation.py +++ b/addons/phone_validation/tools/phone_validation.py @@ -41,7 +41,7 @@ try: if raise_exception: raise else: - _logger.warning(_('Unable to format %s:\n%s') % number, e) + _logger.warning(_('Unable to format %s:\n%s'), number, e) return number if always_international or phone_nbr.country_code != country_phone_code: phone_fmt = phonenumbers.PhoneNumberFormat.INTERNATIONAL diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index 61e72258997..4e53d259248 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -2038,6 +2038,7 @@ var PaymentScreenWidget = ScreenWidget.extend({ invoiced.fail(function(error){ self.invoicing = false; + order.finalized = false; if (error.message === 'Missing Customer') { self.gui.show_popup('confirm',{ 'title': _t('Please select the Customer'), diff --git a/addons/purchase/models/purchase.py b/addons/purchase/models/purchase.py index 1a1e65d9611..1aee90fc83c 100644 --- a/addons/purchase/models/purchase.py +++ b/addons/purchase/models/purchase.py @@ -909,22 +909,8 @@ class ProcurementRule(models.Model): for line in po.order_line: if line.product_id == product_id and line.product_uom == product_id.uom_po_id: if line._merge_in_existing_line(product_id, product_qty, product_uom, location_id, name, origin, values): - procurement_uom_po_qty = product_uom._compute_quantity(product_qty, product_id.uom_po_id) - seller = product_id._select_seller( - partner_id=partner, - quantity=line.product_qty + procurement_uom_po_qty, - date=po.date_order and po.date_order[:10], - uom_id=product_id.uom_po_id) - - price_unit = self.env['account.tax']._fix_tax_included_price_company(seller.price, line.product_id.supplier_taxes_id, line.taxes_id, values['company_id']) if seller else 0.0 - if price_unit and seller and po.currency_id and seller.currency_id != po.currency_id: - price_unit = seller.currency_id.compute(price_unit, po.currency_id) - - po_line = line.write({ - 'product_qty': line.product_qty + procurement_uom_po_qty, - 'price_unit': price_unit, - 'move_dest_ids': [(4, x.id) for x in values.get('move_dest_ids', [])] - }) + vals = self._update_purchase_order_line(product_id, product_qty, product_uom, values, line, partner) + po_line = line.write(vals) break if not po_line: vals = self._prepare_purchase_order_line(product_id, product_qty, product_uom, values, po, supplier) @@ -948,6 +934,24 @@ class ProcurementRule(models.Model): return schedule_date - relativedelta(days=int(seller.delay)) + def _update_purchase_order_line(self, product_id, product_qty, product_uom, values, line, partner): + procurement_uom_po_qty = product_uom._compute_quantity(product_qty, product_id.uom_po_id) + seller = product_id._select_seller( + partner_id=partner, + quantity=line.product_qty + procurement_uom_po_qty, + date=line.order_id.date_order and line.order_id.date_order[:10], + uom_id=product_id.uom_po_id) + + price_unit = self.env['account.tax']._fix_tax_included_price_company(seller.price, line.product_id.supplier_taxes_id, line.taxes_id, values['company_id']) if seller else 0.0 + if price_unit and seller and line.order_id.currency_id and seller.currency_id != line.order_id.currency_id: + price_unit = seller.currency_id.compute(price_unit, line.order_id.currency_id) + + return { + 'product_qty': line.product_qty + procurement_uom_po_qty, + 'price_unit': price_unit, + 'move_dest_ids': [(4, x.id) for x in values.get('move_dest_ids', [])] + } + @api.multi def _prepare_purchase_order_line(self, product_id, product_qty, product_uom, values, po, supplier): procurement_uom_po_qty = product_uom._compute_quantity(product_qty, product_id.uom_po_id) diff --git a/addons/sale/controllers/portal.py b/addons/sale/controllers/portal.py index 4ea97383cc9..c33e7b79860 100644 --- a/addons/sale/controllers/portal.py +++ b/addons/sale/controllers/portal.py @@ -57,7 +57,7 @@ class CustomerPortal(CustomerPortal): if access_token: values['no_breadcrumbs'] = True values['access_token'] = access_token - values['portal_confirmation'] = request.env['ir.config_parameter'].sudo().get_param('sale.sale_portal_confirmation_options', default='none') + values['portal_confirmation'] = order.get_portal_confirmation_action() if kwargs.get('error'): values['error'] = kwargs['error'] diff --git a/addons/sale_payment/views/sale_portal_templates.xml b/addons/sale_payment/views/sale_portal_templates.xml index e8c5afab5db..06b3f402351 100644 --- a/addons/sale_payment/views/sale_portal_templates.xml +++ b/addons/sale_payment/views/sale_portal_templates.xml @@ -31,7 +31,7 @@