Ir al contenido
Odoo Menú
  • Identificarse
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • TPV para tiendas
    • TPV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en directo
    • e-learning
    Cadena de suministro
    • Inventario
    • Fabricación
    • PLM
    • Compra
    • Mantenimiento
    • Calidad
    Recursos Humanos
    • Empleados
    • Reclutamiento
    • Ausencias
    • Evaluación
    • Referencias
    • Flota
    Marketing
    • Marketing social
    • Marketing por correo electrónico
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyecto
    • Partes de horas
    • Servicio de campo
    • Servicio de asistencia
    • Planificación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Conocimientos
    • WhatsApp
    Aplicaciones de terceros Studio de Odoo Plataforma de Odoo Cloud
  • Industrias
    Comercio al por menor
    • Librería
    • Tienda de ropa
    • Tienda de muebles
    • Tienda de ultramarinos
    • Ferretería
    • Juguetería
    Alimentación y hostelería
    • Bar y taberna
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidor de bebidas
    • Hotel
    Inmueble
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión inmobiliaria
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Empresa contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Fabricación
    • Textil
    • Metal
    • Muebles
    • Alimentos
    • Brewery
    • Regalos de empresas
    Salud y bienestar
    • Club deportivo
    • Óptica
    • Gimnasio
    • Terapeutas
    • Farmacia
    • Peluquería
    Oficios
    • Handyman
    • Hardware y asistencia informática
    • Sistemas de energía solar
    • Zapatero
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin ánimo de lucro
    • Agencia de protección del medio ambiente
    • Alquiler de paneles publicitarios
    • Estudio fotográfico
    • Alquiler de bicicletas
    • Distribuidor de software
    Explorar todos los sectores
  • Comunidad
    Aprender
    • Tutoriales
    • Documentación
    • Certificaciones
    • Formación
    • Blog
    • Podcast
    Potenciar la educación
    • Programa de formación
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtener el software
    • Descargar
    • Comparar ediciones
    • Versiones
    Colaborar
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Convertirse en partner
    • Servicios para partners
    • Registrar tu empresa contable
    Obtener servicios
    • Encontrar un partner
    • Encontrar un asesor fiscal
    • Contacta con un experto
    • Servicios de implementación
    • Referencias de clientes
    • Ayuda
    • Actualizaciones
    GitHub YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicitar una demostración
  • Precios
  • Ayuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyecto
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

Inheriting SalesAnalysis search view

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
inheritancesale.ordersearchviewodooV13v14
3 Respuestas
3097 Vistas
Avatar
Bernardo
I've inherited the `view_order_product_search` view with: 

<?xml version="1.0" encoding="utf-8"?> <odoo> <record id="view_order_product_search_inherit" model="ir.ui.view"> <field name="name">sale.report.search.extend</field> <field name="model">sale.report</field> <field name="inherit_id" ref="sale.view_order_product_search"/> <field name="arch" type="xml"> <field name="date" position="after"> <field name="is_paid" /> <filter name="Pagado" string="Pagado" domain="[('is_paid', '=', True)]"/> </field> </field> </record> </odoo>
_____________________________________________________
And the inherited model like (UPDATED):

```
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.

from odoo import tools
from odoo import fields, models

import logging
_logger = logging.getLogger(__name__)

class SaleReport(models.Model):
_inherit = ['sale.report']
is_paid = fields.Boolean(string='Payment Received?', readonly=True)

def _query(self, with_clause='', fields={}, groupby='', from_clause=''):
fields['is_paid'] = ", s.is_paid as is_paid"
return super(SaleReport, self)._query(with_clause, fields, groupby=', s.is_paid')
```
_________________________________
and i'm able to install my moudule an Odoo 14 I have on my local raspberry, but when i try to install the module on a remote Odoo 13 I get:
El campo `is_paid` no existe
Contexto del error:
Vista `sale.report.search.extend`
[view_id: 1852, xml_id: n/a, model: sale.report, parent_id: 736]
None" while parsing /opt/bitnami/apps/odoo/data/addons/13.0/pagado/report/sale_report_extended_views.xml...


I've checked and the `is_paid` column has been added to the `sale_order` table (cause i also added the field there) but I cannot see a `sales_report` table...

Also reading other posts I see it may be a deps problem, and I'm not sure which deps should I add besides: `'depends': ['base', 'sale'],`

Can i get some help here? I've been looking for days...

0
Avatar
Descartar
Avatar
Sunny Sheth
Mejor respuesta

Hi,

Can you try with this?

def _query(self, with_clause='', fields={}, groupby='', from_clause=''):
    fields['invoice_status'] = ', s.invoice_status as invoice_status'
    groupby += ', s.invoice_status'
    return super(SaleReport, self)._query(with_clause, fields, groupby, from_clause)
 

you need to remove groupby=', s.is_paid' while returning the call.

and ADD Dependency ---> sale_management
0
Avatar
Descartar
Avatar
Bernardo
Autor Mejor respuesta

thanks for your help Niyas. I've updated my code as you suggested (you can see the update on my initial post), but the problem still persists, I think its a problem with the view, cause I manage to install the module without all the `report/` code and if I go to edit the view directly on the Odoo's frontend I get the exact same error...

0
Avatar
Descartar
Bernardo
Autor

also if in developer mode I go to the 'View fields' of the sale.order model I see the field listed there...

Avatar
Niyas Raphy (Walnut Software Solutions)
Mejor respuesta

Hi,

You have to inherit the  query of the sale.report model that creates this view and add the field into it. See an example of adding  margin field to the same model after inheriting.

class SaleReport(models.Model):
_inherit = 'sale.report'

margin = fields.Float('Margin')

def _query(self, with_clause='', fields={}, groupby='', from_clause=''):
fields['margin'] = ", SUM(l.margin / CASE COALESCE(s.currency_rate, 0) WHEN 0 THEN 1.0 ELSE s.currency_rate END) AS margin"
return super(SaleReport, self)._query(with_clause, fields, groupby, from_clause)


Thanks

0
Avatar
Descartar
¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Inscribirse
Publicaciones relacionadas Respuestas Vistas Actividad
How add filed with one model to other model.
inheritance sale.order crm.lead v14
Avatar
0
jun 22
2712
PROBLEM WITH INHERITANCE AND SALE MODEL
inheritance sale.order
Avatar
Avatar
Avatar
2
may 23
3014
Issue with amount_untaxed field value getting overwritten after saving in sale order module in Odoo14
sale.order compute v14
Avatar
0
ene 24
169
add field inside inherited notebook odoo14
inheritance notebook v14
Avatar
Avatar
1
abr 23
2690
One2many relationship in _inherit mode
inheritance one2many v14
Avatar
0
abr 22
3392
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento Odoo.sh
  • Ayuda
  • Actualizar
  • Desarrollos personalizados
  • Educación
  • Encontrar un asesor fiscal
  • Encontrar un partner
  • Convertirse en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contacta con nosotros
  • Puestos de trabajo
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Información legal • Privacidad
  • Seguridad
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y totalmente integrado.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now