소스 검색

[FIX] ajuste en el domain

Rodney Elpidio Enciso Arias 6 년 전
부모
커밋
6e068b0913
3개의 변경된 파일1개의 추가작업 그리고 18개의 파일을 삭제
  1. 0 16
      model/sale_order.py
  2. BIN
      model/sale_order.pyc
  3. 1 2
      static/src/js/sale.js

+ 0 - 16
model/sale_order.py

@@ -6,10 +6,6 @@ from openerp.exceptions import except_orm
 class SaleOrderInsert(models.Model):
 	_inherit = 'sale.order'
 
-	amount_untaxed = fields.Float( compute='_compute_amount_all')
-	amount_tax = fields.Float( compute='_compute_amount_all')
-	amount_total = fields.Float( compute='_compute_amount_all')
-
 	@api.model
 	def sale_insert_lines_by_eiru_original(self, values):
 		sale_lines_eiru = self.env['sale.order.line']
@@ -27,15 +23,3 @@ class SaleOrderInsert(models.Model):
 			lines.write({
 				'product_uom_qty': lines.product_uom_qty + 1,
 			})
-
-	@api.depends('order_line.price_subtotal')
-	def _compute_amount_all(self):
-		for order in self:
-			amount_tax = amount_untaxed = 0.0
-			currency = order.currency_id.with_context(date=order.date_order or fields.Date.context_today(order))
-			for line in order.order_line:
-				amount_untaxed += line.price_subtotal
-				amount_tax += (line.product_uom_qty * line.price_unit) - line.price_subtotal
-			order.amount_tax = currency.round(amount_tax)
-			order.amount_untaxed = currency.round(amount_untaxed)
-			order.amount_total = currency.round(amount_tax + amount_untaxed)

BIN
model/sale_order.pyc


+ 1 - 2
static/src/js/sale.js

@@ -70,7 +70,6 @@ openerp.barcode_sale_order = function (instance, local) {
                 return ProductProduct;
             }).then(function(ProductProduct){
                 self.ProductProduct = ProductProduct;
-                console.log(id);
                 if(id != undefined){
                     if(ProductProduct.length == 1){
                         self.InsertProduct(ProductProduct[0].id);
@@ -92,7 +91,7 @@ openerp.barcode_sale_order = function (instance, local) {
             var domain = [
                 ['active','=',true],
                 ['sale_ok','=',true],
-                '|',['ean13','like','product_code'],['default_code','like',product_code],
+                '|',['ean13','like',product_code],['default_code','like',product_code],
             ];
             var ProductProduct = new model.web.Model('product.product');
             return ProductProduct.call('getProductProductSearch',[domain], {