2
I create an account type tax
4
!record {model: account.account.type, id: type_tax}:
7
close_method: unreconciled
9
I create an vat account
11
!record {model: account.account, id: account_1}:
13
type_for_register: none
21
!record {model: account.tax, id: normal_vat}:
26
account_collected_id: account_1
27
account_paid_id: account_1
31
!record {model: res.partner, id: res_partner_africom0}:
37
Then I create its partner address
39
!record {model: res.partner.address, id: res_partner_address_0}:
41
partner_id: res_partner_africom0
46
I create a product category
48
!record {model: product.category, id: product_category_testproducts0}:
52
I create a product with the normal VAT named
54
!record {model: product.product, id: product_product_camembert0}:
55
categ_id: product_category_testproducts0
57
default_code: CAM-INT-1234
60
name_template: Camembert
61
procure_method: make_to_order
63
seller_id: res_partner_africom0
67
name: res_partner_africom0
68
product_code: PUE-AFRI-1234
69
product_name: Fromage qui pue Africom
72
supplier_taxes_id: [normal_vat]
75
uom_id: product.product_uom_unit
76
uom_po_id: product.product_uom_unit
77
valuation: manual_periodic
82
international_status: itc
84
In order to test VAT management I create a purchase order with the product that have a VAT
86
!record {model: purchase.order, id: purchase_order_po0}:
90
company_id: base.main_company
91
date_order: !eval time.strftime('%Y-%m-%d')
93
location_id: stock.stock_location_stock
94
minimum_planned_date: !eval time.strftime('%Y-%m-%d')
95
partner_address_id: res_partner_address_0
96
partner_id: res_partner_africom0
97
pricelist_id: purchase.list0
99
Then I add an order line to this purchase
101
!record {model: purchase.order.line, id: purchase_order_line_camembert0}:
102
company_id: base.main_company
103
date_planned: !eval time.strftime('%Y-%m-%d')
104
order_id: purchase_order_po0
105
partner_id: res_partner_africom0
107
product_id: product_product_camembert0
109
product_uom: product.product_uom_unit
112
When a product is choosen, an update permits to affect VAT
114
!python {model: purchase.order.line}: |
116
self.product_id_change(cr, uid, [ref('purchase_order_line_camembert0')], ref('purchase.list0'), ref('product_product_camembert0'),
117
1.0, ref('product.product_uom_unit'), ref('res_partner_africom0'), time.strftime('%Y-%m-%d'), False, False, "Camembert",
120
We confirm the purchase
122
!workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_po0}
124
We validate the purchase
126
!workflow {model: purchase.order, action: purchase_approve, ref: purchase_order_po0}