This commit fixes lots of usability problems in the reporting views.
eg: missing fields in the reports, labelling inconsistencies, broken/outdated/unused filters and group bys...
Detailed changelist
-------------------
account/Invoice Analysis:
- "Product Category" vs "Category of Product": labelling consistency
- group by Analytic Account
account_voucher/Sales Receipt Analysis:
- remove filter on Pro-forma
crm/Lead & Opportunities Analysis:
- "Exp." vs "Expected": labelluing consistency
crm/Phone Calls Analysis:
- remove Todo and My Phone Call filters
- fix My Sales Team(s) filter
crm_claim/Claims Analysis
- remove My Case(s) filter
- fix My Company(s) filter
- remove group by Sales Team
- fix label Creation Month
crm_helpdesk/Helpdesk Analysis
- remove My Case(s) filter
event/Events Analysis
- remove My Events & Show Confirmed Registrations filters
- fix labelling of Attendee / Contact group by
hr_holidays/Leaves Analysis
- remove My Requests filter
hr_recruitment/Recruitment Analysis
- remove My filter
marketing_campaign/Campaign Analysis
- fix labelling
mrp_operations/Work Order Analysis
- add fields Product Template, Product Category, Responsible, Routing
and BoM
- fix labelling group by Planned Month
point_of_sale/Orders Analysis
- add fields Product Template, Invoiced, Point of Sale, Public Category,
Warehouse and Pricelist
- fix Year filter
project/Tasks Analysis:
- remove My Task filter
project/Issues Analysis:
- remove My Issues filter
- remove Task group by
purchase/Purchase Analysis:
- fix quantity field into float
- add fields Product Template, Product Category, Partner Country, Fiscal
Position, Analytic Account and Commercial Entity
- add group by Partner Country and Fiscal Position
- fix labelling "Product Category" vs "Category of product"
sale/Sales Analysis
- fix labelling "Product Category" vs "Category of product"
- add fields Product Template, Paid, # of Paid Lines, Partner Countru
and Commercial Entity
- remove filter My Sales
- add group by Partner Country
sale_stock/Sales Analysis
- fix label name of shipped_qty_1
Credits
-------
Analysis and code courtesy of Sébastien Versailles, Quentin De Coninck,
Yannick Tivisse and Richard Mathot {sve,qdc,yti,rim}@odoo.com
(congratulations if you've read this boring commit message)
'period_id': fields.many2one('account.period', 'Force Period', domain=[('state','<>','done')], readonly=True),
'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position', readonly=True),
'currency_id': fields.many2one('res.currency', 'Currency', readonly=True),
- 'categ_id': fields.many2one('product.category','Category of Product', readonly=True),
+ 'categ_id': fields.many2one('product.category','Product Category', readonly=True),
'journal_id': fields.many2one('account.journal', 'Journal', readonly=True),
'partner_id': fields.many2one('res.partner', 'Partner', readonly=True),
'commercial_partner_id': fields.many2one('res.partner', 'Partner Company', help="Commercial Entity"),
'residual': fields.float('Total Residual', readonly=True),
'user_currency_residual': fields.function(_compute_amounts_in_user_currency, string="Total Residual", type='float', digits_compute=dp.get_precision('Account'), multi="_compute_amounts"),
'country_id': fields.many2one('res.country', 'Country of the Partner Company'),
+ 'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic Account', readonly=True),
}
_order = 'date desc'
],
'account.invoice.line': [
'account_id', 'invoice_id', 'price_subtotal', 'product_id',
- 'quantity', 'uos_id',
+ 'quantity', 'uos_id', 'account_analytic_id',
],
'product.product': ['product_tmpl_id'],
'product.template': ['categ_id'],
def _select(self):
select_str = """
- SELECT sub.id, sub.date, sub.product_id, sub.partner_id, sub.country_id,
+ SELECT sub.id, sub.date, sub.product_id, sub.partner_id, sub.country_id, sub.account_analytic_id,
sub.payment_term, sub.period_id, sub.uom_name, sub.currency_id, sub.journal_id,
sub.fiscal_position, sub.user_id, sub.company_id, sub.nbr, sub.type, sub.state,
sub.categ_id, sub.date_due, sub.account_id, sub.account_line_id, sub.partner_bank_id,
select_str = """
SELECT min(ail.id) AS id,
ai.date_invoice AS date,
- ail.product_id, ai.partner_id, ai.payment_term, ai.period_id,
+ ail.product_id, ai.partner_id, ai.payment_term, ai.period_id, ail.account_analytic_id,
CASE
WHEN u.uom_type::text <> 'reference'::text
THEN ( SELECT product_uom.name
def _group_by(self):
group_by_str = """
- GROUP BY ail.product_id, ai.date_invoice, ai.id,
+ GROUP BY ail.product_id, ail.account_analytic_id, ai.date_invoice, ai.id,
ai.partner_id, ai.payment_term, ai.period_id, u.name, ai.currency_id, ai.journal_id,
ai.fiscal_position, ai.user_id, ai.company_id, ai.type, ai.state, pt.categ_id,
ai.date_due, ai.account_id, ail.account_id, ai.partner_bank_id, ai.residual,
<filter string="Partner" name="partner_id" context="{'group_by':'partner_id','residual_visible':True}"/>
<filter string="Salesperson" name='user' context="{'group_by':'user_id'}"/>
<filter string="Sales Team" domain="[]" context="{'group_by':'team_id'}" groups="base.group_multi_salesteams"/>
- <filter string="Category of Product" name="category_product" context="{'group_by':'categ_id','residual_invisible':True}"/>
+ <filter string="Product Category" name="category_product" context="{'group_by':'categ_id','residual_invisible':True}"/>
<filter string="Status" context="{'group_by':'state'}"/>
<filter string="Company" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<separator orientation="vertical" />
<field name="date"/>
<field name="date_due"/>
<filter string="Draft" domain="[('state','=','draft')]" help = "Draft Vouchers"/>
- <filter string="Pro-forma" domain="[('state','=','proforma')]" help = "Pro-forma Vouchers"/>
<filter string="Posted" name="current" domain="[('state','not in', ('draft','cancel'))]" help = "Validated Vouchers"/>
<field name="partner_id"/>
<group expand="0" string="Extended Filters...">
_inherit = ["crm.tracking.mixin"]
_columns = {
- 'date_deadline': fields.date('Exp. Closing', readonly=True, help="Expected Closing"),
+ 'date_deadline': fields.date('Expected Closing', readonly=True),
'create_date': fields.datetime('Creation Date', readonly=True),
'opening_date': fields.datetime('Assignation Date', readonly=True),
'date_closed': fields.datetime('Close Date', readonly=True),
_inherit = ["crm.tracking.mixin"]
_columns = {
- 'date_deadline': fields.date('Exp. Closing', readonly=True, help="Expected Closing"),
+ 'date_deadline': fields.date('Expected Closing', readonly=True),
'create_date': fields.datetime('Creation Date', readonly=True),
'opening_date': fields.datetime('Assignation Date', readonly=True),
'date_closed': fields.datetime('Close Date', readonly=True),
<filter string="Stage" context="{'group_by':'stage_id'}"/>
<separator orientation="vertical" />
<filter string="Creation Month" context="{'group_by':'create_date:month'}" name="month"/>
- <filter string="Expiration Closing" context="{'group_by':'date_deadline:month'}" name="month" help="Expiration Closing Month"/>
+ <filter string="Expected Closing" context="{'group_by':'date_deadline:month'}" name="month" help="Expiration Closing Month"/>
<filter string="Lost Reason" context="{'group_by':'lost_reason'}"/>
</group>
</search>
_columns = {
'user_id':fields.many2one('res.users', 'User', readonly=True),
- 'team_id':fields.many2one('crm.team', 'team', oldname='section_id', readonly=True),
+ 'team_id':fields.many2one('crm.team', 'Sales Team', oldname='section_id', readonly=True),
'priority': fields.selection([('0','Low'), ('1','Normal'), ('2','High')], 'Priority'),
'nbr': fields.integer('# of Cases', readonly=True), # TDE FIXME master: rename into nbr_cases
'state': fields.selection(AVAILABLE_STATES, 'Status', readonly=True),
<field name="model">crm.phonecall.report</field>
<field name="arch" type="xml">
<search string="Search">
- <filter string="Todo" name="todo" domain="[('state','in',('draft','open'))]"
- help="Phone calls which are in draft and open state"/>
<filter string="Held" name="held" domain="[('state','=','done')]"
help="Phone calls which are in closed state"/>
<filter string="Not Held" domain="[('state','=','pending')]"
help="Phone calls which are in pending state"/>
<separator/>
- <filter string="My Sales Team(s)" context="{'invisibteamion': False}" domain="[('team_id.user_id','=',uid)]"
+ <filter string="My Sales Team(s)" context="{'invisible_team': False}" domain="[('team_id.user_id','=',uid)]"
help="Phone calls that are assigned to one of the sale teams I manage" groups="base.group_multi_salesteams"/>
<separator/>
- <filter string="My Phone Calls" help="Phone Calls that are assigned to me" domain="[('user_id','=',uid)]" />
<field name="team_id" string="Sales Team" context="{'invisible_team': False}"
groups="base.group_multi_salesteams"/>
<field name="user_id" string="Salesperson"/>
<field name="model">crm.claim.report</field>
<field name="arch" type="xml">
<search string="Search">
- <filter string="My Case(s)" help="My Case(s)" domain="[('user_id','=',uid)]" />
<filter string="My Sales Team(s)" context="{'invisible_team': False}" domain="[('team_id.user_id','=',uid)]" help="My Sales Team(s)" groups="base.group_multi_salesteams"/>
<separator/>
- <filter string="My Company" context="{'invisible_team': False}" domain="[('company_id.user_ids','=',uid)]" help="My Company"/>
+ <filter string="My Company" domain="[('company_id.user_ids','=',uid)]" help="My Company" groups="base.group_multi_company"/>
<separator/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="user_id" string="Salesperson"/>
</group>
<group expand="1" string="Group By">
<filter string="Salesperson" name="Salesperson" context="{'group_by':'user_id'}" />
- <filter string="Sales Team" context="{'group_by':'team_id'}" groups="base.group_multi_salesteams"/>
<filter string="Partner" name="partner" context="{'group_by':'partner_id'}" />
<filter string="Stage" context="{'group_by':'stage_id'}" />
<filter string="Category" context="{'group_by':'categ_id'}" />
<filter string="Company" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<separator/>
- <filter string="Claim Month" context="{'group_by':'claim_date:month'}" help="Month of claim"/>
+ <filter string="Creation Month" context="{'group_by':'claim_date:month'}" help="Month of claim"/>
</group>
</search>
</field>
<filter string="Open" domain="[('state','=','open')]" />
<filter string="Closed" domain="[('state','=','cancel')]" />
<separator/>
- <filter string="My Case(s)" help="My Case(s)" domain="[('user_id','=',uid)]" />
- <separator/>
<filter string="My Sales Team(s)" context="{'invisible_team': False}" domain="[('team_id.user_id','=',uid)]" help="My Sales Team(s)" groups="base.group_multi_salesteams"/>
<separator/>
<filter string="My Company" context="{'invisible_team': False}" domain="[('company_id.user_ids','=',uid)]" help="My Company"/>
<filter string="New" domain="[('event_state','=','draft')]" help="Events which are in New state"/>
<filter string="Confirm" domain="[('event_state','=','confirm')]" help="Events which are in confirm state"/>
<separator/>
- <filter string="My Events" help="My Events" domain="[('user_id','=',uid)]"/>
<field name="event_id" string="Event"/>
<field name="user_id"/>
<group expand="0" string="Extended Filters...">
</group>
<newline/>
<group expand="1" string="Group By">
- <filter string="Participant" context="{'group_by':'name_registration'}" help="Registration contact"/>
+ <filter string="Attendee / Contact" context="{'group_by':'name_registration'}" help="Registration contact"/>
<filter string="Event Type" context="{'group_by':'event_type'}"/>
<filter string="Event" name="event" context="{'group_by':'event_id', 'max_reg_event_visible':0}"/>
<filter string="Event State" context="{'group_by':'event_state'}"/>
<separator/>
<filter string="Event Month" context="{'group_by':'event_date:month'}" help="Event Beginning Date"/>
</group>
- <group expand="0" string="Display">
- <filter string="Show Confirmed Registrations" domain="[('event_state','<>','draft')]"
- help="Registrations in confirmed or done state" context="{'no_of_draft_invisible':1}"/>
- </group>
</search>
</field>
</record>
<separator/>
<filter name="year" string="Year" domain="[('holiday_status_id.active','=',True)]" help="Filters only on allocations and requests that belong to an holiday type that is 'active' (active field is True)"/>
<separator/>
- <filter string="My Requests" name="my_leaves" domain="[('employee_id.user_id','=', uid)]" help="My Leave Requests"/>
- <separator/>
<filter string="To Do" name="todo" domain="[('payslip_status', '=', False), ('holiday_status_id.active', '=', True)]"/>
<separator/>
<filter string="My Department Leaves" help="My Department Leaves" domain="[('department_id.manager_id','=',uid)]"/>
<filter string="This Year" name="year" domain="[('date_create','<=', time.strftime('%%Y-12-31')),('date_create','>=',time.strftime('%%Y-01-01'))]"/>
<separator/>
<filter string="Unassigned" domain="[('user_id', '=', False)]"/>
- <filter string="My" domain="[('user_id', '=', uid)]"/>
<separator/>
<filter string="New" domain="[('stage_id.sequence', '=', 1)]"/>
<separator/>
return result
_columns = {
'res_id' : fields.integer('Resource', readonly=True),
- 'year': fields.char('Year', size=4, readonly=True),
+ 'year': fields.char('Execution Year', size=4, readonly=True),
'month': fields.selection([('01','January'), ('02','February'),
('03','March'), ('04','April'),('05','May'), ('06','June'),
('07','July'), ('08','August'), ('09','September'),
('10','October'), ('11','November'), ('12','December')],
- 'Month', readonly=True),
- 'day': fields.char('Day', size=10, readonly=True),
- 'date': fields.date('Date', readonly=True, select=True),
+ 'Execution Month', readonly=True),
+ 'day': fields.char('Execution Day', size=10, readonly=True),
+ 'date': fields.date('Execution Date', readonly=True, select=True),
'campaign_id': fields.many2one('marketing.campaign', 'Campaign',
readonly=True),
'activity_id': fields.many2one('marketing.campaign.activity', 'Activity',
<filter string="Activity" name="activity" context="{'group_by':'activity_id'}"/>
<filter string="Status" context="{'group_by':'state'}"/>
<separator/>
- <filter string="Month" context="{'group_by':'month'}"/>
+ <filter string="Execution Month" context="{'group_by':'month'}"/>
</group>
</search>
</field>
'nbr': fields.integer('# of Lines', readonly=True), # TDE FIXME master: rename into nbr_lines
'date': fields.date('Date', readonly=True),
'product_id': fields.many2one('product.product', 'Product', readonly=True),
+ 'product_tmpl_id': fields.many2one('product.template', 'Product Template', readonly=True),
+ 'category_id': fields.many2one('product.category', 'Product Category', readonly=True),
'product_qty': fields.float('Product Qty', digits_compute=dp.get_precision('Product Unit of Measure'), readonly=True),
'state': fields.selection([('draft','Draft'),('startworking', 'In Progress'),('pause','Pause'),('cancel','Cancelled'),('done','Finished')], 'Status', readonly=True),
'total_hours': fields.float('Total Hours', readonly=True),
'total_cycles': fields.float('Total Cycles', readonly=True),
'delay': fields.float('Delay', readonly=True),
'production_id': fields.many2one('mrp.production', 'Production', readonly=True),
- 'workcenter_id': fields.many2one('mrp.workcenter', 'Work Center', readonly=True)
+ 'workcenter_id': fields.many2one('mrp.workcenter', 'Work Center', readonly=True),
+ 'user_id': fields.many2one('res.users', 'Responsible'),
+ 'routing_id': fields.many2one('mrp.routing', string='Routing', readonly=True),
+ 'bom_id': fields.many2one('mrp.bom', 'Bill of Material', readonly=True),
}
def init(self, cr):
date(wl.date_planned) as date,
min(wl.id) as id,
mp.product_id as product_id,
+ p.product_tmpl_id,
+ t.categ_id as category_id,
sum(wl.hour) as total_hours,
avg(wl.delay) as delay,
(w.costs_hour*sum(wl.hour)) as total_cost,
sum(wl.cycle) as total_cycles,
count(*) as nbr,
sum(mp.product_qty) as product_qty,
- wl.state as state
+ wl.state as state,
+ mp.user_id,
+ mp.routing_id,
+ mp.bom_id
from mrp_production_workcenter_line wl
left join mrp_workcenter w on (w.id = wl.workcenter_id)
left join mrp_production mp on (mp.id = wl.production_id)
+ left join product_product p on (mp.product_id=p.id)
+ left join product_template t on (p.product_tmpl_id=t.id)
group by
- w.costs_hour, mp.product_id, mp.name, wl.state, wl.date_planned, wl.production_id, wl.workcenter_id
+ w.costs_hour, mp.product_id, mp.name, mp.user_id, mp.routing_id, mp.bom_id, wl.state, wl.date_planned, wl.production_id, wl.workcenter_id, p.product_tmpl_id, t.categ_id
)""")
<filter string="Status" context="{'group_by':'state'}"/>
<filter string="Product" name="Product" context="{'group_by':'product_id'}" />
<separator/>
- <filter string="Month Planned" name="terp-go-month" context="{'group_by':'date:month'}" help="Planned Month"/>
+ <filter string="Planned Month" name="terp-go-month" context="{'group_by':'date:month'}" help="Planned Month"/>
</group>
</search>
</field>
'date': fields.datetime('Date Order', readonly=True),
'partner_id':fields.many2one('res.partner', 'Partner', readonly=True),
'product_id':fields.many2one('product.product', 'Product', readonly=True),
+ 'product_tmpl_id': fields.many2one('product.template', 'Product Template', readonly=True),
'state': fields.selection([('draft', 'New'), ('paid', 'Closed'), ('done', 'Synchronized'), ('invoiced', 'Invoiced'), ('cancel', 'Cancelled')],
'Status'),
'user_id':fields.many2one('res.users', 'Salesperson', readonly=True),
'journal_id': fields.many2one('account.journal', 'Journal'),
'delay_validation': fields.integer('Delay Validation'),
'product_categ_id': fields.many2one('product.category', 'Product Category', readonly=True),
+ 'invoiced': fields.boolean('Invoiced', readonly=True),
+ 'config_id' : fields.many2one('pos.config', 'Point of Sale', readonly=True),
+ 'pos_categ_id': fields.many2one('pos.category','Public Category', readonly=True),
+ 'stock_location_id': fields.many2one('stock.location', 'Warehouse', readonly=True),
+ 'pricelist_id': fields.many2one('product.pricelist', 'Pricelist', readonly=True),
}
_order = 'date desc'
s.company_id as company_id,
s.sale_journal as journal_id,
l.product_id as product_id,
- pt.categ_id as product_categ_id
+ pt.categ_id as product_categ_id,
+ p.product_tmpl_id,
+ ps.config_id,
+ pt.pos_categ_id,
+ pc.stock_location_id,
+ s.pricelist_id,
+ s.invoice_id IS NOT NULL AS invoiced
from pos_order_line as l
left join pos_order s on (s.id=l.order_id)
left join product_product p on (l.product_id=p.id)
left join product_template pt on (p.product_tmpl_id=pt.id)
left join product_uom u on (u.id=pt.uom_id)
+ left join pos_session ps on (s.session_id=ps.id)
+ left join pos_config pc on (ps.config_id=pc.id)
group by
s.date_order, s.partner_id,s.state, pt.categ_id,
- s.user_id,s.location_id,s.company_id,s.sale_journal,l.product_id,s.create_date
+ s.user_id,s.location_id,s.company_id,s.sale_journal,s.pricelist_id,s.invoice_id,l.product_id,s.create_date,pt.categ_id,pt.pos_categ_id,p.product_tmpl_id,ps.config_id,pc.stock_location_id
having
sum(l.qty * u.factor) != 0)""")
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
<filter string="Invoiced" domain="[('state','=',('invoiced'))]"/>
<filter string="Not Invoiced" domain="[('state','=',('paid'))]"/>
<separator/>
- <filter string="Year" name="year" domain="[('date','<=', time.strftime('%%Y-%%m-%%d')),('date','>=',time.strftime('%%Y-01-01'))]" help="POS ordered created during current year"/>
+ <filter string="Year" name="year" domain="[('date','<=', time.strftime('%%Y-12-31')),('date','>=',time.strftime('%%Y-01-01'))]" help="POS ordered created during current year"/>
<separator/>
<filter string="My Sales" help="My Sales" domain="[('user_id','=',uid)]"/>
<field name="partner_id"/>
<field name="user_id"/>
<field name="partner_id" filter_domain="[('partner_id', 'child_of', self)]"/>
<field name="stage_id"/>
- <filter string="My Task" domain="[('user_id','=',uid)]"/>
<filter string="Unassigned" name="unassigned" domain="[('user_id','=',False)]"/>
<separator/>
<filter string="New" name="new" domain="[('stage_id.sequence', '<=', 1)]"/>
<field name="partner_id" filter_domain="[('partner_id', 'child_of', self)]"/>
<field name="version_id"/>
<field name="stage_id"/>
- <filter string="My Issues" domain="[('user_id','=',uid)]" />
<filter string="Unassigned" name="unassigned" domain="[('user_id','=',False)]"/>
<separator/>
<filter string="New" name="new" domain="[('stage_id.sequence', '<=', 1)]"/>
<group expand="1" string="Group By">
<filter string="Assigned to" name="Responsible" context="{'group_by':'user_id'}" />
<filter string="Project" name="project" context="{'group_by':'project_id'}" />
- <filter string="Task" context="{'group_by':'task_id'}"/>
<filter string="Priority" context="{'group_by':'priority'}" />
<filter string="Stage" context="{'group_by':'stage_id'}"/>
<filter string="Company" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
'user_id':fields.many2one('res.users', 'Responsible', readonly=True),
'delay':fields.float('Days to Validate', digits=(16,2), readonly=True),
'delay_pass':fields.float('Days to Deliver', digits=(16,2), readonly=True),
- 'quantity': fields.integer('Unit Quantity', readonly=True), # TDE FIXME master: rename into unit_quantity
+ 'quantity': fields.float('Product Quantity', readonly=True), # TDE FIXME master: rename into unit_quantity
'price_total': fields.float('Total Price', readonly=True),
'price_average': fields.float('Average Price', readonly=True, group_operator="avg"),
'negociation': fields.float('Purchase-Standard Price', readonly=True, group_operator="avg"),
'price_standard': fields.float('Products Value', readonly=True, group_operator="sum"),
'nbr': fields.integer('# of Lines', readonly=True), # TDE FIXME master: rename into nbr_lines
- 'category_id': fields.many2one('product.category', 'Category', readonly=True)
-
+ 'category_id': fields.many2one('product.category', 'Product Category', readonly=True),
+ 'product_tmpl_id': fields.many2one('product.template', 'Product Template', readonly=True),
+ 'country_id': fields.many2one('res.country', 'Partner Country', readonly=True),
+ 'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position', readonly=True),
+ 'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic Account', readonly=True),
+ 'commercial_partner_id': fields.many2one('res.partner', 'Commercial Entity', readonly=True),
}
_order = 'date desc, price_total desc'
def init(self, cr):
s.partner_id as partner_id,
s.create_uid as user_id,
s.company_id as company_id,
+ s.fiscal_position as fiscal_position,
l.product_id,
+ p.product_tmpl_id,
t.categ_id as category_id,
t.uom_id as product_uom,
s.location_id as location_id,
sum(l.price_unit*l.product_qty)::decimal(16,2) as price_total,
avg(100.0 * (l.price_unit*l.product_qty) / NULLIF(ip.value_float*l.product_qty/u.factor*u2.factor, 0.0))::decimal(16,2) as negociation,
sum(ip.value_float*l.product_qty/u.factor*u2.factor)::decimal(16,2) as price_standard,
- (sum(l.product_qty*l.price_unit)/NULLIF(sum(l.product_qty/u.factor*u2.factor),0.0))::decimal(16,2) as price_average
+ (sum(l.product_qty*l.price_unit)/NULLIF(sum(l.product_qty/u.factor*u2.factor),0.0))::decimal(16,2) as price_average,
+ partner.country_id as country_id,
+ partner.commercial_partner_id as commercial_partner_id
from purchase_order_line l
join purchase_order s on (l.order_id=s.id)
+ join res_partner partner on s.partner_id = partner.id
left join product_product p on (l.product_id=p.id)
left join product_template t on (p.product_tmpl_id=t.id)
LEFT JOIN ir_property ip ON (ip.name='standard_price' AND ip.res_id=CONCAT('product.template,',t.id) AND ip.company_id=s.company_id)
s.pricelist_id,
s.validator,
s.dest_address_id,
+ s.fiscal_position,
l.product_id,
+ p.product_tmpl_id,
t.categ_id,
s.date_order,
s.state,
u.category_id,
t.uom_id,
u.id,
- u2.factor
+ u2.factor,
+ partner.country_id,
+ partner.commercial_partner_id
)
""")
</group>
<group expand="1" string="Group By">
<filter string="Supplier" name="group_partner_id" context="{'group_by':'partner_id'}"/>
+ <filter string="Partner's Country" name="country_id" context="{'group_by':'country_id'}"/>
<filter string="Responsible" name="Responsible" context="{'group_by':'user_id'}"/>
- <filter string="Category of product" name="group_category_id" context="{'group_by':'category_id'}"/>
+ <filter string="Product Category" name="group_category_id" context="{'group_by':'category_id'}"/>
<filter string="Status" context="{'group_by':'state'}"/>
<filter string="Company" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<separator/>
<filter string="Order Month" context="{'group_by':'date:month'}" help="Order of Day"/>
+ <filter string="Fiscal Position" context="{'group_by':'fiscal_position'}" help="Purchase Order Fiscal Position"/>
</group>
</search>
</field>
'user_id': fields.many2one('res.users', 'Salesperson', readonly=True),
'price_total': fields.float('Total Price', readonly=True),
'delay': fields.float('Commitment Delay', digits=(16,2), readonly=True),
- 'categ_id': fields.many2one('product.category','Category of Product', readonly=True),
+ 'product_tmpl_id': fields.many2one('product.template', 'Product Template', readonly=True),
+ 'categ_id': fields.many2one('product.category','Product Category', readonly=True),
'nbr': fields.integer('# of Lines', readonly=True), # TDE FIXME master: rename into nbr_lines
'state': fields.selection([
('draft', 'Quotation'),
], 'Order Status', readonly=True),
'pricelist_id': fields.many2one('product.pricelist', 'Pricelist', readonly=True),
'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account', readonly=True),
- 'team_id': fields.many2one('crm.team', 'Sales Team', oldname='section_id'),
+ 'invoiced': fields.boolean('Paid', readonly=True),
+ 'nbr_paid': fields.integer('# of Paid Lines', readonly=True),
+ 'team_id': fields.many2one('crm.team', 'Sales Team', readonly=True, oldname='section_id'),
+ 'country_id': fields.many2one('res.country', 'Partner Country', readonly=True),
+ 'commercial_partner_id': fields.many2one('res.partner', 'Commercial Entity', readonly=True),
}
_order = 'date desc'
t.categ_id as categ_id,
s.pricelist_id as pricelist_id,
s.project_id as analytic_account_id,
- s.team_id as team_id
+ s.team_id as team_id,
+ p.product_tmpl_id,
+ l.invoiced::integer as nbr_paid,
+ l.invoiced,
+ partner.country_id as country_id,
+ partner.commercial_partner_id as commercial_partner_id
"""
return select_str
from_str = """
sale_order_line l
join sale_order s on (l.order_id=s.id)
+ join res_partner partner on s.partner_id = partner.id
left join product_product p on (l.product_id=p.id)
left join product_template t on (p.product_tmpl_id=t.id)
left join product_uom u on (u.id=l.product_uom)
s.state,
s.pricelist_id,
s.project_id,
- s.team_id
+ s.team_id,
+ p.product_tmpl_id,
+ l.invoiced,
+ partner.country_id,
+ partner.commercial_partner_id
"""
return group_by_str
<filter name="Quotations" domain="[('state','in',('draft','sent'))]"/>
<filter name="Sales" string="Sales" domain="[('state','not in',('draft','sent','cancel'))]"/>
<separator/>
- <filter string="My Sales" help="My Sales" domain="[('user_id','=',uid)]"/>
<field name="partner_id"/>
<field name="product_id"/>
<field name="user_id"/>
<group expand="1" string="Group By">
<filter string="Salesperson" name="User" context="{'group_by':'user_id'}"/>
<filter string="Sales Team" context="{'group_by':'team_id'}" groups="base.group_multi_salesteams"/>
+ <filter string="Partner's Country" name="country_id" context="{'group_by':'country_id'}"/>
<filter string="Customer" name="Customer" context="{'group_by':'partner_id'}"/>
- <filter string="Category of Product" name="Category" context="{'group_by':'categ_id'}"/>
+ <filter string="Product Category" name="Category" context="{'group_by':'categ_id'}"/>
<filter string="Status" context="{'group_by':'state'}"/>
<filter string="Company" groups="base.group_multi_company" context="{'group_by':'company_id'}"/>
<separator/>
_inherit = "sale.report"
_columns = {
'shipped': fields.boolean('Shipped', readonly=True),
- 'shipped_qty_1': fields.integer('Shipped', readonly=True),
+ 'shipped_qty_1': fields.integer('# of Shipped Lines', readonly=True),
'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse',readonly=True),
'state': fields.selection([
('draft', 'Quotation'),