-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
661c1a3
commit 8c85645
Showing
4 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
import sale | ||
import sale_report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |