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_stock
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
83
In order to test VAT management I create a purchase order with the product that have a VAT
85
!record {model: purchase.order, id: purchase_order_po0}:
89
company_id: base.main_company
90
date_order: !eval time.strftime('%Y-%m-%d')
92
location_id: stock.stock_location_stock
93
minimum_planned_date: !eval time.strftime('%Y-%m-%d')
94
partner_address_id: res_partner_address_0
95
partner_id: res_partner_africom0
96
pricelist_id: purchase.list0
98
Then I add an order line to this purchase
100
!record {model: purchase.order.line, id: purchase_order_line_camembert0}:
101
company_id: base.main_company
102
date_planned: !eval time.strftime('%Y-%m-%d')
103
order_id: purchase_order_po0
104
partner_id: res_partner_africom0
106
product_id: product_product_camembert0
108
product_uom: product.product_uom_unit
111
When a product is choosen, an update permits to affect VAT
113
!python {model: purchase.order.line}: |
115
self.product_id_change(cr, uid, [ref('purchase_order_line_camembert0')], ref('purchase.list0'), ref('product_product_camembert0'),
116
1.0, ref('product.product_uom_unit'), ref('res_partner_africom0'), time.strftime('%Y-%m-%d'), False, False, "Camembert",
119
We confirm the purchase
121
!workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_po0}
123
We validate the purchase
125
!workflow {model: purchase.order, action: purchase_approve, ref: purchase_order_po0}