[IMP] Reportings Review
authorYannick Tivisse <yti@odoo.com>
Fri, 5 Dec 2014 09:44:53 +0000 (10:44 +0100)
committerRichard Mathot <rim@odoo.com>
Tue, 9 Dec 2014 15:12:48 +0000 (16:12 +0100)
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)

26 files changed:
addons/account/report/account_invoice_report.py
addons/account/report/account_invoice_report_view.xml
addons/account_voucher/report/account_voucher_sales_receipt_view.xml
addons/crm/report/crm_lead_report.py
addons/crm/report/crm_opportunity_report.py
addons/crm/report/crm_opportunity_report_view.xml
addons/crm/report/crm_phonecall_report.py
addons/crm/report/crm_phonecall_report_view.xml
addons/crm_claim/report/crm_claim_report_view.xml
addons/crm_helpdesk/report/crm_helpdesk_report_view.xml
addons/event/report/report_event_registration_view.xml
addons/hr_holidays/hr_holidays_view.xml
addons/hr_recruitment/report/hr_recruitment_report_view.xml
addons/marketing_campaign/report/campaign_analysis.py
addons/marketing_campaign/report/campaign_analysis_view.xml
addons/mrp_operations/report/mrp_workorder_analysis.py
addons/mrp_operations/report/mrp_workorder_analysis_view.xml
addons/point_of_sale/report/pos_order_report.py
addons/point_of_sale/report/pos_order_report_view.xml
addons/project/report/project_report_view.xml
addons/project_issue/report/project_issue_report_view.xml
addons/purchase/report/purchase_report.py
addons/purchase/report/purchase_report_view.xml
addons/sale/report/sale_report.py
addons/sale/report/sale_report_view.xml
addons/sale_stock/report/sale_report.py

index 0639bfc..70367de 100644 (file)
@@ -62,7 +62,7 @@ class account_invoice_report(osv.osv):
         '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"),
@@ -95,6 +95,7 @@ class account_invoice_report(osv.osv):
         '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'
 
@@ -107,7 +108,7 @@ class account_invoice_report(osv.osv):
         ],
         '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'],
@@ -118,7 +119,7 @@ class account_invoice_report(osv.osv):
 
     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,
@@ -131,7 +132,7 @@ class account_invoice_report(osv.osv):
         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
@@ -201,7 +202,7 @@ class account_invoice_report(osv.osv):
 
     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,
index aec1aa1..06c9628 100644 (file)
@@ -74,7 +74,7 @@
                     <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" />
index 5621da6..69473dc 100644 (file)
@@ -21,7 +21,6 @@
                 <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...">
index 73bd049..7a398d7 100644 (file)
@@ -32,7 +32,7 @@ class crm_lead_report(osv.Model):
     _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),
index 318e2e5..3db5bd7 100644 (file)
@@ -33,7 +33,7 @@ class crm_opportunity_report(osv.Model):
     _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),
index 2b4805c..936ac8c 100644 (file)
@@ -94,7 +94,7 @@
                         <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>
index 58b34df..a1a048b 100644 (file)
@@ -41,7 +41,7 @@ class crm_phonecall_report(osv.osv):
 
     _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),
index 1401ec9..b646171 100644 (file)
             <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"/>
index accc981..6bb6db5 100644 (file)
             <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>
index 6dd1f57..8fa29e5 100644 (file)
@@ -28,8 +28,6 @@
                     <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"/>
index 5d5cd1d..6fff896 100644 (file)
@@ -23,7 +23,6 @@
                     <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...">
@@ -32,7 +31,7 @@
                     </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','&lt;&gt;','draft')]"
-                              help="Registrations in confirmed or done state" context="{'no_of_draft_invisible':1}"/>
-                    </group>
                 </search>
             </field>
         </record>
index e9820fa..c9626a8 100644 (file)
@@ -33,8 +33,6 @@
                     <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)]"/>
index 9a39653..62d23da 100644 (file)
@@ -43,7 +43,6 @@
                 <filter string="This Year" name="year" domain="[('date_create','&lt;=', time.strftime('%%Y-12-31')),('date_create','&gt;=',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/>
index f09ed96..d0db24b 100644 (file)
@@ -45,14 +45,14 @@ class campaign_analysis(osv.osv):
         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',
index 1ee0eac..43a43c7 100644 (file)
@@ -56,7 +56,7 @@
                     <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>
index cc701e2..4b70785 100644 (file)
@@ -31,13 +31,18 @@ class mrp_workorder(osv.osv):
         '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):
@@ -48,6 +53,8 @@ class mrp_workorder(osv.osv):
                     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,
@@ -56,12 +63,17 @@ class mrp_workorder(osv.osv):
                     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
         )""")
 
 
index 0d46952..da41d9e 100644 (file)
@@ -57,7 +57,7 @@
                         <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>
index aa25052..58e03da 100644 (file)
@@ -31,6 +31,7 @@ class pos_order_report(osv.osv):
         '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),
@@ -44,6 +45,11 @@ class pos_order_report(osv.osv):
         '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'
 
@@ -67,17 +73,22 @@ class pos_order_report(osv.osv):
                     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:
index d184971..d2b4774 100644 (file)
@@ -23,7 +23,7 @@
                     <filter string="Invoiced" domain="[('state','=',('invoiced'))]"/>
                     <filter string="Not Invoiced" domain="[('state','=',('paid'))]"/>
                     <separator/>
-                    <filter string="Year" name="year" domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;=',time.strftime('%%Y-01-01'))]" help="POS ordered created during current year"/>
+                    <filter string="Year" name="year" domain="[('date','&lt;=', time.strftime('%%Y-12-31')),('date','&gt;=',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"/>
index d118ef2..80098bc 100644 (file)
@@ -50,7 +50,6 @@
                     <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', '&lt;=', 1)]"/>
index fb42c50..d6be22b 100644 (file)
                     <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', '&lt;=', 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"/>
index 263084f..338248d 100644 (file)
@@ -52,14 +52,18 @@ class purchase_report(osv.osv):
         '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):
@@ -79,7 +83,9 @@ class purchase_report(osv.osv):
                     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,
@@ -90,9 +96,12 @@ class purchase_report(osv.osv):
                     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)
@@ -112,7 +121,9 @@ class purchase_report(osv.osv):
                     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,
@@ -121,7 +132,9 @@ class purchase_report(osv.osv):
                     u.category_id,
                     t.uom_id,
                     u.id,
-                    u2.factor
+                    u2.factor,
+                    partner.country_id,
+                    partner.commercial_partner_id
             )
         """)
 
index 159268f..c60e3d6 100644 (file)
                 </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>
index bb32fd3..341a82d 100644 (file)
@@ -40,7 +40,8 @@ class sale_report(osv.osv):
         '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'),
@@ -53,7 +54,11 @@ class sale_report(osv.osv):
             ], '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'
 
@@ -75,7 +80,12 @@ class sale_report(osv.osv):
                     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
 
@@ -83,6 +93,7 @@ class sale_report(osv.osv):
         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)
@@ -104,7 +115,11 @@ class sale_report(osv.osv):
                     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
 
index 7ddeaf0..92e8aaa 100644 (file)
@@ -52,7 +52,6 @@
                 <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"/>
@@ -63,8 +62,9 @@
                 <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/>
index 2d126fc..923d7c5 100644 (file)
@@ -26,7 +26,7 @@ class sale_report(osv.osv):
     _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'),