Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

odoo 9 sale analysis adding new measures.

Odoberať

Get notified when there's activity on this post

This question has been flagged
salereporting
2 Replies
5852 Zobrazenia
Avatar
Jiashun Chen

Dear,

I tried to do sale report as nice format  for printing like this 

Just want 3 cols to sumup saled products  qtys with UoM. I know there is a way to show UoM in odoo. But It is kind of messy if there are many Uom. like this 


So I tried to add UoM In measures like this.

But the result doesn't show up as i expected. see this.


Can Someone helps. Thanks a million.

0
Avatar
Zrušiť
Avatar
mario@rehilete.com.mx
Best Answer

Hi, i'm testing and i write this code:

Function read_group is the key!

# -*- coding: utf-8 -*-
import logging, re

from odoo import api, fields, models
from odoo.exceptions import UserError
from odoo.osv.expression import expression
from pprint import pformat

_logger = logging.getLogger(__name__)


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

# @api.depends('partner_id')
def _compute_objetivo_zona(self):
for rec in self:
_logger.warning("sadjhasjkdasjdkjjjkjhkjhk")
_logger.warning(rec.partner_id.x_zonas.x_studio_objetivos)

objetivo_zona = 0.0
partner = rec.partner_id
zone_id = partner.x_zonas

if zone_id:
objetivo_zona = zone_id.x_studio_objetivos

_logger.warning(objetivo_zona)
_logger.warning("sadjhasjkdasjdkjjjkjhkjhk")

rec.update({
'objetivo_zona': 5.0
})

zone_id = fields.Many2one('x_zonas', 'Zonas', readonly=True)
objetivo_zona = fields.Float('Objetivo', default=0.0, readonly=True)

def _select(self):
return super(SaleReport, self)._select() + ", zone.x_studio_objetivos as objetivo_zona"

@api.model
def read_group(self, domain, fields, groupby, offset=0, limit=None, orderby=False, lazy=True):
_logger.warning("HACK ESCONDER CAMPO")
_logger.warning(pformat(fields))
has_field_objetivo = False
newfields = []

# Buscar campos objetivos para no molestar en suma
for field in fields:
if field != 'objetivo_zona:sum':
newfields.append(field)
else:
has_field_objetivo = True

res = super(SaleReport, self).read_group(domain, newfields, groupby, offset=offset, limit=limit,
orderby=orderby,
lazy=lazy)

_logger.warning("RES ANTES")
_logger.warning(res)

if has_field_objetivo:
zones = {}
zone_total = 0

# Procesar Campos
for dato in res:
_logger.warning("DATO INDIVIDUAL")
_logger.warning(pformat(dato))

if 'zone_id' in dato:
if dato['zone_id']:
zone_id = dato['zone_id'][0]

if zone_id in zones:
zone = zones[zone_id]
dato['objetivo_zona'] = 0
else:
zone = self.env['x_zonas'].search([('id', '=', dato['zone_id'][0])])
zones[zone_id] = zone
if zone:
dato['objetivo_zona'] = zone.x_studio_objetivos

if zone:
zone_total += zone.x_studio_objetivos

_logger.warning(zone_total)

_logger.warning("RES FINAL")
_logger.warning(res)

return res

def _query(self, with_clause='', fields={}, groupby='', from_clause=''):
fields['zone_id'] = ", partner.x_studio_zona as zone_id"
fields['objetivo_zona'] = ", zone.x_studio_objetivos as objetivo_zona"
#
from_clause = 'left join x_zonas zone on (partner.x_studio_zona = x_zonas.id)'

groupby += ', partner.x_studio_zona'
return super(SaleReport, self)._query(with_clause, fields, groupby, from_clause)

0
Avatar
Zrušiť
Avatar
Jiashun Chen
Autor Best Answer

Anyone suggest an odoo addon that report sale summary. for example, there are dozens sale orders, I want to get the summary list of sale products among these orders, then I can get the total qty of each product.

0
Avatar
Zrušiť
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrácia
Related Posts Replies Zobrazenia Aktivita
Bug trying to remove a table cell using removeParentNode
sale reporting v6
Avatar
0
mar 15
8003
Product label with QR code
reporting
Avatar
Avatar
1
nov 25
97
Issue After Migration: Unable to Save Sales Order in v18 Solved
sale
Avatar
Avatar
1
máj 25
1906
How to set serial numbers for the sale order line
sale
Avatar
Avatar
Avatar
2
feb 25
10843
Canned reports in Odoo 17 for all the modules
reporting
Avatar
Avatar
1
nov 24
2495
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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