@@ -10,6 +10,9 @@ class ProductCategory(models.Model):
10
10
intrastat_code_id = fields .Many2one (
11
11
"report.intrastat.code" , string = "Nomenclature Code"
12
12
)
13
+ intrastat_country_origin_id = fields .Many2one (
14
+ "res.country" , string = "Origin Country"
15
+ )
13
16
intrastat_type = fields .Selection (
14
17
[
15
18
("good" , "Goods" ),
@@ -27,6 +30,9 @@ class ProductTemplate(models.Model):
27
30
intrastat_code_id = fields .Many2one (
28
31
comodel_name = "report.intrastat.code" , string = "Intrastat Code"
29
32
)
33
+ intrastat_country_origin_id = fields .Many2one (
34
+ "res.country" , string = "Origin Country"
35
+ )
30
36
intrastat_type = fields .Selection (
31
37
selection = [
32
38
("good" , "Goods" ),
@@ -44,12 +50,20 @@ def get_intrastat_data(self):
44
50
- Intrastat Code on product template
45
51
- Intrastat Code on product category
46
52
"""
47
- res = {"intrastat_code_id" : False , "intrastat_type" : False }
53
+ res = {
54
+ "intrastat_code_id" : False ,
55
+ "intrastat_country_origin_id" : False ,
56
+ "intrastat_type" : False ,
57
+ }
48
58
# From Product
49
59
if self .intrastat_type :
50
60
res ["intrastat_code_id" ] = self .intrastat_code_id .id
61
+ res ["intrastat_country_origin_id" ] = self .intrastat_country_origin_id .id
51
62
res ["intrastat_type" ] = self .intrastat_type
52
63
elif self .categ_id and self .categ_id .intrastat_code_id :
53
64
res ["intrastat_code_id" ] = self .categ_id .intrastat_code_id .id
65
+ res [
66
+ "intrastat_country_origin_id"
67
+ ] = self .categ_id .intrastat_country_origin_id .id
54
68
res ["intrastat_type" ] = self .categ_id .intrastat_type
55
69
return res
0 commit comments