LEFT | RIGHT |
1 =========================== | 1 =========================== |
2 Sale Shipment Cost Scenario | 2 Sale Shipment Cost Scenario |
3 =========================== | 3 =========================== |
4 | 4 |
5 ============= | 5 ============= |
6 General Setup | 6 General Setup |
7 ============= | 7 ============= |
8 | 8 |
9 Imports:: | 9 Imports:: |
10 | 10 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 ... ('kind', '=', 'revenue'), | 105 ... ('kind', '=', 'revenue'), |
106 ... ('company', '=', company.id), | 106 ... ('company', '=', company.id), |
107 ... ]) | 107 ... ]) |
108 >>> expense, = Account.find([ | 108 >>> expense, = Account.find([ |
109 ... ('kind', '=', 'expense'), | 109 ... ('kind', '=', 'expense'), |
110 ... ('company', '=', company.id), | 110 ... ('company', '=', company.id), |
111 ... ]) | 111 ... ]) |
112 >>> create_chart_account.form.account_receivable = receivable | 112 >>> create_chart_account.form.account_receivable = receivable |
113 >>> create_chart_account.form.account_payable = payable | 113 >>> create_chart_account.form.account_payable = payable |
114 >>> create_chart_account.execute('create_properties') | 114 >>> create_chart_account.execute('create_properties') |
115 >>> stock_journal, = AccountJournal.find([('code', '=', 'STO')]) | |
116 | 115 |
117 Create customer:: | 116 Create customer:: |
118 | 117 |
119 >>> Party = Model.get('party.party') | 118 >>> Party = Model.get('party.party') |
120 >>> customer = Party(name='Customer') | 119 >>> customer = Party(name='Customer') |
121 >>> customer.save() | 120 >>> customer.save() |
122 | 121 |
123 Create category:: | 122 Create category:: |
124 | 123 |
125 >>> ProductCategory = Model.get('product.category') | 124 >>> ProductCategory = Model.get('product.category') |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 Send products:: | 199 Send products:: |
201 | 200 |
202 >>> ShipmentOut = Model.get('stock.shipment.out') | 201 >>> ShipmentOut = Model.get('stock.shipment.out') |
203 >>> shipment, = sale.shipments | 202 >>> shipment, = sale.shipments |
204 >>> shipment.carrier == carrier | 203 >>> shipment.carrier == carrier |
205 True | 204 True |
206 >>> shipment.cost == Decimal('3') | 205 >>> shipment.cost == Decimal('3') |
207 True | 206 True |
208 >>> shipment.cost_currency == currency | 207 >>> shipment.cost_currency == currency |
209 True | 208 True |
| 209 >>> move, = shipment.inventory_moves |
| 210 >>> move.quantity = 4 |
| 211 >>> shipment.cost == Decimal('3') |
| 212 True |
| 213 >>> shipment.cost_currency == currency |
| 214 True |
210 >>> shipment.state | 215 >>> shipment.state |
211 u'waiting' | 216 u'waiting' |
| 217 >>> shipment.save() |
212 >>> shipment.reload() | 218 >>> shipment.reload() |
213 >>> ShipmentOut.workflow_trigger_validate(shipment.id, 'force_assign', | 219 >>> ShipmentOut.workflow_trigger_validate(shipment.id, 'force_assign', |
214 ... config.context) | 220 ... config.context) |
215 >>> shipment.state | 221 >>> shipment.state |
216 u'assigned' | 222 u'assigned' |
217 >>> shipment.reload() | 223 >>> shipment.reload() |
218 >>> ShipmentOut.workflow_trigger_validate(shipment.id, 'packed', | 224 >>> ShipmentOut.workflow_trigger_validate(shipment.id, 'packed', |
219 ... config.context) | 225 ... config.context) |
220 >>> shipment.state | 226 >>> shipment.state |
221 u'packed' | 227 u'packed' |
222 >>> shipment.reload() | 228 >>> shipment.reload() |
223 >>> ShipmentOut.workflow_trigger_validate(shipment.id, 'done', | 229 >>> ShipmentOut.workflow_trigger_validate(shipment.id, 'done', |
224 ... config.context) | 230 ... config.context) |
225 >>> shipment.state | 231 >>> shipment.state |
226 u'done' | 232 u'done' |
227 | 233 |
228 Check customer invoice:: | 234 Check customer invoice:: |
229 | 235 |
230 >>> sale.reload() | 236 >>> sale.reload() |
231 >>> invoice, = sale.invoices | 237 >>> invoice, = sale.invoices |
232 >>> invoice.untaxed_amount == Decimal('103') | 238 >>> invoice.untaxed_amount == Decimal('83') |
233 True | 239 True |
234 | 240 |
235 Sale products with cost on order:: | 241 Sale products with cost on order:: |
236 | 242 |
237 >>> sale = Sale() | 243 >>> sale = Sale() |
238 >>> sale.party = customer | 244 >>> sale.party = customer |
239 >>> sale.carrier = carrier | 245 >>> sale.carrier = carrier |
240 >>> sale.payment_term = payment_term | 246 >>> sale.payment_term = payment_term |
241 >>> sale.invoice_method = 'order' | 247 >>> sale.invoice_method = 'order' |
242 >>> sale.shipment_cost_method = 'order' | 248 >>> sale.shipment_cost_method = 'order' |
(...skipping 21 matching lines...) Expand all Loading... |
264 >>> shipment, = sale.shipments | 270 >>> shipment, = sale.shipments |
265 >>> shipment.carrier == carrier | 271 >>> shipment.carrier == carrier |
266 True | 272 True |
267 | 273 |
268 Check customer invoice:: | 274 Check customer invoice:: |
269 | 275 |
270 >>> sale.reload() | 276 >>> sale.reload() |
271 >>> invoice, = sale.invoices | 277 >>> invoice, = sale.invoices |
272 >>> invoice.untaxed_amount == Decimal('63') | 278 >>> invoice.untaxed_amount == Decimal('63') |
273 True | 279 True |
LEFT | RIGHT |