Merge lp:~openbig/bigconsulting/sales_shop_stock_availability into lp:bigconsulting
- sales_shop_stock_availability
- Merge into addons
Proposed by
gpa(OpenERP)
Status: | Merged |
---|---|
Merged at revision: | 8 |
Proposed branch: | lp:~openbig/bigconsulting/sales_shop_stock_availability |
Merge into: | lp:bigconsulting |
Diff against target: |
764 lines (+707/-0) 11 files modified
account_invoice_cash_discount/__init__.py (+26/-0) account_invoice_cash_discount/__terp__.py (+45/-0) account_invoice_cash_discount/account_invoice_cash_discount.py (+195/-0) account_invoice_cash_discount/account_invoice_cash_discount_view.xml (+47/-0) account_invoice_cash_discount/account_wizard.xml (+6/-0) account_invoice_cash_discount/wizard/__init__.py (+26/-0) account_invoice_cash_discount/wizard/wizard_pay_invoice.py (+203/-0) sales_shop_stock_availability/__init__.py (+26/-0) sales_shop_stock_availability/__terp__.py (+38/-0) sales_shop_stock_availability/sales_shop_stock_availability.py (+52/-0) sales_shop_stock_availability/sales_shop_stock_availability_view.xml (+43/-0) |
To merge this branch: | bzr merge lp:~openbig/bigconsulting/sales_shop_stock_availability |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
openbig | Pending | ||
Review via email: mp+26274@code.launchpad.net |
Commit message
Description of the change
Added Module sales_shop_
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added directory 'account_invoice_cash_discount' | |||
2 | === added file 'account_invoice_cash_discount/__init__.py' | |||
3 | --- account_invoice_cash_discount/__init__.py 1970-01-01 00:00:00 +0000 | |||
4 | +++ account_invoice_cash_discount/__init__.py 2010-05-28 07:36:36 +0000 | |||
5 | @@ -0,0 +1,26 @@ | |||
6 | 1 | # -*- encoding: utf-8 -*- | ||
7 | 2 | ############################################################################## | ||
8 | 3 | # | ||
9 | 4 | # OpenERP, Open Source Management Solution | ||
10 | 5 | # Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved | ||
11 | 6 | # $Id$ | ||
12 | 7 | # | ||
13 | 8 | # This program is free software: you can redistribute it and/or modify | ||
14 | 9 | # it under the terms of the GNU General Public License as published by | ||
15 | 10 | # the Free Software Foundation, either version 3 of the License, or | ||
16 | 11 | # (at your option) any later version. | ||
17 | 12 | # | ||
18 | 13 | # This program is distributed in the hope that it will be useful, | ||
19 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
20 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
21 | 16 | # GNU General Public License for more details. | ||
22 | 17 | # | ||
23 | 18 | # You should have received a copy of the GNU General Public License | ||
24 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
25 | 20 | # | ||
26 | 21 | ############################################################################## | ||
27 | 22 | |||
28 | 23 | import account_invoice_cash_discount | ||
29 | 24 | import wizard | ||
30 | 25 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
31 | 26 | |||
32 | 0 | 27 | ||
33 | === added file 'account_invoice_cash_discount/__terp__.py' | |||
34 | --- account_invoice_cash_discount/__terp__.py 1970-01-01 00:00:00 +0000 | |||
35 | +++ account_invoice_cash_discount/__terp__.py 2010-05-28 07:36:36 +0000 | |||
36 | @@ -0,0 +1,45 @@ | |||
37 | 1 | # -*- encoding: utf-8 -*- | ||
38 | 2 | ############################################################################## | ||
39 | 3 | # | ||
40 | 4 | # OpenERP, Open Source Management Solution | ||
41 | 5 | # Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved | ||
42 | 6 | # $Id$ | ||
43 | 7 | # | ||
44 | 8 | # This program is free software: you can redistribute it and/or modify | ||
45 | 9 | # it under the terms of the GNU General Public License as published by | ||
46 | 10 | # the Free Software Foundation, either version 3 of the License, or | ||
47 | 11 | # (at your option) any later version. | ||
48 | 12 | # | ||
49 | 13 | # This program is distributed in the hope that it will be useful, | ||
50 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
51 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
52 | 16 | # GNU General Public License for more details. | ||
53 | 17 | # | ||
54 | 18 | # You should have received a copy of the GNU General Public License | ||
55 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
56 | 20 | # | ||
57 | 21 | ############################################################################## | ||
58 | 22 | { | ||
59 | 23 | "name" : "Payement Term with Cash Discount", | ||
60 | 24 | "version" : "1.0", | ||
61 | 25 | "depends" : ["account",], | ||
62 | 26 | "author" : "Big Consulting", | ||
63 | 27 | "website" : "", | ||
64 | 28 | "category" : "", | ||
65 | 29 | "description": """ | ||
66 | 30 | The Module add automatically account move lines in case of payment with cash discount conditions in reconcilation form. | ||
67 | 31 | """, | ||
68 | 32 | "init_xml" : [ | ||
69 | 33 | ], | ||
70 | 34 | "demo_xml" : [ | ||
71 | 35 | ], | ||
72 | 36 | "update_xml" : [ | ||
73 | 37 | "account_invoice_cash_discount_view.xml", | ||
74 | 38 | "account_wizard.xml" | ||
75 | 39 | ], | ||
76 | 40 | "active": False, | ||
77 | 41 | "installable": True, | ||
78 | 42 | |||
79 | 43 | } | ||
80 | 44 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
81 | 45 | |||
82 | 0 | 46 | ||
83 | === added file 'account_invoice_cash_discount/account_invoice_cash_discount.py' | |||
84 | --- account_invoice_cash_discount/account_invoice_cash_discount.py 1970-01-01 00:00:00 +0000 | |||
85 | +++ account_invoice_cash_discount/account_invoice_cash_discount.py 2010-05-28 07:36:36 +0000 | |||
86 | @@ -0,0 +1,195 @@ | |||
87 | 1 | # -*- encoding: utf-8 -*- | ||
88 | 2 | ############################################################################## | ||
89 | 3 | # | ||
90 | 4 | # OpenERP, Open Source Management Solution | ||
91 | 5 | # Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved | ||
92 | 6 | # $Id$ | ||
93 | 7 | # | ||
94 | 8 | # This program is free software: you can redistribute it and/or modify | ||
95 | 9 | # it under the terms of the GNU General Public License as published by | ||
96 | 10 | # the Free Software Foundation, either version 3 of the License, or | ||
97 | 11 | # (at your option) any later version. | ||
98 | 12 | # | ||
99 | 13 | # This program is distributed in the hope that it will be useful, | ||
100 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
101 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
102 | 16 | # GNU General Public License for more details. | ||
103 | 17 | # | ||
104 | 18 | # You should have received a copy of the GNU General Public License | ||
105 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
106 | 20 | # | ||
107 | 21 | ############################################################################## | ||
108 | 22 | |||
109 | 23 | from osv import fields, osv | ||
110 | 24 | from tools import config | ||
111 | 25 | import time | ||
112 | 26 | from mx import DateTime | ||
113 | 27 | |||
114 | 28 | class account_payment_term(osv.osv): | ||
115 | 29 | _name = "account.payment.term" | ||
116 | 30 | _inherit = "account.payment.term" | ||
117 | 31 | _columns = { | ||
118 | 32 | 'cash_discount_ids': fields.one2many('account.cash.discount', 'payment_id', 'Cash Discounts'), | ||
119 | 33 | } | ||
120 | 34 | account_payment_term() | ||
121 | 35 | |||
122 | 36 | class account_cash_discount(osv.osv): | ||
123 | 37 | _name = "account.cash.discount" | ||
124 | 38 | _description = "Cash Discount" #A reduction in the price if payment is made within a stipulated period. | ||
125 | 39 | _columns = { | ||
126 | 40 | 'name': fields.char('Name', size=32), | ||
127 | 41 | 'delay': fields.integer('Number of Days', required=True), | ||
128 | 42 | 'discount': fields.float('Discount (%)', digits=(16,6),required=True), | ||
129 | 43 | 'payment_id': fields.many2one('account.payment.term','Associated Payment Term'), | ||
130 | 44 | 'credit_account_id': fields.many2one('account.account', 'Credit Account'), | ||
131 | 45 | 'debit_account_id': fields.many2one('account.account', 'Debit Account'), | ||
132 | 46 | } | ||
133 | 47 | account_cash_discount() | ||
134 | 48 | |||
135 | 49 | class account_invoice(osv.osv): | ||
136 | 50 | _inherit = "account.invoice" | ||
137 | 51 | |||
138 | 52 | def _get_payment(self, cr, uid, ids, resudial_amonut, payment_term, context=None): | ||
139 | 53 | |||
140 | 54 | #This function used to count the discount payment term | ||
141 | 55 | if context is None: | ||
142 | 56 | context = {} | ||
143 | 57 | |||
144 | 58 | tax_obj = self.pool.get('account.tax') | ||
145 | 59 | invoice = self.browse(cr, uid, ids[0], context=context) | ||
146 | 60 | |||
147 | 61 | if invoice.date_due: | ||
148 | 62 | date1 = invoice.date_due | ||
149 | 63 | else: | ||
150 | 64 | date1 = time.strftime('%Y-%m-%d') | ||
151 | 65 | |||
152 | 66 | if 'date_p' in context and context['date_p']: | ||
153 | 67 | date2 = context['date_p'] | ||
154 | 68 | else: | ||
155 | 69 | date2 = time.strftime('%Y-%m-%d') | ||
156 | 70 | |||
157 | 71 | from_dt = time.mktime(time.strptime(date1,'%Y-%m-%d')) | ||
158 | 72 | to_dt = time.mktime(time.strptime(date2,'%Y-%m-%d')) | ||
159 | 73 | diff_day = (from_dt-to_dt)/(3600*24) | ||
160 | 74 | if payment_term: | ||
161 | 75 | pt = self.pool.get('account.payment.term').browse(cr, uid, payment_term, context=context) | ||
162 | 76 | if pt.cash_discount_ids: | ||
163 | 77 | res = 0.0 | ||
164 | 78 | for d in pt.cash_discount_ids: | ||
165 | 79 | if diff_day == d.delay or diff_day < d.delay: | ||
166 | 80 | if resudial_amonut: | ||
167 | 81 | res = resudial_amonut * d.discount | ||
168 | 82 | ted = 0.0 | ||
169 | 83 | for line in invoice.invoice_line: | ||
170 | 84 | if line.invoice_line_tax_id: | ||
171 | 85 | tt = tax_obj.compute_inv(cr, uid, line.invoice_line_tax_id, res, line.quantity) | ||
172 | 86 | for tex in tt: | ||
173 | 87 | rr = 0.0 | ||
174 | 88 | rr += tex['amount'] | ||
175 | 89 | ted +=rr | ||
176 | 90 | discunt = res + ted | ||
177 | 91 | return discunt | ||
178 | 92 | |||
179 | 93 | def pay_and_reconcile(self, cr, uid, ids, pay_amount, pay_account_id, period_id, pay_journal_id, writeoff_acc_id, writeoff_period_id, writeoff_journal_id, context=None, name=''): | ||
180 | 94 | |||
181 | 95 | if context is None: | ||
182 | 96 | context = {} | ||
183 | 97 | #TODO check if we can use different period for payment and the writeoff line | ||
184 | 98 | assert len(ids)==1, "Can only pay one invoice at a time" | ||
185 | 99 | invoice = self.browse(cr, uid, ids[0]) | ||
186 | 100 | |||
187 | 101 | if 'amount_currency' in context and context['amount_currency']: | ||
188 | 102 | amount_currency = context['amount_currency'] | ||
189 | 103 | else: | ||
190 | 104 | amount_currency = invoice.residual | ||
191 | 105 | |||
192 | 106 | if invoice.payment_term: | ||
193 | 107 | # Return the discount on for the payment term | ||
194 | 108 | discunt1 = self._get_payment(cr, uid, ids, amount_currency, invoice.payment_term.id, context=context) | ||
195 | 109 | |||
196 | 110 | src_account_id = invoice.account_id.id | ||
197 | 111 | # Take the seq as name for move | ||
198 | 112 | types = {'out_invoice': -1, 'in_invoice': 1, 'out_refund': 1, 'in_refund': -1} | ||
199 | 113 | direction = types[invoice.type] | ||
200 | 114 | #take the choosen date | ||
201 | 115 | if 'date_p' in context and context['date_p']: | ||
202 | 116 | date=context['date_p'] | ||
203 | 117 | else: | ||
204 | 118 | date=time.strftime('%Y-%m-%d') | ||
205 | 119 | |||
206 | 120 | # Take the amount in currency and the currency of the payment | ||
207 | 121 | if 'amount_currency' in context and context['amount_currency'] and 'currency_id' in context and context['currency_id']: | ||
208 | 122 | amount_currency = context['amount_currency'] | ||
209 | 123 | currency_id = context['currency_id'] | ||
210 | 124 | else: | ||
211 | 125 | amount_currency = False | ||
212 | 126 | currency_id = False | ||
213 | 127 | |||
214 | 128 | if invoice.type in ('in_invoice', 'in_refund'): | ||
215 | 129 | ref = invoice.reference | ||
216 | 130 | else: | ||
217 | 131 | ref = self._convert_ref(cr, uid, invoice.number) | ||
218 | 132 | # Pay attention to the sign for both debit/credit AND amount_currency | ||
219 | 133 | l1 = { | ||
220 | 134 | 'debit': direction * (pay_amount)>0 and direction * (pay_amount), | ||
221 | 135 | 'credit': direction * (pay_amount)<0 and - direction * (pay_amount), | ||
222 | 136 | 'account_id': src_account_id, | ||
223 | 137 | 'partner_id': invoice.partner_id.id, | ||
224 | 138 | 'ref':ref, | ||
225 | 139 | 'date': date, | ||
226 | 140 | 'currency_id':currency_id, | ||
227 | 141 | 'amount_currency':amount_currency and direction * amount_currency or 0.0, | ||
228 | 142 | } | ||
229 | 143 | l2 = { | ||
230 | 144 | 'debit': direction * (pay_amount-discunt1)<0 and - direction * (pay_amount-discunt1), | ||
231 | 145 | 'credit': direction * (pay_amount-discunt1)>0 and direction * (pay_amount-discunt1), | ||
232 | 146 | 'account_id': pay_account_id, | ||
233 | 147 | 'partner_id': invoice.partner_id.id, | ||
234 | 148 | 'ref':ref, | ||
235 | 149 | 'date': date, | ||
236 | 150 | 'currency_id':currency_id, | ||
237 | 151 | 'amount_currency':amount_currency and - direction * amount_currency or 0.0, | ||
238 | 152 | } | ||
239 | 153 | l3 = { | ||
240 | 154 | 'debit': direction * discunt1<0 and - direction * discunt1, | ||
241 | 155 | 'credit': direction * discunt1>0 and direction * discunt1, | ||
242 | 156 | 'account_id': context['account_id'], | ||
243 | 157 | 'partner_id': invoice.partner_id.id, | ||
244 | 158 | 'ref':ref, | ||
245 | 159 | 'date': date, | ||
246 | 160 | 'currency_id':currency_id, | ||
247 | 161 | 'amount_currency':amount_currency and direction * amount_currency or 0.0, | ||
248 | 162 | } | ||
249 | 163 | |||
250 | 164 | if not name: | ||
251 | 165 | name = invoice.invoice_line and invoice.invoice_line[0].name or invoice.number | ||
252 | 166 | l1['name'] = name | ||
253 | 167 | l2['name'] = name | ||
254 | 168 | l3['name'] = name | ||
255 | 169 | lines = [(0, 0, l1), (0, 0, l2), (0, 0, l3)] | ||
256 | 170 | |||
257 | 171 | move = {'ref': ref, 'line_id': lines, 'journal_id': pay_journal_id, 'period_id': period_id, 'date': date} | ||
258 | 172 | move_id = self.pool.get('account.move').create(cr, uid, move, context=context) | ||
259 | 173 | |||
260 | 174 | line_ids = [] | ||
261 | 175 | total = 0.0 | ||
262 | 176 | line = self.pool.get('account.move.line') | ||
263 | 177 | cr.execute('select id from account_move_line where move_id in ('+str(move_id)+','+str(invoice.move_id.id)+')') | ||
264 | 178 | lines = line.browse(cr, uid, map(lambda x: x[0], cr.fetchall()) ) | ||
265 | 179 | for l in lines+invoice.payment_ids: | ||
266 | 180 | if l.account_id.id==src_account_id: | ||
267 | 181 | line_ids.append(l.id) | ||
268 | 182 | total += (l.debit or 0.0) - (l.credit or 0.0) | ||
269 | 183 | if (not round(total,int(config['price_accuracy']))) or writeoff_acc_id: | ||
270 | 184 | self.pool.get('account.move.line').reconcile(cr, uid, line_ids, 'manual', writeoff_acc_id, writeoff_period_id, writeoff_journal_id, context) | ||
271 | 185 | else: | ||
272 | 186 | self.pool.get('account.move.line').reconcile_partial(cr, uid, line_ids, 'manual', context) | ||
273 | 187 | |||
274 | 188 | # Update the stored value (fields.function), so we write to trigger recompute | ||
275 | 189 | self.pool.get('account.invoice').write(cr, uid, ids, {}, context=context) | ||
276 | 190 | return True | ||
277 | 191 | |||
278 | 192 | account_invoice() | ||
279 | 193 | |||
280 | 194 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
281 | 195 | |||
282 | 0 | 196 | ||
283 | === added file 'account_invoice_cash_discount/account_invoice_cash_discount_view.xml' | |||
284 | --- account_invoice_cash_discount/account_invoice_cash_discount_view.xml 1970-01-01 00:00:00 +0000 | |||
285 | +++ account_invoice_cash_discount/account_invoice_cash_discount_view.xml 2010-05-28 07:36:36 +0000 | |||
286 | @@ -0,0 +1,47 @@ | |||
287 | 1 | <?xml version="1.0"?> | ||
288 | 2 | <openerp> | ||
289 | 3 | <data> | ||
290 | 4 | |||
291 | 5 | <!-- cash discount --> | ||
292 | 6 | |||
293 | 7 | |||
294 | 8 | <record model="ir.ui.view" id="view_cash_discount_form"> | ||
295 | 9 | <field name="name">account.cash.discount.form</field> | ||
296 | 10 | <field name="model">account.cash.discount</field> | ||
297 | 11 | <field name="type">form</field> | ||
298 | 12 | <field name="arch" type="xml"> | ||
299 | 13 | <form string="Cash Discount"> | ||
300 | 14 | <field name="name" select="1"/> | ||
301 | 15 | <field name="delay" select="1"/> | ||
302 | 16 | <field name="discount" select="1"/> | ||
303 | 17 | </form> | ||
304 | 18 | </field> | ||
305 | 19 | </record> | ||
306 | 20 | |||
307 | 21 | <record model="ir.ui.view" id="view_cash_discount_tree"> | ||
308 | 22 | <field name="name">account.cash.discount.tree</field> | ||
309 | 23 | <field name="model">account.cash.discount</field> | ||
310 | 24 | <field name="type">tree</field> | ||
311 | 25 | <field name="arch" type="xml"> | ||
312 | 26 | <tree string="Cash Discount" editable="bottom"> | ||
313 | 27 | <field name="name" select="1"/> | ||
314 | 28 | <field name="delay" select="1"/> | ||
315 | 29 | <field name="discount" select="1"/> | ||
316 | 30 | </tree> | ||
317 | 31 | </field> | ||
318 | 32 | </record> | ||
319 | 33 | |||
320 | 34 | <record model="ir.ui.view" id="view_payment_term_form"> | ||
321 | 35 | <field name="name">account.payment.term.form</field> | ||
322 | 36 | <field name="model">account.payment.term</field> | ||
323 | 37 | <field name="inherit_id" ref="account.view_payment_term_form"/> | ||
324 | 38 | <field name="arch" type="xml"> | ||
325 | 39 | <field name="line_ids" position="after"> | ||
326 | 40 | <separator string="Cash Discount" colspan="4"/> | ||
327 | 41 | <field name="cash_discount_ids" colspan="4"/> | ||
328 | 42 | </field> | ||
329 | 43 | </field> | ||
330 | 44 | </record> | ||
331 | 45 | |||
332 | 46 | </data> | ||
333 | 47 | </openerp> | ||
334 | 0 | 48 | ||
335 | === added file 'account_invoice_cash_discount/account_wizard.xml' | |||
336 | --- account_invoice_cash_discount/account_wizard.xml 1970-01-01 00:00:00 +0000 | |||
337 | +++ account_invoice_cash_discount/account_wizard.xml 2010-05-28 07:36:36 +0000 | |||
338 | @@ -0,0 +1,6 @@ | |||
339 | 1 | <?xml version="1.0" encoding="utf-8"?> | ||
340 | 2 | <openerp> | ||
341 | 3 | <data> | ||
342 | 4 | <wizard id="wizard_invoice_pay" model="account.invoice" name="account.invoice.pay1" string="Pay invoice" groups="base.group_user"/> | ||
343 | 5 | </data> | ||
344 | 6 | </openerp> | ||
345 | 0 | 7 | ||
346 | === added directory 'account_invoice_cash_discount/wizard' | |||
347 | === added file 'account_invoice_cash_discount/wizard/__init__.py' | |||
348 | --- account_invoice_cash_discount/wizard/__init__.py 1970-01-01 00:00:00 +0000 | |||
349 | +++ account_invoice_cash_discount/wizard/__init__.py 2010-05-28 07:36:36 +0000 | |||
350 | @@ -0,0 +1,26 @@ | |||
351 | 1 | # -*- encoding: utf-8 -*- | ||
352 | 2 | ############################################################################## | ||
353 | 3 | # | ||
354 | 4 | # OpenERP, Open Source Management Solution | ||
355 | 5 | # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved | ||
356 | 6 | # $Id$ | ||
357 | 7 | # | ||
358 | 8 | # This program is free software: you can redistribute it and/or modify | ||
359 | 9 | # it under the terms of the GNU General Public License as published by | ||
360 | 10 | # the Free Software Foundation, either version 3 of the License, or | ||
361 | 11 | # (at your option) any later version. | ||
362 | 12 | # | ||
363 | 13 | # This program is distributed in the hope that it will be useful, | ||
364 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
365 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
366 | 16 | # GNU General Public License for more details. | ||
367 | 17 | # | ||
368 | 18 | # You should have received a copy of the GNU General Public License | ||
369 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
370 | 20 | # | ||
371 | 21 | ############################################################################## | ||
372 | 22 | |||
373 | 23 | import wizard_pay_invoice | ||
374 | 24 | |||
375 | 25 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
376 | 26 | |||
377 | 0 | 27 | ||
378 | === added file 'account_invoice_cash_discount/wizard/wizard_pay_invoice.py' | |||
379 | --- account_invoice_cash_discount/wizard/wizard_pay_invoice.py 1970-01-01 00:00:00 +0000 | |||
380 | +++ account_invoice_cash_discount/wizard/wizard_pay_invoice.py 2010-05-28 07:36:36 +0000 | |||
381 | @@ -0,0 +1,203 @@ | |||
382 | 1 | # -*- encoding: utf-8 -*- | ||
383 | 2 | ############################################################################## | ||
384 | 3 | # | ||
385 | 4 | # OpenERP, Open Source Management Solution | ||
386 | 5 | # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved | ||
387 | 6 | # $Id$ | ||
388 | 7 | # | ||
389 | 8 | # This program is free software: you can redistribute it and/or modify | ||
390 | 9 | # it under the terms of the GNU General Public License as published by | ||
391 | 10 | # the Free Software Foundation, either version 3 of the License, or | ||
392 | 11 | # (at your option) any later version. | ||
393 | 12 | # | ||
394 | 13 | # This program is distributed in the hope that it will be useful, | ||
395 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
396 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
397 | 16 | # GNU General Public License for more details. | ||
398 | 17 | # | ||
399 | 18 | # You should have received a copy of the GNU General Public License | ||
400 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
401 | 20 | # | ||
402 | 21 | ############################################################################## | ||
403 | 22 | |||
404 | 23 | import wizard | ||
405 | 24 | import pooler | ||
406 | 25 | import time | ||
407 | 26 | from tools.translate import _ | ||
408 | 27 | import tools | ||
409 | 28 | |||
410 | 29 | pay_form = '''<?xml version="1.0"?> | ||
411 | 30 | <form string="Pay invoice"> | ||
412 | 31 | <field name="amount"/> | ||
413 | 32 | <newline/> | ||
414 | 33 | <field name="name"/> | ||
415 | 34 | <field name="date"/> | ||
416 | 35 | <field name="journal_id"/> | ||
417 | 36 | <field name="period_id"/> | ||
418 | 37 | <field name="cash_amount"/> | ||
419 | 38 | <field name="account_id"/> | ||
420 | 39 | </form>''' | ||
421 | 40 | |||
422 | 41 | pay_fields = { | ||
423 | 42 | 'amount': {'string': 'Amount paid', 'type':'float', 'required':True, 'digits': (16,int(tools.config['price_accuracy']))}, | ||
424 | 43 | 'name': {'string': 'Entry Name', 'type':'char', 'size': 64, 'required':True}, | ||
425 | 44 | 'cash_amount': {'string': 'Cash Discount Amount', 'type':'float', 'required':True, 'digits': (16,int(tools.config['price_accuracy']))}, | ||
426 | 45 | 'account_id': {'string': 'Account For Discount', 'type': 'many2one', 'relation':'account.account', 'required':True}, | ||
427 | 46 | 'date': {'string': 'Payment date', 'type':'date', 'required':True, 'default':lambda *args: time.strftime('%Y-%m-%d')}, | ||
428 | 47 | 'journal_id': {'string': 'Journal/Payment Mode', 'type': 'many2one', 'relation':'account.journal', 'required':True, 'domain':[('type','=','cash')]}, | ||
429 | 48 | 'period_id': {'string': 'Period', 'type': 'many2one', 'relation':'account.period', 'required':True}, | ||
430 | 49 | } | ||
431 | 50 | |||
432 | 51 | def _pay_and_reconcile(self, cr, uid, data, context): | ||
433 | 52 | form = data['form'] | ||
434 | 53 | period_id = form.get('period_id', False) | ||
435 | 54 | journal_id = form.get('journal_id', False) | ||
436 | 55 | writeoff_account_id = form.get('writeoff_acc_id', False) | ||
437 | 56 | writeoff_journal_id = form.get('writeoff_journal_id', False) | ||
438 | 57 | pool = pooler.get_pool(cr.dbname) | ||
439 | 58 | cur_obj = pool.get('res.currency') | ||
440 | 59 | amount = form['amount'] | ||
441 | 60 | context['analytic_id'] = form.get('analytic_id', False) | ||
442 | 61 | |||
443 | 62 | invoice = pool.get('account.invoice').browse(cr, uid, data['id'], context) | ||
444 | 63 | journal = pool.get('account.journal').browse(cr, uid, data['form']['journal_id'], context) | ||
445 | 64 | # Compute the amount in company's currency, with the journal currency (which is equal to payment currency) | ||
446 | 65 | # when it is needed : If payment currency (according to selected journal.currency) is <> from company currency | ||
447 | 66 | if journal.currency and invoice.company_id.currency_id.id<>journal.currency.id: | ||
448 | 67 | ctx = {'date':data['form']['date']} | ||
449 | 68 | amount = cur_obj.compute(cr, uid, journal.currency.id, invoice.company_id.currency_id.id, amount, context=ctx) | ||
450 | 69 | currency_id = journal.currency.id | ||
451 | 70 | # Put the paid amount in currency, and the currency, in the context if currency is different from company's currency | ||
452 | 71 | context.update({'amount_currency':form['amount'],'currency_id':currency_id}) | ||
453 | 72 | |||
454 | 73 | if invoice.company_id.currency_id.id<>invoice.currency_id.id: | ||
455 | 74 | ctx = {'date':data['form']['date']} | ||
456 | 75 | amount = cur_obj.compute(cr, uid, invoice.currency_id.id, invoice.company_id.currency_id.id, amount, context=ctx) | ||
457 | 76 | currency_id = invoice.currency_id.id | ||
458 | 77 | # Put the paid amount in currency, and the currency, in the context if currency is different from company's currency | ||
459 | 78 | context.update({'amount_currency':form['amount'],'currency_id':currency_id}) | ||
460 | 79 | |||
461 | 80 | # Take the choosen date | ||
462 | 81 | if form.has_key('comment'): | ||
463 | 82 | context.update({'date_p':form['date'],'comment':form['comment']}) | ||
464 | 83 | else: | ||
465 | 84 | context.update({'date_p':form['date'],'comment':False}) | ||
466 | 85 | |||
467 | 86 | context.update({'account_id':form['account_id'],'cash_amount':form['cash_amount'],'amount_currency':form['amount']}) | ||
468 | 87 | |||
469 | 88 | acc_id = journal.default_credit_account_id and journal.default_credit_account_id.id | ||
470 | 89 | if not acc_id: | ||
471 | 90 | raise wizard.except_wizard(_('Error !'), _('Your journal must have a default credit and debit account.')) | ||
472 | 91 | pool.get('account.invoice').pay_and_reconcile(cr, uid, [data['id']], | ||
473 | 92 | amount, acc_id, period_id, journal_id, writeoff_account_id, | ||
474 | 93 | period_id, writeoff_journal_id, context, data['form']['name']) | ||
475 | 94 | return {} | ||
476 | 95 | |||
477 | 96 | def _wo_check(self, cr, uid, data, context): | ||
478 | 97 | pool = pooler.get_pool(cr.dbname) | ||
479 | 98 | invoice = pool.get('account.invoice').browse(cr, uid, data['id'], context) | ||
480 | 99 | journal = pool.get('account.journal').browse(cr, uid, data['form']['journal_id'], context) | ||
481 | 100 | cur_obj = pool.get('res.currency') | ||
482 | 101 | # Here we need that: | ||
483 | 102 | # The invoice total amount in company's currency <> paid amount in company currency | ||
484 | 103 | # (according to the correct day rate, invoicing rate and payment rate are may be different) | ||
485 | 104 | # => Ask to a write-off of the difference. This could happen even if both amount are equal, | ||
486 | 105 | # because if the currency rate | ||
487 | 106 | # Get the amount in company currency for the invoice (according to move lines) | ||
488 | 107 | inv_amount_company_currency = 0 | ||
489 | 108 | for aml in invoice.move_id.line_id: | ||
490 | 109 | if aml.account_id.id == invoice.account_id.id or aml.account_id.type in ('receivable', 'payable'): | ||
491 | 110 | inv_amount_company_currency += aml.debit | ||
492 | 111 | inv_amount_company_currency -= aml.credit | ||
493 | 112 | inv_amount_company_currency = abs(inv_amount_company_currency) | ||
494 | 113 | |||
495 | 114 | # Get the current amount paid in company currency | ||
496 | 115 | if journal.currency and invoice.company_id.currency_id.id<>journal.currency.id: | ||
497 | 116 | ctx = {'date':data['form']['date']} | ||
498 | 117 | amount_paid = cur_obj.compute(cr, uid, journal.currency.id, invoice.company_id.currency_id.id, data['form']['amount'], round=True, context=ctx) | ||
499 | 118 | else: | ||
500 | 119 | amount_paid = data['form']['amount'] | ||
501 | 120 | # Get the old payment if there are some | ||
502 | 121 | if invoice.payment_ids: | ||
503 | 122 | debit=credit=0.0 | ||
504 | 123 | for payment in invoice.payment_ids: | ||
505 | 124 | debit+=payment.debit | ||
506 | 125 | credit+=payment.credit | ||
507 | 126 | amount_paid+=abs(debit-credit) | ||
508 | 127 | |||
509 | 128 | # Test if there is a difference according to currency rouding setting | ||
510 | 129 | if pool.get('res.currency').is_zero(cr, uid, invoice.company_id.currency_id, | ||
511 | 130 | (amount_paid - inv_amount_company_currency)): | ||
512 | 131 | return 'reconcile' | ||
513 | 132 | return 'addendum' | ||
514 | 133 | |||
515 | 134 | _transaction_add_form = '''<?xml version="1.0"?> | ||
516 | 135 | <form string="Information addendum"> | ||
517 | 136 | <separator string="Write-Off Move" colspan="4"/> | ||
518 | 137 | <field name="writeoff_journal_id"/> | ||
519 | 138 | <field name="writeoff_acc_id" domain="[('type','<>','view'),('type','<>','consolidation')]"/> | ||
520 | 139 | <field name="comment"/> | ||
521 | 140 | <separator string="Analytic" colspan="4"/> | ||
522 | 141 | <field name="analytic_id"/> | ||
523 | 142 | </form>''' | ||
524 | 143 | |||
525 | 144 | _transaction_add_fields = { | ||
526 | 145 | 'writeoff_acc_id': {'string':'Write-Off account', 'type':'many2one', 'relation':'account.account', 'required':True}, | ||
527 | 146 | 'writeoff_journal_id': {'string': 'Write-Off journal', 'type': 'many2one', 'relation':'account.journal', 'required':True}, | ||
528 | 147 | 'comment': {'string': 'Comment', 'type':'char', 'size': 64 , 'required':True}, | ||
529 | 148 | 'analytic_id': {'string':'Analytic Account', 'type': 'many2one', 'relation':'account.analytic.account'}, | ||
530 | 149 | } | ||
531 | 150 | |||
532 | 151 | def _get_value_addendum(self, cr, uid, data, context={}): | ||
533 | 152 | return {'comment': _('Write-Off')} | ||
534 | 153 | |||
535 | 154 | def _compute(self, cr, uid, data, context={}): | ||
536 | 155 | pool = pooler.get_pool(cr.dbname) | ||
537 | 156 | invoice = pool.get('account.invoice').browse(cr, uid, data['id'], context) | ||
538 | 157 | |||
539 | 158 | |||
540 | 159 | def _get_period(self, cr, uid, data, context={}): | ||
541 | 160 | pool = pooler.get_pool(cr.dbname) | ||
542 | 161 | ids = pool.get('account.period').find(cr, uid, context=context) | ||
543 | 162 | period_id = False | ||
544 | 163 | if len(ids): | ||
545 | 164 | period_id = ids[0] | ||
546 | 165 | invoice = pool.get('account.invoice').browse(cr, uid, data['id'], context) | ||
547 | 166 | cash_amount = pool.get('account.invoice')._get_payment(cr, uid, [data['id']], invoice.residual, invoice.payment_term.id, context=context) | ||
548 | 167 | if invoice.state in ['draft', 'proforma2', 'cancel']: | ||
549 | 168 | raise wizard.except_wizard(_('Error !'), _('Can not pay draft/proforma/cancel invoice.')) | ||
550 | 169 | return { | ||
551 | 170 | 'period_id': period_id, | ||
552 | 171 | 'amount': invoice.residual, | ||
553 | 172 | 'date': time.strftime('%Y-%m-%d'), | ||
554 | 173 | 'cash_amount': cash_amount, | ||
555 | 174 | } | ||
556 | 175 | |||
557 | 176 | class wizard_pay_invoice(wizard.interface): | ||
558 | 177 | states = { | ||
559 | 178 | 'init': { | ||
560 | 179 | 'actions': [_get_period], | ||
561 | 180 | 'result': {'type':'form', 'arch':pay_form, 'fields':pay_fields, 'state':[('end','Cancel'),('reconcile','Partial Payment'),('writeoff_check','Full Payment')]} | ||
562 | 181 | }, | ||
563 | 182 | 'writeoff_check': { | ||
564 | 183 | 'actions': [], | ||
565 | 184 | 'result' : {'type': 'choice', 'next_state': _wo_check } | ||
566 | 185 | }, | ||
567 | 186 | 'addendum': { | ||
568 | 187 | 'actions': [_get_value_addendum], | ||
569 | 188 | 'result': {'type': 'form', 'arch':_transaction_add_form, 'fields':_transaction_add_fields, 'state':[('end','Cancel'),('reconcile','Pay and reconcile')]} | ||
570 | 189 | }, | ||
571 | 190 | 'reconcile': { | ||
572 | 191 | 'actions': [_pay_and_reconcile], | ||
573 | 192 | 'result': {'type':'state', 'state':'end'} | ||
574 | 193 | }, | ||
575 | 194 | 'compute_dis': { | ||
576 | 195 | 'actions': [_compute], | ||
577 | 196 | 'result': {'type':'state', 'state':'end'} | ||
578 | 197 | } | ||
579 | 198 | } | ||
580 | 199 | wizard_pay_invoice('account.invoice.pay1') | ||
581 | 200 | |||
582 | 201 | |||
583 | 202 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
584 | 203 | |||
585 | 0 | 204 | ||
586 | === added directory 'sales_shop_stock_availability' | |||
587 | === added file 'sales_shop_stock_availability/__init__.py' | |||
588 | --- sales_shop_stock_availability/__init__.py 1970-01-01 00:00:00 +0000 | |||
589 | +++ sales_shop_stock_availability/__init__.py 2010-05-28 07:36:36 +0000 | |||
590 | @@ -0,0 +1,26 @@ | |||
591 | 1 | # -*- encoding: utf-8 -*- | ||
592 | 2 | ############################################################################## | ||
593 | 3 | # | ||
594 | 4 | # OpenERP, Open Source Management Solution | ||
595 | 5 | # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved | ||
596 | 6 | # $Id$ | ||
597 | 7 | # | ||
598 | 8 | # This program is free software: you can redistribute it and/or modify | ||
599 | 9 | # it under the terms of the GNU General Public License as published by | ||
600 | 10 | # the Free Software Foundation, either version 3 of the License, or | ||
601 | 11 | # (at your option) any later version. | ||
602 | 12 | # | ||
603 | 13 | # This program is distributed in the hope that it will be useful, | ||
604 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
605 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
606 | 16 | # GNU General Public License for more details. | ||
607 | 17 | # | ||
608 | 18 | # You should have received a copy of the GNU General Public License | ||
609 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
610 | 20 | # | ||
611 | 21 | ############################################################################## | ||
612 | 22 | |||
613 | 23 | import sales_shop_stock_availability | ||
614 | 24 | |||
615 | 25 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
616 | 26 | |||
617 | 0 | 27 | ||
618 | === added file 'sales_shop_stock_availability/__terp__.py' | |||
619 | --- sales_shop_stock_availability/__terp__.py 1970-01-01 00:00:00 +0000 | |||
620 | +++ sales_shop_stock_availability/__terp__.py 2010-05-28 07:36:36 +0000 | |||
621 | @@ -0,0 +1,38 @@ | |||
622 | 1 | # -*- encoding: utf-8 -*- | ||
623 | 2 | ############################################################################## | ||
624 | 3 | # | ||
625 | 4 | # OpenERP, Open Source Management Solution | ||
626 | 5 | # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved | ||
627 | 6 | # $Id$ | ||
628 | 7 | # | ||
629 | 8 | # This program is free software: you can redistribute it and/or modify | ||
630 | 9 | # it under the terms of the GNU General Public License as published by | ||
631 | 10 | # the Free Software Foundation, either version 3 of the License, or | ||
632 | 11 | # (at your option) any later version. | ||
633 | 12 | # | ||
634 | 13 | # This program is distributed in the hope that it will be useful, | ||
635 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
636 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
637 | 16 | # GNU General Public License for more details. | ||
638 | 17 | # | ||
639 | 18 | # You should have received a copy of the GNU General Public License | ||
640 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
641 | 20 | # | ||
642 | 21 | ############################################################################## | ||
643 | 22 | { | ||
644 | 23 | "name": "Sale Shop Stock Availability", | ||
645 | 24 | "version": "1.0", | ||
646 | 25 | "author": "Big Consulting", | ||
647 | 26 | "website" : "", | ||
648 | 27 | "category": "", | ||
649 | 28 | "description": """ | ||
650 | 29 | """, | ||
651 | 30 | "depends": ['base','sale'], | ||
652 | 31 | "demo_xml": [], | ||
653 | 32 | "update_xml": ['sales_shop_stock_availability_view.xml'], | ||
654 | 33 | "license": "GPL-3", | ||
655 | 34 | "active": False, | ||
656 | 35 | "installable": True, | ||
657 | 36 | } | ||
658 | 37 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
659 | 38 | |||
660 | 0 | 39 | ||
661 | === added file 'sales_shop_stock_availability/sales_shop_stock_availability.py' | |||
662 | --- sales_shop_stock_availability/sales_shop_stock_availability.py 1970-01-01 00:00:00 +0000 | |||
663 | +++ sales_shop_stock_availability/sales_shop_stock_availability.py 2010-05-28 07:36:36 +0000 | |||
664 | @@ -0,0 +1,52 @@ | |||
665 | 1 | # -*- encoding: utf-8 -*- | ||
666 | 2 | ############################################################################## | ||
667 | 3 | # | ||
668 | 4 | # OpenERP, Open Source Management Solution | ||
669 | 5 | # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved | ||
670 | 6 | # $Id$ | ||
671 | 7 | # | ||
672 | 8 | # This program is free software: you can redistribute it and/or modify | ||
673 | 9 | # it under the terms of the GNU General Public License as published by | ||
674 | 10 | # the Free Software Foundation, either version 3 of the License, or | ||
675 | 11 | # (at your option) any later version. | ||
676 | 12 | # | ||
677 | 13 | # This program is distributed in the hope that it will be useful, | ||
678 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
679 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
680 | 16 | # GNU General Public License for more details. | ||
681 | 17 | # | ||
682 | 18 | # You should have received a copy of the GNU General Public License | ||
683 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
684 | 20 | # | ||
685 | 21 | ############################################################################## | ||
686 | 22 | |||
687 | 23 | from osv import fields, osv | ||
688 | 24 | from tools import config | ||
689 | 25 | |||
690 | 26 | class product_product(osv.osv): | ||
691 | 27 | _inherit = "product.product" | ||
692 | 28 | |||
693 | 29 | def _product_available_other_shop(self, cr, uid, ids, name, arg, context={}): | ||
694 | 30 | |||
695 | 31 | res = {} | ||
696 | 32 | product_obj = self.pool.get('product.product') | ||
697 | 33 | shop = context.get('shop', False) | ||
698 | 34 | fields_name = ['qty_available'] | ||
699 | 35 | |||
700 | 36 | stock2 = product_obj._product_available(cr, uid, ids ,fields_name,context={}) | ||
701 | 37 | |||
702 | 38 | context.update({'shop':shop}) | ||
703 | 39 | stock1 = product_obj._product_available(cr, uid, ids ,fields_name,context=context) | ||
704 | 40 | |||
705 | 41 | for key,value in stock2.items(): | ||
706 | 42 | diff = stock2[key]['qty_available'] - stock1[key]['qty_available'] | ||
707 | 43 | res[key] = diff | ||
708 | 44 | return res | ||
709 | 45 | |||
710 | 46 | _columns = { | ||
711 | 47 | 'qty_available_other_shop': fields.function(_product_available_other_shop, method=True, type='float', string='Stock Other Shops', help="Current quantities of products in other stock location except selected shop in sale order."), | ||
712 | 48 | } | ||
713 | 49 | |||
714 | 50 | product_product() | ||
715 | 51 | |||
716 | 52 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
717 | 0 | 53 | ||
718 | === added file 'sales_shop_stock_availability/sales_shop_stock_availability_view.xml' | |||
719 | --- sales_shop_stock_availability/sales_shop_stock_availability_view.xml 1970-01-01 00:00:00 +0000 | |||
720 | +++ sales_shop_stock_availability/sales_shop_stock_availability_view.xml 2010-05-28 07:36:36 +0000 | |||
721 | @@ -0,0 +1,43 @@ | |||
722 | 1 | <?xml version="1.0" ?> | ||
723 | 2 | <openerp> | ||
724 | 3 | <data> | ||
725 | 4 | |||
726 | 5 | <record id="product_stock_tree_view1" model="ir.ui.view"> | ||
727 | 6 | <field name="name">stock.product.tree</field> | ||
728 | 7 | <field name="model">product.product</field> | ||
729 | 8 | <field name="type">tree</field> | ||
730 | 9 | <field eval="7" name="priority"/> | ||
731 | 10 | <field name="arch" type="xml"> | ||
732 | 11 | <tree colors="red:virtual_available<0;blue:state in ['draft', 'end', 'obsolete']" string="Products"> | ||
733 | 12 | <field name="default_code"/> | ||
734 | 13 | <field name="name"/> | ||
735 | 14 | <field name="variants"/> | ||
736 | 15 | <field name="uom_id"/> | ||
737 | 16 | <field name="qty_available"/> | ||
738 | 17 | <field name="virtual_available"/> | ||
739 | 18 | <field name="qty_available_other_shop"/> | ||
740 | 19 | <field invisible="'partner_id' not in context" name="price"/> | ||
741 | 20 | <field name="lst_price"/> | ||
742 | 21 | <field name="standard_price"/> | ||
743 | 22 | <field name="state"/> | ||
744 | 23 | </tree> | ||
745 | 24 | </field> | ||
746 | 25 | </record> | ||
747 | 26 | |||
748 | 27 | <record id="product_shop_stock_view1" model="ir.ui.view"> | ||
749 | 28 | <field name="name">sale.order.form</field> | ||
750 | 29 | <field name="model">sale.order</field> | ||
751 | 30 | <field name="type">form</field> | ||
752 | 31 | <field name="inherit_id" ref="sale.view_order_form"/> | ||
753 | 32 | <field name="arch" type="xml"> | ||
754 | 33 | <xpath expr="//field[@name='product_id']" position="replace"> | ||
755 | 34 | <field colspan="4" | ||
756 | 35 | context="partner_id=parent.partner_id,quantity=product_uom_qty,pricelist=parent.pricelist_id,shop=parent.shop_id,uom=product_uom,tree_view_ref='sales_shop_stock_availability.product_stock_tree_view1'" | ||
757 | 36 | name="product_id" | ||
758 | 37 | on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], True, parent.date_order, product_packaging, parent.fiscal_position)" | ||
759 | 38 | select="1"/> | ||
760 | 39 | </xpath> | ||
761 | 40 | </field> | ||
762 | 41 | </record> | ||
763 | 42 | </data> | ||
764 | 43 | </openerp> |