Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
gediminasvenc committed Dec 8, 2017
1 parent 661c1a3 commit 8c85645
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sale_analysis_by_supplier/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
import sale
import sale_report
36 changes: 36 additions & 0 deletions sale_analysis_by_supplier/__openerp__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Odoo, Open Source Management Solution
# Copyright (C) 2016-TODAY Linserv Aktiebolag, Sweden (<http://www.linserv.se>).
#
##############################################################################
{
"name": "Main Supplier In Sales Analysis",
"version": "1.0",
"author": "Linserv AB",
"category": "Sales Management",
"summary": "Main Supplier In Sales Analysis",
"website": "www.linserv.se",
"contributors": [
'Gediminas Venclova <[email protected]>'
],
"license": "",
"depends": [
'base', 'sale',
],
'description': """
Main Supplier In Sales Analysis
This module adds main supplier to sales analysis report.
""",
"demo": [],
"data": [],
"test": [],
"js": [],
"css": [],
"qweb": [],
"installable": True,
"auto_install": False,
}
9 changes: 9 additions & 0 deletions sale_analysis_by_supplier/sale.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# -*- coding: utf-8 -*-

from openerp import models, fields, _


class SaleAnalysisBySUpplierSale(models.Model):
_inherit = 'sale.order.line'

seller_id = fields.Many2one(related='product_id.product_tmpl_id.seller_id', store=True)
15 changes: 15 additions & 0 deletions sale_analysis_by_supplier/sale_report.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-

from openerp import models, fields, _


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

seller_id = fields.Many2one('res.partner', string='Main Supplier', help="Main Supplier who has highest priority in Supplier List.", readonly=True)

def _select(self):
return super(SaleAnalysisBySUpplierSaleReport, self)._select() + ", l.seller_id as seller_id"

def _group_by(self):
return super(SaleAnalysisBySUpplierSaleReport, self)._group_by() + ", l.seller_id"

0 comments on commit 8c85645

Please sign in to comment.