FIX dependency list

More python method call
Update encoding header
This commit is contained in:
Alexis de Lattre
2015-11-13 13:29:10 +01:00
parent a709ed6ec5
commit 7abafdf9d5
6 changed files with 16 additions and 10 deletions

View File

@@ -1,3 +1,3 @@
# -*- encoding: utf-8 -*-
# -*- coding: utf-8 -*-
from . import models

View File

@@ -1,4 +1,4 @@
# -*- encoding: utf-8 -*-
# -*- coding: utf-8 -*-
##############################################################################
#
# Intrastat Product module for Odoo
@@ -32,7 +32,8 @@
'depends': [
'intrastat_base',
'product_harmonized_system',
'stock',
'sale_stock',
'purchase',
],
'conflicts': ['report_intrastat'],
'data': [

View File

@@ -368,8 +368,7 @@ class IntrastatProductDeclaration(models.Model):
[('invoice_lines', 'in', inv_line.id)])
if po_lines:
po = po_lines.order_id
region = self.env['stock.warehouse'].get_region_from_location(
po.location_id)
region = po.location_id.get_intrastat_region()
elif inv_line.invoice_id.type in ('out_invoice', 'out_refund'):
so_lines = self.env['sale.order.line'].search(
[('invoice_lines', 'in', inv_line.id)])

View File

@@ -1,4 +1,4 @@
# -*- encoding: utf-8 -*-
# -*- coding: utf-8 -*-
##############################################################################
#
# Intrastat Product module for Odoo

View File

@@ -1,4 +1,4 @@
# -*- encoding: utf-8 -*-
# -*- coding: utf-8 -*-
##############################################################################
#
# Intrastat Product module for Odoo

View File

@@ -1,4 +1,4 @@
# -*- encoding: utf-8 -*-
# -*- coding: utf-8 -*-
##############################################################################
#
# Odoo, Open Source Management Solution
@@ -20,7 +20,7 @@
#
##############################################################################
from openerp import models, fields
from openerp import models, fields, api
class StockWarehouse(models.Model):
@@ -30,7 +30,13 @@ class StockWarehouse(models.Model):
'intrastat.region',
string='Intrastat region')
def get_region_from_location(self, location):
class StockLocation(models.Model):
_inherit = 'stock.location'
@api.multi
def get_intrastat_region(self):
self.ensure_one()
locations = location.search(
[('parent_left', '<=', location.parent_left),
('parent_right', '>=', location.parent_right)])