[FIX] point_of_sale: related bankstatements are correctly associated, Also wip category system

bzr revid: fva@openerp.com-20120529140008-w5ofj50a20e5251d
This commit is contained in:
Frédéric van der Essen 2012-05-29 16:00:08 +02:00
parent a6f263b323
commit 33c4a6177e
4 changed files with 60 additions and 23 deletions

View File

@ -173,8 +173,8 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
var bank_def = fetch(
'account.bank.statement',
['account_id','currency','journal_id','state','name','user_id'],
[['state','=','open'],['user_id', '=', pos_session.user_id[0]]]
['account_id','currency','journal_id','state','name','user_id','pos_session_id'],
[['state','=','open'],['pos_session_id', '=', pos_session.id]]
).then(function(result){
self.set({'bank_statements':result});
});

View File

@ -301,7 +301,7 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
module.ScaleProductScreenWidget = module.ScreenWidget.extend({
template:'ScaleProductSelectionScreenWidget',
start: function(){
this.product_categories_widget = new module.ProductCategoriesWidget(null,{
this.product_categories_widget = new module.ProductCategoriesWidget(this,{
pos:this.pos,
});
this.product_categories_widget.replace($('.placeholder-ProductCategoriesWidget'));
@ -564,15 +564,10 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
module.SearchProductScreenWidget = module.ScreenWidget.extend({
template:'SearchProductScreenWidget',
start: function(){
this.product_categories_widget = new module.ProductCategoriesWidget(null,{
pos:this.pos,
});
this.product_categories_widget = new module.ProductCategoriesWidget2(this,{});
this.product_categories_widget.replace($('.placeholder-ProductCategoriesWidget'));
this.product_list_widget = new module.ProductListWidget(null,{
pos:this.pos,
pos_widget:this.pos_widget,
});
this.product_list_widget = new module.ProductListWidget(this,{});
this.product_list_widget.replace($('.placeholder-ProductListWidget'));
},
show: function(){

View File

@ -487,33 +487,40 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
on_change_category: function(id) {},
});
/*
module.ProductCategoriesWidget2 = module.PosBaseWidget.extend({
template: 'ProductCategoriesWidget',
template: 'ProductCategoriesWidget2',
init: function(parent, options){
this._super(parent,options);
this.onlyWeightable = false;
this.current_category = this.pos.;
this.child_categories = [];
this.category = this.pos.root_category;
this.breadcrumb = [];
this.subcategories = [];
this.set_category();
},
set_category : function(category){
this.current_category = category;
var child_list = [];
if(!category){
this.pos.root_categories;
this.breadcrumb = [];
this.category = this.pos.root_category;
}else{
this.categories = category.childrens
this.breadcrumb
}
this.category = category;
}
for(var i = 1; i < this.category.ancestors.length; i++){
this.breadcrumb.push(this.category.ancestor[i]);
}
this.subcategories = this.category.childrens || [];
},
renderElement: function(){
var self = this;
this._super();
this.$element.empty();
},
reset_category: function(){
this.set_category();
},
on_change_category: function(id){},
search_and_categories: function(id){},
change_category: function(a){
},
});
*/
module.ProductListWidget = module.ScreenWidget.extend({
template:'ProductListWidget',

View File

@ -159,6 +159,41 @@
</div>
</t>
<t t-name="ProductCategoriesWidget2">
<header>
<ol class="breadcrumb">
<li class="oe-pos-categories-list">
<a href="javascript:void(0)">
<img src="/point_of_sale/static/src/img/home.png" class="homeimg" />
</a>
</li>
<t t-foreach="widget.breadcrumb" t-as="category">
<li class="oe-pos-categories-list">
<img src="/point_of_sale/static/src/img/bc-arrow.png" class="bc-arrow" />
<a href="javascript:void(0)" t-att-data-category-id="category.id">
<t t-esc="category.name"/>
</a>
</li>
</t>
</ol>
<div class="searchbox">
<input placeholder="Search Products" />
<img class="search-clear" src="/point_of_sale/static/src/img/search_reset.gif" />
</div>
</header>
<div id="categories">
<ol>
<t t-foreach="widget.subcategories" t-as="category">
<li class="oe-pos-categories-list">
<a href="javascript:void(0)" t-att-data-category-id="category.id" class="button">
<t t-esc="category.name"/>
</a>
</li>
</t>
</ol>
</div>
</t>
<t t-name="ProductListWidget">
<ol id="products-screen-ol" class="product-list">
</ol>