Merge lp:~vauxoo/openerp-mexico-localization/7.0-test_facturae-dev-moylop260 into lp:openerp-mexico-localization/7.0
- 7.0-test_facturae-dev-moylop260
- Merge into 7.0
Status: | Merged |
---|---|
Merged at revision: | 242 |
Proposed branch: | lp:~vauxoo/openerp-mexico-localization/7.0-test_facturae-dev-moylop260 |
Merge into: | lp:openerp-mexico-localization/7.0 |
Diff against target: |
1262 lines (+478/-387) 24 files modified
email_template_multicompany/security/mail_server_security.xml (+1/-1) l10n_mx_company_multi_address/__openerp__.py (+2/-2) l10n_mx_company_multi_address/demo/l10n_mx_company_multi_address_demo.xml (+34/-0) l10n_mx_facturae/__openerp__.py (+7/-2) l10n_mx_facturae/demo/l10n_mx_facturae_seq_demo.xml (+8/-8) l10n_mx_facturae/invoice_view.xml (+0/-24) l10n_mx_facturae/test/account_invoice_cfd.yml (+105/-0) l10n_mx_facturae_cbb/__openerp__.py (+1/-0) l10n_mx_facturae_cbb/demo/l10n_mx_facturae_seq_demo.xml (+7/-7) l10n_mx_facturae_cbb/test/account_invoice_cbb.yml (+105/-0) l10n_mx_facturae_groups/security/l10n_mx_facturae_security_groups.xml (+1/-1) l10n_mx_facturae_pac_sf/__openerp__.py (+3/-0) l10n_mx_facturae_pac_sf/demo/l10n_mx_facturae_seq_demo.xml (+7/-7) l10n_mx_facturae_pac_sf/test/account_invoice_cfdi_pac_sf.yml (+105/-0) l10n_mx_facturae_report/__openerp__.py (+1/-1) l10n_mx_import_info/demo/import_info_demo.xml (+3/-102) l10n_mx_import_info/stock.py (+12/-186) l10n_mx_ir_attachment_facturae/__openerp__.py (+1/-1) l10n_mx_ir_attachment_facturae/invoice.py (+1/-1) l10n_mx_ir_attachment_facturae/ir_attachment_facturae.py (+17/-13) l10n_mx_partner_address/demo/l10n_mx_partner_address_demo.xml (+30/-28) l10n_mx_payment_method/invoice_view.xml (+16/-2) l10n_mx_regimen_fiscal/__openerp__.py (+1/-1) l10n_mx_regimen_fiscal/demo/l10n_mx_regimen_fiscal_demo.xml (+10/-0) |
To merge this branch: | bzr merge lp:~vauxoo/openerp-mexico-localization/7.0-test_facturae-dev-moylop260 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Vauxoo | Pending | ||
Review via email: mp+178471@code.launchpad.net |
Commit message
Description of the change
Add test yaml to cfd, cbb & cfdi
- 248. By Moisés López - http://www.vauxoo.com
-
[REF] [l10n_mx_
partner_ address] Remove @ in data demo for reject send email to this demo partner - 249. By Moisés López - http://www.vauxoo.com
-
[FIX][l10n_
mx_ir_attachmen t_facturae] Fix msg error of create pdf
Error message: cr.execute('SELECT DISTINCT parent_id from ir_attachment WHERE id in %s AND parent_id is not NULL', (tuple(ids),)) TypeError: 'int' object is not iterable - 250. By Moisés López - http://www.vauxoo.com
-
[FIX][l10n_
mx_ir_attachmen t_facturae] Add missing depends - 251. By Moisés López - http://www.vauxoo.com
-
[REF] Change noupdate=0 to noupdate=1 into xml files
- 252. By Moisés López - http://www.vauxoo.com
-
[FIX] [l10n_mx_
ir_attachment_ facturae] Fix write error - 253. By Moisés López - http://www.vauxoo.com
-
[REF] Refactory xml id demo, refactory test_yaml & add todo comment.
- 254. By Moisés López - http://www.vauxoo.com
-
[REF] [l10n_mx_
facturae_ pac_sf] Add comment todo in pac_sf.yml - 255. By Moisés López - http://www.vauxoo.com
-
[FIX] [l10n_mx_
import_ info] Fix install error with test-enable in data demo & new ref from stock - 256. By Moisés López - http://www.vauxoo.com
-
[REF] Change quantity in test yaml only for generate info distinct. Add print generic report to test. Add validation of columns exists for runbot case.
- 257. By Moisés López - http://www.vauxoo.com
-
[FIX] [l10n_mx_
payment_ method] Add field to invoice supplier form view. For fix in return of onchange
Preview Diff
1 | === modified file 'email_template_multicompany/security/mail_server_security.xml' |
2 | --- email_template_multicompany/security/mail_server_security.xml 2013-06-06 22:04:05 +0000 |
3 | +++ email_template_multicompany/security/mail_server_security.xml 2013-08-05 23:13:29 +0000 |
4 | @@ -1,6 +1,6 @@ |
5 | <?xml version="1.0"?> |
6 | <openerp> |
7 | - <data noupdate="0"> |
8 | + <data noupdate="1"> |
9 | |
10 | <record id="mail_server_rule" model="ir.rule"> |
11 | <field name="name">Mail Server</field> |
12 | |
13 | === modified file 'l10n_mx_company_multi_address/__openerp__.py' |
14 | --- l10n_mx_company_multi_address/__openerp__.py 2013-06-21 00:15:51 +0000 |
15 | +++ l10n_mx_company_multi_address/__openerp__.py 2013-08-05 23:13:29 +0000 |
16 | @@ -34,9 +34,9 @@ |
17 | """, |
18 | "website" : "http://www.vauxoo.com/", |
19 | "license" : "AGPL-3", |
20 | - "depends" : ["account", |
21 | + "depends" : ["account", "l10n_mx_states", |
22 | ], |
23 | - "demo" : [], |
24 | + "demo" : ["demo/l10n_mx_company_multi_address_demo.xml",], |
25 | "data" : [ |
26 | #'security/ir.model.access.csv', |
27 | "invoice_view_address.xml", |
28 | |
29 | === added directory 'l10n_mx_company_multi_address/demo' |
30 | === added file 'l10n_mx_company_multi_address/demo/l10n_mx_company_multi_address_demo.xml' |
31 | --- l10n_mx_company_multi_address/demo/l10n_mx_company_multi_address_demo.xml 1970-01-01 00:00:00 +0000 |
32 | +++ l10n_mx_company_multi_address/demo/l10n_mx_company_multi_address_demo.xml 2013-08-05 23:13:29 +0000 |
33 | @@ -0,0 +1,34 @@ |
34 | +<?xml version="1.0" ?> |
35 | +<openerp> |
36 | + <data noupdate="1"> |
37 | + |
38 | + <record id="main_mx_address_company" model="res.partner"> |
39 | + <field name="name">Your MX Address</field> |
40 | + <field name="parent_id" ref="base.main_partner"/> |
41 | + <field name="customer" eval="0"/> |
42 | + <field name="is_company" eval="0"/> |
43 | + <field name="use_parent_address" eval="0"/> |
44 | + <field name="street">Tu Calle</field> |
45 | + <field name="street2">Tu Colonia</field> |
46 | + <field name="l10n_mx_street3">Tu num exterior</field> |
47 | + <field name="l10n_mx_street4">Tu num interior</field> |
48 | + <field name="zip">10000</field> |
49 | + <field name="l10n_mx_city2">Tu localidad</field> |
50 | + <field name="city">tu ciudad</field> |
51 | + <field name="state_id" ref="l10n_mx_states.res_country_state_mx_gto" model="res.country.state"/> |
52 | + <field name="country_id" ref="base.mx"/> |
53 | + <field name="email">tu_email@tu_dominio.com</field> |
54 | + <field name="phone">tu-telefono</field> |
55 | + <field name="vat">MXATU010201RF2</field> <!--TODO: Should be use parent_id.vat in py--> |
56 | + </record> |
57 | + |
58 | + <record id="base.main_partner" model="res.partner"> |
59 | + <field name="vat">MXATU010301RF3</field> |
60 | + </record> |
61 | + |
62 | + <record id="base.main_company" model="res.company"> |
63 | + <field name="address_invoice_parent_company_id" ref="main_mx_address_company"/> |
64 | + </record> |
65 | + |
66 | + </data> |
67 | +</openerp> |
68 | |
69 | === modified file 'l10n_mx_facturae/__openerp__.py' |
70 | --- l10n_mx_facturae/__openerp__.py 2013-07-29 12:16:56 +0000 |
71 | +++ l10n_mx_facturae/__openerp__.py 2013-08-05 23:13:29 +0000 |
72 | @@ -64,7 +64,9 @@ |
73 | "l10n_mx_facturae_report", |
74 | "l10n_mx_facturae_group_show_wizards", |
75 | ], |
76 | - "demo" : ["demo/l10n_mx_facturae_seq_demo.xml",], |
77 | + "demo" : [ |
78 | + "demo/l10n_mx_facturae_seq_demo.xml", |
79 | + ], |
80 | "data" : [ |
81 | #'security/l10n_mx_facturae_security.xml', |
82 | #'security/ir.model.access.csv', |
83 | @@ -72,7 +74,10 @@ |
84 | "wizard/wizard_invoice_facturae_txt_v6_view.xml", |
85 | "wizard/wizard_invoice_facturae_xml_v6_view.xml", |
86 | "wizard/installer_view.xml", |
87 | - "invoice_view.xml", |
88 | + #"invoice_view.xml", |
89 | + ], |
90 | + "test" : [ |
91 | + "test/account_invoice_cfd.yml", |
92 | ], |
93 | "installable" : True, |
94 | "active" : False, |
95 | |
96 | === modified file 'l10n_mx_facturae/demo/l10n_mx_facturae_seq_demo.xml' |
97 | --- l10n_mx_facturae/demo/l10n_mx_facturae_seq_demo.xml 2013-04-20 00:14:08 +0000 |
98 | +++ l10n_mx_facturae/demo/l10n_mx_facturae_seq_demo.xml 2013-08-05 23:13:29 +0000 |
99 | @@ -1,7 +1,7 @@ |
100 | <?xml version="1.0" ?> |
101 | <openerp> |
102 | <data noupdate="1"> |
103 | - <record id="demo_l10n_mx_facturae_ir_seq_0" model="ir.sequence"> |
104 | + <record id="l10n_mx_cfd_seq_0" model="ir.sequence"> |
105 | <field name="company_id" ref="base.main_company"/> |
106 | <field name="name">Sequence CFD</field> |
107 | <field name="active" eval="True"/> |
108 | @@ -11,9 +11,9 @@ |
109 | <field name="implementation">standard</field> |
110 | </record> |
111 | |
112 | - <record id="demo_l10n_mx_facturae_ir_seq_approval_0" model="ir.sequence.approval"> |
113 | + <record id="l10n_mx_cfd_approval_0" model="ir.sequence.approval"> |
114 | <field name="company_id" ref="base.main_company"/> |
115 | - <field name="sequence_id" ref="demo_l10n_mx_facturae_ir_seq_0"/> |
116 | + <field name="sequence_id" ref="l10n_mx_cfd_seq_0"/> |
117 | <field name="approval_number">12345</field> |
118 | <field name="serie">A</field> |
119 | <field name="approval_year" eval="time.strftime('%Y')"/> |
120 | @@ -22,15 +22,15 @@ |
121 | <field name="type">cfd22</field> |
122 | </record> |
123 | |
124 | - <record id="demo_l10n_mx_facturae_account_journal_0" model="account.journal"> |
125 | + <record id="l10n_mx_cfd_journal_0" model="account.journal"> |
126 | <field name="company_id" ref="base.main_company"/> |
127 | - <field name="sequence_id" ref="demo_l10n_mx_facturae_ir_seq_0"/> |
128 | - <field name="name">Diario de CFD</field> |
129 | + <field name="sequence_id" ref="l10n_mx_cfd_seq_0"/> |
130 | + <field name="name">CFD Journal</field> |
131 | <field name="code">CFD</field> |
132 | <field name="type">sale</field> |
133 | - <field name="user_id" ref="base.user_root"/> |
134 | + <!--<field name="user_id" ref="base.user_root"/> |
135 | <field name="company2_id" ref="base.main_company"/> |
136 | - <field name="currency" ref="base.MXN"/> |
137 | + <field name="currency" ref="base.EUR"/>--> |
138 | </record> |
139 | </data> |
140 | </openerp> |
141 | |
142 | === removed file 'l10n_mx_facturae/invoice_view.xml' |
143 | --- l10n_mx_facturae/invoice_view.xml 2013-05-13 22:31:00 +0000 |
144 | +++ l10n_mx_facturae/invoice_view.xml 1970-01-01 00:00:00 +0000 |
145 | @@ -1,24 +0,0 @@ |
146 | -<?xml version="1.0"?> |
147 | -<openerp> |
148 | - <data> |
149 | - |
150 | - <record id="account_invoice_form_inh_l10n_mx_facturae_rate" model="ir.ui.view"> |
151 | - <field name="name">account.invoice.form.inh.l10n.mx.facturae.rate</field> |
152 | - <field name="model">account.invoice</field> |
153 | - <field name="inherit_id" ref="account.invoice_form"/> |
154 | - <field name="arch" type="xml"> |
155 | - <xpath expr="//sheet[@string='Invoice']/notebook/page[@string='Invoice Lines']/group/field[@name='payment_term']" position="after"> |
156 | - <field name="rate"/> |
157 | - </xpath> |
158 | - <xpath expr="//field[@name='partner_id']" position="replace"> |
159 | - <field string="Customer" name="partner_id" |
160 | - on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank_id,company_id)" |
161 | - groups="base.group_user" context="{'search_default_customer':1, 'show_address': 1}" |
162 | - options='{"always_reload": True}' |
163 | - domain="[('customer', '=', True), ('type', '=', 'invoice')]"/> |
164 | - </xpath> |
165 | - </field> |
166 | - </record> |
167 | - |
168 | - </data> |
169 | -</openerp> |
170 | |
171 | === added directory 'l10n_mx_facturae/test' |
172 | === added file 'l10n_mx_facturae/test/account_invoice_cfd.yml' |
173 | --- l10n_mx_facturae/test/account_invoice_cfd.yml 1970-01-01 00:00:00 +0000 |
174 | +++ l10n_mx_facturae/test/account_invoice_cfd.yml 2013-08-05 23:13:29 +0000 |
175 | @@ -0,0 +1,105 @@ |
176 | +- |
177 | + I create a cfd customer invoice |
178 | +- |
179 | + !record {model: account.invoice, id: account_invoice_cfd0, view: account.invoice_form}: |
180 | + payment_term: account.account_payment_term_advance |
181 | + journal_id: l10n_mx_cfd_journal_0 |
182 | + partner_id: l10n_mx_partner_address.res_partner_address_vauxoo_1 |
183 | + reference_type: none |
184 | + name: 'Test cfd Customer Invoice' |
185 | + invoice_line: |
186 | + - product_id: product.product_product_5 |
187 | + quantity: 20.0 |
188 | +- |
189 | + I rewrite the journal field (BUG I need overwrite two times this field for done! only in test yaml) |
190 | +- |
191 | + !record {model: account.invoice, id: account_invoice_cfd0, view: account.invoice_form}: |
192 | + journal_id: l10n_mx_cfd_journal_0 |
193 | +- |
194 | + I check that Journal is cfd |
195 | +- |
196 | + !assert {model: account.invoice, id: account_invoice_cfd0}: |
197 | + - journal_id.id == ref('l10n_mx_cfd_journal_0') |
198 | +- |
199 | + I check that Initially customer invoice state is "Draft" |
200 | +- |
201 | + !assert {model: account.invoice, id: account_invoice_cfd0}: |
202 | + - state == 'draft' |
203 | +- |
204 | + I open invoice by clicking on Create button |
205 | +- |
206 | + !workflow {model: account.invoice, action: invoice_open, ref: account_invoice_cfd0} |
207 | +- |
208 | + I check that the invoice state is "Open" |
209 | +- |
210 | + !assert {model: account.invoice, id: account_invoice_cfd0}: |
211 | + - state == 'open' |
212 | +- |
213 | + I confirm l10n_mx attachment facturae cfd by clicking on confirm button |
214 | +- |
215 | + !python {model: ir.attachment.facturae.mx}: | |
216 | + import netsvc |
217 | + wf_service = netsvc.LocalService("workflow") |
218 | + cfd_ids = self.search(cr, uid, [('invoice_id', '=', ref("account_invoice_cfd0") ), ('state', '<>', 'cancel')], limit=1) |
219 | + cfd_id = cfd_ids and cfd_ids[0] or False |
220 | + if cfd_id: |
221 | + wf_service.trg_validate(uid, 'ir.attachment.facturae.mx', cfd_id, 'action_confirm', cr) |
222 | +- |
223 | + I sign l10n_mx attachment facturae cfd by clicking on sign button |
224 | +- |
225 | + !python {model: ir.attachment.facturae.mx}: | |
226 | + import netsvc |
227 | + wf_service = netsvc.LocalService("workflow") |
228 | + cfd_ids = self.search(cr, uid, [('invoice_id', '=', ref("account_invoice_cfd0") ), ('state', '<>', 'cancel')], limit=1) |
229 | + cfd_id = cfd_ids and cfd_ids[0] or False |
230 | + if cfd_id: |
231 | + wf_service.trg_validate(uid, 'ir.attachment.facturae.mx', cfd_id, 'action_sign', cr) |
232 | +- |
233 | + I check that the state in l10n_mx attachment facturae cfd is "Signed" |
234 | +- |
235 | + !python {model: ir.attachment.facturae.mx}: | |
236 | + cfd_ids = self.search(cr, uid, [('invoice_id', '=', ref("account_invoice_cfd0") ), ('state', '<>', 'cancel')], limit=1) |
237 | + cfd_id = cfd_ids and cfd_ids[0] or False |
238 | + state = None |
239 | + if cfd_id: |
240 | + cfd = self.browse(cr, uid, [cfd_id])[0] |
241 | + state = cfd.state |
242 | + assert state=='signed', 'No signed state l10n_mx attachment facturae cfd' |
243 | + |
244 | +- |
245 | + TODO I generate a printable l10n_mx attachment facturae cfd manualmente |
246 | +- |
247 | + !python {model: account.invoice}: | |
248 | + import netsvc, tools, os |
249 | + invoice_obj = self.pool.get('account.invoice') |
250 | + invoice_id = invoice_obj.search(cr, uid, [('id', '=', ref('account_invoice_cfd0'))])[0] |
251 | + #(data, format) = netsvc.LocalService('report.account.invoice.facturae.webkit').create(cr, uid, [invoice_id], {}, {}) |
252 | + (data, format) = netsvc.LocalService('report.account.invoice').create(cr, uid, [invoice_id], {}, {})##Temporal only for test |
253 | + if tools.config['test_report_directory']: |
254 | + file(os.path.join(tools.config['test_report_directory'], 'l10n_mx-facturae_cfd_report.'+format), 'wb+').write(data) |
255 | +#TODO: Report a bug when test yaml generate a webkit report |
256 | +#~ - |
257 | + #~ I generate a printable l10n_mx attachment facturae cfd by clicking on printable button |
258 | +#~ - |
259 | + #~ !python {model: ir.attachment.facturae.mx}: | |
260 | + #~ import netsvc |
261 | + #~ wf_service = netsvc.LocalService("workflow") |
262 | + #~ cfd_ids = self.search(cr, uid, [('invoice_id', '=', ref("account_invoice_cfd0") ), ('state', '<>', 'cancel')], limit=1) |
263 | + #~ cfd_id = cfd_ids and cfd_ids[0] or False |
264 | + #~ if cfd_id: |
265 | + #~ #wf_service.trg_validate(uid, 'ir.attachment.facturae.mx', cfd_id, 'action_printable', cr) |
266 | + #~ #wf_service.trg_validate(uid, 'ir.attachment.facturae.mx', cfd_id, 'action_printable', cr) |
267 | + #~ #wf_service.trg_validate(uid, 'ir.attachment.facturae.mx', cfd_id, 'action_printable', cr) |
268 | + #~ #wf_service.trg_validate(uid, 'ir.attachment.facturae.mx', cfd_id, 'action_printable', cr) |
269 | + #~ self.action_printable(cr, uid, [cfd_id], context={}) |
270 | +#~ - |
271 | + #~ I check that the state in l10n_mx attachment facturae cfd is Printable |
272 | +#~ - |
273 | + #~ !python {model: ir.attachment.facturae.mx}: | |
274 | + #~ cfd_ids = self.search(cr, uid, [('invoice_id', '=', ref("account_invoice_cfd0") ), ('state', '<>', 'cancel')], limit=1) |
275 | + #~ cfd_id = cfd_ids and cfd_ids[0] or False |
276 | + #~ state = None |
277 | + #~ if cfd_id: |
278 | + #~ cfd = self.browse(cr, uid, [cfd_id])[0] |
279 | + #~ state = cfd.state |
280 | + #~ assert state=='printable', 'No printable state l10n_mx attachment facturae cfd' |
281 | |
282 | === modified file 'l10n_mx_facturae_cbb/__openerp__.py' |
283 | --- l10n_mx_facturae_cbb/__openerp__.py 2013-07-16 22:45:12 +0000 |
284 | +++ l10n_mx_facturae_cbb/__openerp__.py 2013-08-05 23:13:29 +0000 |
285 | @@ -56,6 +56,7 @@ |
286 | 'ir_sequence_view_v6.xml', |
287 | "l10n_mx_facturae_report.xml", |
288 | ], |
289 | + "test" : ["test/account_invoice_cbb.yml"], |
290 | "installable" : True, |
291 | "active" : False, |
292 | } |
293 | |
294 | === modified file 'l10n_mx_facturae_cbb/demo/l10n_mx_facturae_seq_demo.xml' |
295 | --- l10n_mx_facturae_cbb/demo/l10n_mx_facturae_seq_demo.xml 2013-04-20 00:14:08 +0000 |
296 | +++ l10n_mx_facturae_cbb/demo/l10n_mx_facturae_seq_demo.xml 2013-08-05 23:13:29 +0000 |
297 | @@ -1,7 +1,7 @@ |
298 | <?xml version="1.0" ?> |
299 | <openerp> |
300 | <data noupdate="1"> |
301 | - <record id="demo_l10n_mx_facturae_ir_seq_02" model="ir.sequence"> |
302 | + <record id="l10n_mx_cbb_seq_0" model="ir.sequence"> |
303 | <field name="company_id" ref="base.main_company"/> |
304 | <field name="name">Sequence CBB</field> |
305 | <field name="active" eval="True"/> |
306 | @@ -11,9 +11,9 @@ |
307 | <field name="implementation">standard</field> |
308 | </record> |
309 | |
310 | - <record id="demo_l10n_mx_facturae_ir_seq_approval_02" model="ir.sequence.approval"> |
311 | + <record id="l10n_mx_cbb_approval_0" model="ir.sequence.approval"> |
312 | <field name="company_id" ref="base.main_company"/> |
313 | - <field name="sequence_id" ref="demo_l10n_mx_facturae_ir_seq_02"/> |
314 | + <field name="sequence_id" ref="l10n_mx_cbb_seq_0"/> |
315 | <field name="approval_number">12345</field> |
316 | <field name="serie">A</field> |
317 | <field name="approval_year" eval="time.strftime('%Y')"/> |
318 | @@ -25,15 +25,15 @@ |
319 | <field name="cbb_image">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</field> |
320 | </record> |
321 | |
322 | - <record id="demo_l10n_mx_facturae_account_journal_02" model="account.journal"> |
323 | + <record id="l10n_mx_cbb_journal_0" model="account.journal"> |
324 | <field name="company_id" ref="base.main_company"/> |
325 | - <field name="sequence_id" ref="demo_l10n_mx_facturae_ir_seq_02"/> |
326 | + <field name="sequence_id" ref="l10n_mx_cbb_seq_0"/> |
327 | <field name="name">Diario de CBB</field> |
328 | <field name="code">CBB</field> |
329 | <field name="type">sale</field> |
330 | - <field name="user_id" ref="base.user_root"/> |
331 | + <!--<field name="user_id" ref="base.user_root"/> |
332 | <field name="company2_id" ref="base.main_company"/> |
333 | - <field name="currency" ref="base.MXN"/> |
334 | + <field name="currency" ref="base.MXN"/>--> |
335 | </record> |
336 | </data> |
337 | </openerp> |
338 | |
339 | === added directory 'l10n_mx_facturae_cbb/test' |
340 | === added file 'l10n_mx_facturae_cbb/test/account_invoice_cbb.yml' |
341 | --- l10n_mx_facturae_cbb/test/account_invoice_cbb.yml 1970-01-01 00:00:00 +0000 |
342 | +++ l10n_mx_facturae_cbb/test/account_invoice_cbb.yml 2013-08-05 23:13:29 +0000 |
343 | @@ -0,0 +1,105 @@ |
344 | +- |
345 | + I create a cbb customer invoice |
346 | +- |
347 | + !record {model: account.invoice, id: account_invoice_cbb0, view: account.invoice_form}: |
348 | + payment_term: account.account_payment_term_advance |
349 | + journal_id: l10n_mx_cbb_journal_0 |
350 | + partner_id: l10n_mx_partner_address.res_partner_address_vauxoo_1 |
351 | + reference_type: none |
352 | + name: 'Test cbb Customer Invoice' |
353 | + invoice_line: |
354 | + - product_id: product.product_product_5 |
355 | + quantity: 10.0 |
356 | +- |
357 | + I rewrite the journal field (BUG I need overwrite two times this field for done! only in test yaml) |
358 | +- |
359 | + !record {model: account.invoice, id: account_invoice_cbb0, view: account.invoice_form}: |
360 | + journal_id: l10n_mx_cbb_journal_0 |
361 | +- |
362 | + I check that Journal is cbb |
363 | +- |
364 | + !assert {model: account.invoice, id: account_invoice_cbb0}: |
365 | + - journal_id.id == ref('l10n_mx_cbb_journal_0') |
366 | +- |
367 | + I check that Initially customer invoice state is "Draft" |
368 | +- |
369 | + !assert {model: account.invoice, id: account_invoice_cbb0}: |
370 | + - state == 'draft' |
371 | +- |
372 | + I open invoice by clicking on Create button |
373 | +- |
374 | + !workflow {model: account.invoice, action: invoice_open, ref: account_invoice_cbb0} |
375 | +- |
376 | + I check that the invoice state is "Open" |
377 | +- |
378 | + !assert {model: account.invoice, id: account_invoice_cbb0}: |
379 | + - state == 'open' |
380 | +- |
381 | + I confirm l10n_mx attachment facturae cbb by clicking on confirm button |
382 | +- |
383 | + !python {model: ir.attachment.facturae.mx}: | |
384 | + import netsvc |
385 | + wf_service = netsvc.LocalService("workflow") |
386 | + cbb_ids = self.search(cr, uid, [('invoice_id', '=', ref("account_invoice_cbb0") ), ('state', '<>', 'cancel')], limit=1) |
387 | + cbb_id = cbb_ids and cbb_ids[0] or False |
388 | + if cbb_id: |
389 | + wf_service.trg_validate(uid, 'ir.attachment.facturae.mx', cbb_id, 'action_confirm', cr) |
390 | +- |
391 | + I sign l10n_mx attachment facturae cbb by clicking on sign button |
392 | +- |
393 | + !python {model: ir.attachment.facturae.mx}: | |
394 | + import netsvc |
395 | + wf_service = netsvc.LocalService("workflow") |
396 | + cbb_ids = self.search(cr, uid, [('invoice_id', '=', ref("account_invoice_cbb0") ), ('state', '<>', 'cancel')], limit=1) |
397 | + cbb_id = cbb_ids and cbb_ids[0] or False |
398 | + if cbb_id: |
399 | + wf_service.trg_validate(uid, 'ir.attachment.facturae.mx', cbb_id, 'action_sign', cr) |
400 | +- |
401 | + I check that the state in l10n_mx attachment facturae cbb is "Signed" |
402 | +- |
403 | + !python {model: ir.attachment.facturae.mx}: | |
404 | + cbb_ids = self.search(cr, uid, [('invoice_id', '=', ref("account_invoice_cbb0") ), ('state', '<>', 'cancel')], limit=1) |
405 | + cbb_id = cbb_ids and cbb_ids[0] or False |
406 | + state = None |
407 | + if cbb_id: |
408 | + cbb = self.browse(cr, uid, [cbb_id])[0] |
409 | + state = cbb.state |
410 | + assert state=='signed', 'No signed state l10n_mx attachment facturae cbb' |
411 | + |
412 | +- |
413 | + TODO I generate a printable l10n_mx attachment facturae cbb manualmente |
414 | +- |
415 | + !python {model: account.invoice}: | |
416 | + import netsvc, tools, os |
417 | + invoice_obj = self.pool.get('account.invoice') |
418 | + invoice_id = invoice_obj.search(cr, uid, [('id', '=', ref('account_invoice_cbb0'))])[0] |
419 | + #(data, format) = netsvc.LocalService('report.account.invoice.facturae.webkit').create(cr, uid, [invoice_id], {}, {})#TODO Report a bug when test yaml generate a webkit report |
420 | + (data, format) = netsvc.LocalService('report.account.invoice').create(cr, uid, [invoice_id], {}, {})##Temporal only for test |
421 | + if tools.config['test_report_directory']: |
422 | + file(os.path.join(tools.config['test_report_directory'], 'l10n_mx-facturae_cbb_report.'+format), 'wb+').write(data) |
423 | +#TODO: Report a bug when test yaml generate a webkit report |
424 | +#~ - |
425 | + #~ I generate a printable l10n_mx attachment facturae cbb by clicking on printable button |
426 | +#~ - |
427 | + #~ !python {model: ir.attachment.facturae.mx}: | |
428 | + #~ import netsvc |
429 | + #~ wf_service = netsvc.LocalService("workflow") |
430 | + #~ cbb_ids = self.search(cr, uid, [('invoice_id', '=', ref("account_invoice_cbb0") ), ('state', '<>', 'cancel')], limit=1) |
431 | + #~ cbb_id = cbb_ids and cbb_ids[0] or False |
432 | + #~ if cbb_id: |
433 | + #~ #wf_service.trg_validate(uid, 'ir.attachment.facturae.mx', cbb_id, 'action_printable', cr) |
434 | + #~ #wf_service.trg_validate(uid, 'ir.attachment.facturae.mx', cbb_id, 'action_printable', cr) |
435 | + #~ #wf_service.trg_validate(uid, 'ir.attachment.facturae.mx', cbb_id, 'action_printable', cr) |
436 | + #~ #wf_service.trg_validate(uid, 'ir.attachment.facturae.mx', cbb_id, 'action_printable', cr) |
437 | + #~ self.action_printable(cr, uid, [cbb_id], context={}) |
438 | +#~ - |
439 | + #~ I check that the state in l10n_mx attachment facturae cbb is Printable |
440 | +#~ - |
441 | + #~ !python {model: ir.attachment.facturae.mx}: | |
442 | + #~ cbb_ids = self.search(cr, uid, [('invoice_id', '=', ref("account_invoice_cbb0") ), ('state', '<>', 'cancel')], limit=1) |
443 | + #~ cbb_id = cbb_ids and cbb_ids[0] or False |
444 | + #~ state = None |
445 | + #~ if cbb_id: |
446 | + #~ cbb = self.browse(cr, uid, [cbb_id])[0] |
447 | + #~ state = cbb.state |
448 | + #~ assert state=='printable', 'No printable state l10n_mx attachment facturae cbb' |
449 | |
450 | === modified file 'l10n_mx_facturae_groups/security/l10n_mx_facturae_security_groups.xml' |
451 | --- l10n_mx_facturae_groups/security/l10n_mx_facturae_security_groups.xml 2013-06-21 00:15:51 +0000 |
452 | +++ l10n_mx_facturae_groups/security/l10n_mx_facturae_security_groups.xml 2013-08-05 23:13:29 +0000 |
453 | @@ -1,6 +1,6 @@ |
454 | <?xml version="1.0"?> |
455 | <openerp> |
456 | - <data noupdate="0"> |
457 | + <data noupdate="1"> |
458 | |
459 | <record model="ir.module.category" id="module_l10n_mx_facturae"> |
460 | <field name="name">Facturación Electrónica de México</field> |
461 | |
462 | === modified file 'l10n_mx_facturae_pac_sf/__openerp__.py' |
463 | --- l10n_mx_facturae_pac_sf/__openerp__.py 2013-07-29 12:16:56 +0000 |
464 | +++ l10n_mx_facturae_pac_sf/__openerp__.py 2013-08-05 23:13:29 +0000 |
465 | @@ -53,6 +53,9 @@ |
466 | "wizard/wizard_cancel_invoice_pac_sf_view.xml", |
467 | "wizard/wizard_export_invoice_pac_sf_view_v6.xml", |
468 | ], |
469 | + "test" : [ |
470 | + "test/account_invoice_cfdi_pac_sf.yml", |
471 | + ], |
472 | "installable" : True, |
473 | "active" : False, |
474 | } |
475 | |
476 | === modified file 'l10n_mx_facturae_pac_sf/demo/l10n_mx_facturae_seq_demo.xml' |
477 | --- l10n_mx_facturae_pac_sf/demo/l10n_mx_facturae_seq_demo.xml 2013-04-20 00:14:08 +0000 |
478 | +++ l10n_mx_facturae_pac_sf/demo/l10n_mx_facturae_seq_demo.xml 2013-08-05 23:13:29 +0000 |
479 | @@ -1,7 +1,7 @@ |
480 | <?xml version="1.0" ?> |
481 | <openerp> |
482 | <data noupdate="1"> |
483 | - <record id="demo_l10n_mx_facturae_ir_seq_01" model="ir.sequence"> |
484 | + <record id="l10n_mx_cfdi_pac_sf_seq_0" model="ir.sequence"> |
485 | <field name="company_id" ref="base.main_company"/> |
486 | <field name="name">Sequence CFD-I SF</field> |
487 | <field name="active" eval="True"/> |
488 | @@ -11,9 +11,9 @@ |
489 | <field name="implementation">standard</field> |
490 | </record> |
491 | |
492 | - <record id="demo_l10n_mx_facturae_ir_seq_approval_01" model="ir.sequence.approval"> |
493 | + <record id="l10n_mx_cfdi_pac_sf_approval_0" model="ir.sequence.approval"> |
494 | <field name="company_id" ref="base.main_company"/> |
495 | - <field name="sequence_id" ref="demo_l10n_mx_facturae_ir_seq_01"/> |
496 | + <field name="sequence_id" ref="l10n_mx_cfdi_pac_sf_seq_0"/> |
497 | <field name="approval_number">12345</field> |
498 | <field name="serie">A</field> |
499 | <field name="approval_year" eval="time.strftime('%Y')"/> |
500 | @@ -22,15 +22,15 @@ |
501 | <field name="type">cfdi32</field> |
502 | </record> |
503 | |
504 | - <record id="demo_l10n_mx_facturae_account_journal_01" model="account.journal"> |
505 | + <record id="l10n_mx_cfdi_pac_sf_journal_0" model="account.journal"> |
506 | <field name="company_id" ref="base.main_company"/> |
507 | - <field name="sequence_id" ref="demo_l10n_mx_facturae_ir_seq_01"/> |
508 | + <field name="sequence_id" ref="l10n_mx_cfdi_pac_sf_seq_0"/> |
509 | <field name="name">Diario de CFD-I SF</field> |
510 | <field name="code">CFD-I</field> |
511 | <field name="type">sale</field> |
512 | - <field name="user_id" ref="base.user_root"/> |
513 | + <!--<field name="user_id" ref="base.user_root"/> |
514 | <field name="company2_id" ref="base.main_company"/> |
515 | - <field name="currency" ref="base.MXN"/> |
516 | + <field name="currency" ref="base.MXN"/>--> |
517 | </record> |
518 | </data> |
519 | </openerp> |
520 | |
521 | === added directory 'l10n_mx_facturae_pac_sf/test' |
522 | === added file 'l10n_mx_facturae_pac_sf/test/account_invoice_cfdi_pac_sf.yml' |
523 | --- l10n_mx_facturae_pac_sf/test/account_invoice_cfdi_pac_sf.yml 1970-01-01 00:00:00 +0000 |
524 | +++ l10n_mx_facturae_pac_sf/test/account_invoice_cfdi_pac_sf.yml 2013-08-05 23:13:29 +0000 |
525 | @@ -0,0 +1,105 @@ |
526 | +- |
527 | + I create cfdi_pac_sf a customer invoice |
528 | +- |
529 | + !record {model: account.invoice, id: account_invoice_cfdi_pac_sf0, view: account.invoice_form}: |
530 | + payment_term: account.account_payment_term_advance |
531 | + journal_id: l10n_mx_cfdi_pac_sf_journal_0 |
532 | + partner_id: l10n_mx_partner_address.res_partner_address_vauxoo_1 |
533 | + reference_type: none |
534 | + name: 'Test cfdi_pac_sf Customer Invoice' |
535 | + invoice_line: |
536 | + - product_id: product.product_product_5 |
537 | + quantity: 30.0 |
538 | +- |
539 | + I rewrite the journal field (BUG I need overwrite two times this field for done! only in test yaml) |
540 | +- |
541 | + !record {model: account.invoice, id: account_invoice_cfdi_pac_sf0, view: account.invoice_form}: |
542 | + journal_id: l10n_mx_cfdi_pac_sf_journal_0 |
543 | +- |
544 | + I check that Journal is cfdi_pac_sf |
545 | +- |
546 | + !assert {model: account.invoice, id: account_invoice_cfdi_pac_sf0}: |
547 | + - journal_id.id == ref('l10n_mx_cfdi_pac_sf_journal_0') |
548 | +- |
549 | + I check that Initially customer invoice state is "Draft" |
550 | +- |
551 | + !assert {model: account.invoice, id: account_invoice_cfdi_pac_sf0}: |
552 | + - state == 'draft' |
553 | +- |
554 | + I open invoice by clicking on Create button |
555 | +- |
556 | + !workflow {model: account.invoice, action: invoice_open, ref: account_invoice_cfdi_pac_sf0} |
557 | +- |
558 | + I check that the invoice state is "Open" |
559 | +- |
560 | + !assert {model: account.invoice, id: account_invoice_cfdi_pac_sf0}: |
561 | + - state == 'open' |
562 | +- |
563 | + I confirm l10n_mx attachment facturae cfdi_pac_sf by clicking on confirm button |
564 | +- |
565 | + !python {model: ir.attachment.facturae.mx}: | |
566 | + import netsvc |
567 | + wf_service = netsvc.LocalService("workflow") |
568 | + cfdi_pac_sf_ids = self.search(cr, uid, [('invoice_id', '=', ref("account_invoice_cfdi_pac_sf0") ), ('state', '<>', 'cancel')], limit=1) |
569 | + cfdi_pac_sf_id = cfdi_pac_sf_ids and cfdi_pac_sf_ids[0] or False |
570 | + if cfdi_pac_sf_id: |
571 | + wf_service.trg_validate(uid, 'ir.attachment.facturae.mx', cfdi_pac_sf_id, 'action_confirm', cr) |
572 | +- |
573 | + I sign l10n_mx attachment facturae cfdi_pac_sf by clicking on sign button upload pac |
574 | +- |
575 | + !python {model: ir.attachment.facturae.mx}: | |
576 | + import netsvc |
577 | + wf_service = netsvc.LocalService("workflow") |
578 | + cfdi_pac_sf_ids = self.search(cr, uid, [('invoice_id', '=', ref("account_invoice_cfdi_pac_sf0") ), ('state', '<>', 'cancel')], limit=1) |
579 | + cfdi_pac_sf_id = cfdi_pac_sf_ids and cfdi_pac_sf_ids[0] or False |
580 | + if cfdi_pac_sf_id: |
581 | + wf_service.trg_validate(uid, 'ir.attachment.facturae.mx', cfdi_pac_sf_id, 'action_sign', cr) |
582 | +- |
583 | + I check that the state in l10n_mx attachment facturae cfdi_pac_sf is "Signed" |
584 | +- |
585 | + !python {model: ir.attachment.facturae.mx}: | |
586 | + cfdi_pac_sf_ids = self.search(cr, uid, [('invoice_id', '=', ref("account_invoice_cfdi_pac_sf0") ), ('state', '<>', 'cancel')], limit=1) |
587 | + cfdi_pac_sf_id = cfdi_pac_sf_ids and cfdi_pac_sf_ids[0] or False |
588 | + state = None |
589 | + if cfdi_pac_sf_id: |
590 | + cfdi_pac_sf = self.browse(cr, uid, [cfdi_pac_sf_id])[0] |
591 | + state = cfdi_pac_sf.state |
592 | + assert state=='signed', 'No signed state l10n_mx attachment facturae cfdi_pac_sf' |
593 | + |
594 | +- |
595 | + TODO I generate a printable l10n_mx attachment facturae cfdi_pac_sf manualmente |
596 | +- |
597 | + !python {model: account.invoice}: | |
598 | + import netsvc, tools, os |
599 | + invoice_obj = self.pool.get('account.invoice') |
600 | + invoice_id = invoice_obj.search(cr, uid, [('id', '=', ref('account_invoice_cfdi_pac_sf0'))])[0] |
601 | + #(data, format) = netsvc.LocalService('report.account.invoice.facturae.webkit').create(cr, uid, [invoice_id], {}, {}) |
602 | + (data, format) = netsvc.LocalService('report.account.invoice').create(cr, uid, [invoice_id], {}, {})##Temporal only for test |
603 | + if tools.config['test_report_directory']: |
604 | + file(os.path.join(tools.config['test_report_directory'], 'l10n_mx-facturae_cfdi_pac_sf_report.'+format), 'wb+').write(data) |
605 | +#TODO: Report a bug when test yaml generate a webkit report |
606 | +#~ - |
607 | + #~ I generate a printable l10n_mx attachment facturae cfdi_pac_sf by clicking on printable button |
608 | +#~ - |
609 | + #~ !python {model: ir.attachment.facturae.mx}: | |
610 | + #~ import netsvc |
611 | + #~ wf_service = netsvc.LocalService("workflow") |
612 | + #~ cfdi_pac_sf_ids = self.search(cr, uid, [('invoice_id', '=', ref("account_invoice_cfdi_pac_sf0") ), ('state', '<>', 'cancel')], limit=1) |
613 | + #~ cfdi_pac_sf_id = cfdi_pac_sf_ids and cfdi_pac_sf_ids[0] or False |
614 | + #~ if cfdi_pac_sf_id: |
615 | + #~ #wf_service.trg_validate(uid, 'ir.attachment.facturae.mx', cfdi_pac_sf_id, 'action_printable', cr) |
616 | + #~ #wf_service.trg_validate(uid, 'ir.attachment.facturae.mx', cfdi_pac_sf_id, 'action_printable', cr) |
617 | + #~ #wf_service.trg_validate(uid, 'ir.attachment.facturae.mx', cfdi_pac_sf_id, 'action_printable', cr) |
618 | + #~ #wf_service.trg_validate(uid, 'ir.attachment.facturae.mx', cfdi_pac_sf_id, 'action_printable', cr) |
619 | + #~ self.action_printable(cr, uid, [cfdi_pac_sf_id], context={}) |
620 | +#~ - |
621 | + #~ I check that the state in l10n_mx attachment facturae cfdi_pac_sf is Printable |
622 | +#~ - |
623 | + #~ !python {model: ir.attachment.facturae.mx}: | |
624 | + #~ cfdi_pac_sf_ids = self.search(cr, uid, [('invoice_id', '=', ref("account_invoice_cfdi_pac_sf0") ), ('state', '<>', 'cancel')], limit=1) |
625 | + #~ cfdi_pac_sf_id = cfdi_pac_sf_ids and cfdi_pac_sf_ids[0] or False |
626 | + #~ state = None |
627 | + #~ if cfdi_pac_sf_id: |
628 | + #~ cfdi_pac_sf = self.browse(cr, uid, [cfdi_pac_sf_id])[0] |
629 | + #~ state = cfdi_pac_sf.state |
630 | + #~ assert state=='printable', 'No printable state l10n_mx attachment facturae cfdi_pac_sf' |
631 | |
632 | === modified file 'l10n_mx_facturae_report/__openerp__.py' |
633 | --- l10n_mx_facturae_report/__openerp__.py 2013-06-21 00:15:51 +0000 |
634 | +++ l10n_mx_facturae_report/__openerp__.py 2013-08-05 23:13:29 +0000 |
635 | @@ -35,7 +35,7 @@ |
636 | """, |
637 | "website" : "http://www.vauxoo.com/", |
638 | "license" : "AGPL-3", |
639 | - "depends" : ["account", "report_webkit","l10n_mx_regimen_fiscal", |
640 | + "depends" : ["account", "report_webkit", "l10n_mx_regimen_fiscal", |
641 | "l10n_mx_notes_invoice"], |
642 | "demo" : [], |
643 | "data" : [ |
644 | |
645 | === modified file 'l10n_mx_import_info/demo/import_info_demo.xml' |
646 | --- l10n_mx_import_info/demo/import_info_demo.xml 2013-04-20 00:14:08 +0000 |
647 | +++ l10n_mx_import_info/demo/import_info_demo.xml 2013-08-05 23:13:29 +0000 |
648 | @@ -1,170 +1,71 @@ |
649 | <?xml version="1.0" ?> |
650 | <openerp> |
651 | <data noupdate="1"> |
652 | - <record id="product_template_productodemoconcontroldepedimentos0" model="product.template"> |
653 | - <field name="supply_method">buy</field> |
654 | - <field eval="1.0" name="list_price"/> |
655 | - <field eval="1.0" name="standard_price"/> |
656 | - <field name="mes_type">fixed</field> |
657 | - <field name="uom_id" ref="product.product_uom_unit"/> |
658 | - <field eval="1.0" name="uos_coeff"/> |
659 | - <field eval="1" name="sale_ok"/> |
660 | - <field eval="1" name="purchase_ok"/> |
661 | - <field name="company_id" ref="base.main_company"/> |
662 | - <field name="uom_id" ref="product.product_uom_unit"/> |
663 | - <field name="type">product</field> |
664 | - <field eval="[(6,0,[])]" name="supplier_taxes_id"/> |
665 | - <field name="procure_method">make_to_stock</field> |
666 | - <field name="cost_method">standard</field> |
667 | - <field eval="0" name="rental"/> |
668 | - <field eval="7.0" name="sale_delay"/> |
669 | - <field name="name">Product Demo with import control Pack</field> |
670 | - <field name="categ_id" ref="product.product_category_all"/> |
671 | - <field eval="[(6,0,[])]" name="taxes_id"/> |
672 | - <field eval="1.0" name="produce_delay"/> |
673 | - </record> |
674 | - </data> |
675 | - <data noupdate="1"> |
676 | + <!-- |
677 | <record id="product_product_productodemoconcontroldepedimentos1" model="product.product"> |
678 | <field name="supply_method">buy</field> |
679 | - <field eval="1.0" name="list_price"/> |
680 | - <field eval="0" name="track_production"/> |
681 | - <field eval="1.0" name="standard_price"/> |
682 | - <field eval="1" name="active"/> |
683 | <field name="mes_type">fixed</field> |
684 | <field name="uom_id" ref="product.product_uom_unit"/> |
685 | - <field name="name_template">Product Demo with import control Pack</field> |
686 | - <field eval="1.0" name="uos_coeff"/> |
687 | <field name="type">product</field> |
688 | - <field eval="1" name="sale_ok"/> |
689 | - <field eval="1" name="purchase_ok"/> |
690 | - <field eval="1" name="track_outgoing"/> |
691 | <field name="company_id" ref="base.main_company"/> |
692 | <field name="name">Producto demo con Control de Pedimentos</field> |
693 | <field name="uom_id" ref="product.product_uom_unit"/> |
694 | - <field eval="1.0" name="price_margin"/> |
695 | - <field name="valuation">manual_periodic</field> |
696 | <field eval="1" name="track_incoming"/> |
697 | - <field name="property_stock_production" ref="stock.location_production"/> |
698 | - <field eval="[(6,0,[])]" name="supplier_taxes_id"/> |
699 | <field name="procure_method">make_to_stock</field> |
700 | - <field name="property_stock_inventory" ref="stock.location_inventory"/> |
701 | <field name="cost_method">standard</field> |
702 | <field eval="1" name="seller_delay"/> |
703 | <field eval="7.0" name="sale_delay"/> |
704 | <field name="categ_id" ref="product.product_category_all"/> |
705 | - <field name="property_stock_procurement" ref="stock.location_procurement"/> |
706 | - <field eval="[(6,0,[])]" name="taxes_id"/> |
707 | - <field eval="1.0" name="produce_delay"/> |
708 | - <field eval="0" name="rental"/> |
709 | </record> |
710 | - </data> |
711 | - <data> |
712 | <record id="product_product_productodemoconcontroldepedimentos2" model="product.product"> |
713 | <field name="supply_method">buy</field> |
714 | <field name="default_code">0001297</field> |
715 | - <field eval="1.0" name="list_price"/> |
716 | - <field eval="0" name="track_production"/> |
717 | - <field eval="1.0" name="standard_price"/> |
718 | - <field eval="1" name="active"/> |
719 | <field name="mes_type">fixed</field> |
720 | <field name="uom_id" ref="product.product_uom_unit"/> |
721 | - <field name="name_template">NIRVAMNA PFD</field> |
722 | - <field eval="1.0" name="uos_coeff"/> |
723 | <field name="type">product</field> |
724 | - <field eval="1" name="sale_ok"/> |
725 | - <field eval="1" name="purchase_ok"/> |
726 | - <field eval="1" name="track_outgoing"/> |
727 | <field name="company_id" ref="base.main_company"/> |
728 | <field name="name">NIRVAMNA PFD</field> |
729 | <field name="uom_po_id" ref="product.product_uom_unit"/> |
730 | - <field eval="1.0" name="price_margin"/> |
731 | - <field name="valuation">manual_periodic</field> |
732 | <field eval="1" name="track_incoming"/> |
733 | - <field name="property_stock_production" ref="stock.location_production"/> |
734 | - <field eval="[(6,0,[])]" name="supplier_taxes_id"/> |
735 | <field name="procure_method">make_to_stock</field> |
736 | - <field name="property_stock_inventory" ref="stock.location_inventory"/> |
737 | <field name="cost_method">standard</field> |
738 | <field eval="1" name="seller_delay"/> |
739 | <field eval="7.0" name="sale_delay"/> |
740 | <field name="categ_id" ref="product.product_category_all"/> |
741 | - <field name="property_stock_procurement" ref="stock.location_procurement"/> |
742 | - <field eval="[(6,0,[])]" name="taxes_id"/> |
743 | - <field eval="1.0" name="produce_delay"/> |
744 | - <field eval="0" name="rental"/> |
745 | </record> |
746 | - </data> |
747 | - <data> |
748 | <record id="product_product_productodemoconcontroldepedimentos3" model="product.product"> |
749 | <field name="supply_method">buy</field> |
750 | <field name="default_code">0001305</field> |
751 | - <field eval="1.0" name="list_price"/> |
752 | - <field eval="0" name="track_production"/> |
753 | - <field eval="1.0" name="standard_price"/> |
754 | <field eval="1" name="active"/> |
755 | <field name="mes_type">fixed</field> |
756 | <field name="uom_id" ref="product.product_uom_unit"/> |
757 | - <field name="name_template">FOUR WAY STRECH WT-2082 LILAC PRI IMP 1.47 63/32/05 POL/RAY</field> |
758 | - <field eval="1.0" name="uos_coeff"/> |
759 | <field name="type">product</field> |
760 | - <field eval="1" name="sale_ok"/> |
761 | - <field eval="1" name="purchase_ok"/> |
762 | - <field eval="1" name="track_outgoing"/> |
763 | <field name="company_id" ref="base.main_company"/> |
764 | <field name="name">FOUR WAY STRECH WT-2082 LILAC PRI IMP 1.47 63/32/05 POL/RAY</field> |
765 | <field name="uom_po_id" ref="product.product_uom_unit"/> |
766 | - <field eval="1.0" name="price_margin"/> |
767 | <field name="valuation">manual_periodic</field> |
768 | - <field eval="1" name="track_incoming"/> |
769 | - <field name="property_stock_production" ref="stock.location_production"/> |
770 | - <field eval="[(6,0,[])]" name="supplier_taxes_id"/> |
771 | <field name="procure_method">make_to_stock</field> |
772 | - <field name="property_stock_inventory" ref="stock.location_inventory"/> |
773 | <field name="cost_method">standard</field> |
774 | <field eval="1" name="seller_delay"/> |
775 | <field eval="7.0" name="sale_delay"/> |
776 | <field name="categ_id" ref="product.product_category_all"/> |
777 | - <field name="property_stock_procurement" ref="stock.location_procurement"/> |
778 | - <field eval="[(6,0,[])]" name="taxes_id"/> |
779 | <field eval="1.0" name="produce_delay"/> |
780 | - <field eval="0" name="rental"/> |
781 | </record> |
782 | - </data> |
783 | - <data> |
784 | + |
785 | <record id="product_product_productodemoconcontroldepedimentos4" model="product.product"> |
786 | <field name="supply_method">buy</field> |
787 | <field name="default_code">0001313</field> |
788 | - <field eval="1.0" name="list_price"/> |
789 | - <field eval="0" name="track_production"/> |
790 | - <field eval="1.0" name="standard_price"/> |
791 | - <field eval="1" name="active"/> |
792 | <field name="mes_type">fixed</field> |
793 | <field name="uom_id" ref="product.product_uom_unit"/> |
794 | - <field name="name_template">FOUR WAY STRECH WT-2082 BROWN PRI IMP 1.47 63/32/05 POL/RAY</field> |
795 | - <field eval="1.0" name="uos_coeff"/> |
796 | <field name="type">product</field> |
797 | - <field eval="1" name="sale_ok"/> |
798 | - <field eval="1" name="purchase_ok"/> |
799 | - <field eval="1" name="track_outgoing"/> |
800 | <field name="company_id" ref="base.main_company"/> |
801 | <field name="name">FOUR WAY STRECH WT-2082 BROWN PRI IMP 1.47 63/32/05 POL/RAY</field> |
802 | <field name="uom_po_id" ref="product.product_uom_unit"/> |
803 | - <field eval="1.0" name="price_margin"/> |
804 | <field name="valuation">manual_periodic</field> |
805 | - <field eval="1" name="track_incoming"/> |
806 | - <field name="property_stock_production" ref="stock.location_production"/> |
807 | - <field eval="[(6,0,[])]" name="supplier_taxes_id"/> |
808 | <field name="procure_method">make_to_stock</field> |
809 | - <field name="property_stock_inventory" ref="stock.location_inventory"/> |
810 | <field name="cost_method">standard</field> |
811 | - <field eval="1" name="seller_delay"/> |
812 | - <field eval="7.0" name="sale_delay"/> |
813 | <field name="categ_id" ref="product.product_category_all"/> |
814 | - <field name="property_stock_procurement" ref="stock.location_procurement"/> |
815 | - <field eval="[(6,0,[])]" name="taxes_id"/> |
816 | - <field eval="1.0" name="produce_delay"/> |
817 | - <field eval="0" name="rental"/> |
818 | </record> |
819 | + --> |
820 | </data> |
821 | </openerp> |
822 | |
823 | === modified file 'l10n_mx_import_info/stock.py' |
824 | --- l10n_mx_import_info/stock.py 2013-05-15 16:56:26 +0000 |
825 | +++ l10n_mx_import_info/stock.py 2013-08-05 23:13:29 +0000 |
826 | @@ -170,189 +170,15 @@ |
827 | |
828 | class stock_picking(osv.Model): |
829 | _inherit = "stock.picking" |
830 | - |
831 | - def action_invoice_create(self, cr, uid, ids, journal_id=False, |
832 | - group=False, type='out_invoice', context=None): |
833 | - # print "************AQUI ENTRO" |
834 | - # Copy & paste original function -> Add new functionallity. |
835 | - """ Creates invoice based on the invoice state selected for picking. |
836 | - @param journal_id: Id of journal |
837 | - @param group: Whether to create a group invoice or not |
838 | - @param type: Type invoice to be created |
839 | - @return: Ids of created invoices for the pickings |
840 | - """ |
841 | - if context is None: |
842 | - context = {} |
843 | - |
844 | - invoice_obj = self.pool.get('account.invoice') |
845 | - invoice_line_obj = self.pool.get('account.invoice.line') |
846 | - address_obj = self.pool.get('res.partner.address') |
847 | - invoices_group = {} |
848 | - res = {} |
849 | - inv_type = type |
850 | - for picking in self.browse(cr, uid, ids, context=context): |
851 | - if picking.invoice_state != '2binvoiced': |
852 | - continue |
853 | - payment_term_id = False |
854 | - partner = picking.address_id and picking.address_id.partner_id |
855 | - if not partner: |
856 | - raise osv.except_osv(_('Error, no partner !'), |
857 | - _('Please put a partner on the picking list if you want to generate invoice.')) |
858 | - |
859 | - if not inv_type: |
860 | - inv_type = self._get_invoice_type(picking) |
861 | - if release.version >= 6.1: |
862 | - if inv_type in ('out_invoice', 'out_refund'): |
863 | - account_id = partner.property_account_receivable.id |
864 | - payment_term_id = picking.sale_id.payment_term.id |
865 | - else: |
866 | - account_id = partner.property_account_payable.id |
867 | - |
868 | - address_contact_id, address_invoice_id = \ |
869 | - self.pool.get('res.partner').address_get(cr, uid, [ |
870 | - partner.id], ['contact', 'invoice']).values() |
871 | - address = address_obj.browse( |
872 | - cr, uid, address_contact_id, context=context) |
873 | - else: |
874 | - if inv_type in ('out_invoice', 'out_refund'): |
875 | - account_id = partner.property_account_receivable.id |
876 | - payment_term_id = self._get_payment_term(cr, uid, picking) |
877 | - else: |
878 | - account_id = partner.property_account_payable.id |
879 | - |
880 | - address_contact_id, address_invoice_id = \ |
881 | - self._get_address_invoice(cr, uid, picking).values() |
882 | - address = address_obj.browse( |
883 | - cr, uid, address_contact_id, context=context) |
884 | - |
885 | - comment = self._get_comment_invoice(cr, uid, picking) |
886 | - if group and partner.id in invoices_group: |
887 | - invoice_id = invoices_group[partner.id] |
888 | - invoice = invoice_obj.browse(cr, uid, invoice_id) |
889 | - invoice_vals = { |
890 | - 'name': (invoice.name or '') + ', ' + (picking.name or ''), |
891 | - 'origin': (invoice.origin or '') + ', ' + (picking.name \ |
892 | - or '') + (picking.origin and (':' + picking.origin) or ''), |
893 | - 'comment': (comment and (invoice.comment and invoice.\ |
894 | - comment+"\n"+comment or comment)) or (invoice.comment \ |
895 | - and invoice.comment or ''), |
896 | - 'date_invoice': context.get('date_inv', False), |
897 | - 'user_id': uid |
898 | - } |
899 | - invoice_obj.write(cr, uid, [ |
900 | - invoice_id], invoice_vals, context=context) |
901 | - else: |
902 | - invoice_vals = { |
903 | - 'name': picking.name, |
904 | - 'origin': (picking.name or '') + (picking.origin and ( |
905 | - ':' + picking.origin) or ''), |
906 | - 'type': inv_type, |
907 | - 'account_id': account_id, |
908 | - 'partner_id': address.partner_id.id, |
909 | - 'address_invoice_id': address_invoice_id, |
910 | - 'address_contact_id': address_contact_id, |
911 | - 'comment': comment, |
912 | - 'payment_term': payment_term_id, |
913 | - 'fiscal_position': partner.property_account_position.id, |
914 | - 'date_invoice': context.get('date_inv', False), |
915 | - 'company_id': picking.company_id.id, |
916 | - 'user_id': uid |
917 | - } |
918 | - cur_id = self.get_currency_id(cr, uid, picking) |
919 | - if cur_id: |
920 | - invoice_vals['currency_id'] = cur_id |
921 | - if journal_id: |
922 | - invoice_vals['journal_id'] = journal_id |
923 | - invoice_id = invoice_obj.create(cr, uid, invoice_vals, |
924 | - context=context) |
925 | - invoices_group[partner.id] = invoice_id |
926 | - res[picking.id] = invoice_id |
927 | - for move_line in picking.move_lines: |
928 | - if move_line.state == 'cancel': |
929 | - continue |
930 | - origin = move_line.picking_id.name or '' |
931 | - if move_line.picking_id.origin: |
932 | - origin += ':' + move_line.picking_id.origin |
933 | - if group: |
934 | - name = (picking.name or '') + '-' + move_line.name |
935 | - else: |
936 | - name = move_line.name |
937 | - |
938 | - if inv_type in ('out_invoice', 'out_refund'): |
939 | - account_id = move_line.product_id.product_tmpl_id.\ |
940 | - property_account_income.id |
941 | - if not account_id: |
942 | - account_id = move_line.product_id.categ_id.\ |
943 | - property_account_income_categ.id |
944 | - else: |
945 | - account_id = move_line.product_id.product_tmpl_id.\ |
946 | - property_account_expense.id |
947 | - if not account_id: |
948 | - account_id = move_line.product_id.categ_id.\ |
949 | - property_account_expense_categ.id |
950 | - |
951 | - price_unit = self._get_price_unit_invoice(cr, uid, |
952 | - move_line, inv_type) |
953 | - discount = self._get_discount_invoice(cr, uid, move_line) |
954 | - tax_ids = self._get_taxes_invoice(cr, uid, move_line, inv_type) |
955 | - account_analytic_id = self._get_account_analytic_invoice( |
956 | - cr, uid, picking, move_line) |
957 | - |
958 | - # set UoS if it's a sale and the picking doesn't have one |
959 | - uos_id = move_line.product_uos and move_line.product_uos.id or False |
960 | - if not uos_id and inv_type in ('out_invoice', 'out_refund'): |
961 | - uos_id = move_line.product_uom.id |
962 | - account_id = self.pool.get('account.fiscal.position').map_account( |
963 | - cr, uid, partner.property_account_position, account_id) |
964 | - invoice_line_id = invoice_line_obj.create(cr, uid, { |
965 | - 'name': name, |
966 | - 'origin': origin, |
967 | - 'invoice_id': invoice_id, |
968 | - 'uos_id': uos_id, |
969 | - 'product_id': move_line.product_id.id, |
970 | - 'account_id': account_id, |
971 | - 'price_unit': price_unit, |
972 | - 'discount': discount, |
973 | - 'quantity': move_line.product_uos_qty or move_line.product_qty, |
974 | - 'invoice_line_tax_id': [(6, 0, tax_ids)], |
975 | - 'account_analytic_id': account_analytic_id, |
976 | - # Start Custom Code |
977 | - 'move_id': move_line.id, |
978 | - 'tracking_id': move_line.tracking_id and move_line.\ |
979 | - tracking_id.id, |
980 | - # End Custom Code |
981 | - }, context=context) |
982 | - self._invoice_line_hook(cr, uid, move_line, invoice_line_id) |
983 | - |
984 | - invoice_obj.button_compute(cr, uid, [invoice_id], context=context, |
985 | - set_total=(inv_type in ('in_invoice', 'in_refund'))) |
986 | - self.write(cr, uid, [picking.id], { |
987 | - 'invoice_state': 'invoiced', |
988 | - }, context=context) |
989 | - self._invoice_hook(cr, uid, picking, invoice_id) |
990 | - self.write(cr, uid, res.keys(), { |
991 | - 'invoice_state': 'invoiced', |
992 | - }, context=context) |
993 | - return res |
994 | - |
995 | -""" |
996 | -class stock_picking(osv.Model): |
997 | - _inherit = 'stock.picking' |
998 | - |
999 | - def action_invoice_create(self, cr, uid, ids, journal_id=False, |
1000 | - group=False, type='out_invoice', context=None): |
1001 | - invoice_obj = self.pool.get('account.invoice') |
1002 | - res = super(stock_picking, self).action_invoice_create(cr, uid, ids, |
1003 | - journal_id, group, type, context=context) |
1004 | - for picking_id in res.keys(): |
1005 | - invoice_id = res[picking_id] |
1006 | - picking = self.browse(cr, uid, [picking_id], context=context)[0] |
1007 | - "SELECT id, product_id FROM account_invoice_line" |
1008 | - |
1009 | - #invoice_obj.write(cr, uid, [invoice_id] { |
1010 | - #'picking_id': picking_id, |
1011 | - #'tracking_id': picking.tracking_id, |
1012 | - #}) |
1013 | - #res[picking.id] = invoice_id |
1014 | - return res |
1015 | -""" |
1016 | + |
1017 | + def _prepare_invoice_line(self, cr, uid, group, picking, move_line, invoice_id, |
1018 | + invoice_vals, context=None): |
1019 | + invoice_line_data = super(stock_picking, self)._prepare_invoice_line(cr, uid, group, picking, move_line, invoice_id, |
1020 | + invoice_vals, context=context) |
1021 | + invoice_line_data.update({ |
1022 | + 'move_id': move_line.id, |
1023 | + 'tracking_id': move_line.tracking_id and move_line.\ |
1024 | + tracking_id.id, |
1025 | + }) |
1026 | + return invoice_line_data |
1027 | + |
1028 | |
1029 | === modified file 'l10n_mx_ir_attachment_facturae/__openerp__.py' |
1030 | --- l10n_mx_ir_attachment_facturae/__openerp__.py 2013-07-16 22:00:59 +0000 |
1031 | +++ l10n_mx_ir_attachment_facturae/__openerp__.py 2013-08-05 23:13:29 +0000 |
1032 | @@ -31,7 +31,7 @@ |
1033 | "website" : "http://www.vauxoo.com/", |
1034 | "license" : "AGPL-3", |
1035 | "depends" : ["account", "mail", "email_template", |
1036 | - "l10n_mx_facturae_groups" |
1037 | + "l10n_mx_facturae_groups", "l10n_mx_facturae_seq" |
1038 | ], |
1039 | "demo" : ["demo/l10n_mx_facturae_email_demo.xml", |
1040 | ], |
1041 | |
1042 | === modified file 'l10n_mx_ir_attachment_facturae/invoice.py' |
1043 | --- l10n_mx_ir_attachment_facturae/invoice.py 2013-05-15 17:47:57 +0000 |
1044 | +++ l10n_mx_ir_attachment_facturae/invoice.py 2013-08-05 23:13:29 +0000 |
1045 | @@ -58,7 +58,7 @@ |
1046 | def create_ir_attachment_facturae(self, cr, uid, ids, context=None): |
1047 | ir_attach_obj = self.pool.get('ir.attachment.facturae.mx') |
1048 | invoice = self.browse(cr, uid, ids, context=context)[0] |
1049 | - if invoice.invoice_sequence_id.approval_id: |
1050 | + if invoice._columns.has_key('invoice_sequence_id') and invoice.invoice_sequence_id and invoice.invoice_sequence_id.approval_id:#FIX: Just in runbot generate a bug of field no exists in account.invoice model. |
1051 | if invoice.invoice_sequence_id.approval_id.type == 'cfdi32': |
1052 | pac = self.pool.get('params.pac').search( |
1053 | cr, uid, [('active', '=', True)], context) |
1054 | |
1055 | === modified file 'l10n_mx_ir_attachment_facturae/ir_attachment_facturae.py' |
1056 | --- l10n_mx_ir_attachment_facturae/ir_attachment_facturae.py 2013-06-25 23:25:06 +0000 |
1057 | +++ l10n_mx_ir_attachment_facturae/ir_attachment_facturae.py 2013-08-05 23:13:29 +0000 |
1058 | @@ -94,19 +94,20 @@ |
1059 | wf_service = netsvc.LocalService("workflow") |
1060 | wf_service.trg_validate( |
1061 | uid, 'ir.attachment.facturae.mx', attach, 'action_sign', cr) |
1062 | - cr.commit() |
1063 | + #TODO: Remplazar los commit y los traceback por un mail.message |
1064 | + #cr.commit() |
1065 | wf_service.trg_validate( |
1066 | uid, 'ir.attachment.facturae.mx', attach, 'action_printable', cr) |
1067 | - cr.commit() |
1068 | + #cr.commit() |
1069 | wf_service.trg_validate( |
1070 | uid, 'ir.attachment.facturae.mx', attach, 'action_send_backup', cr) |
1071 | - cr.commit() |
1072 | + #cr.commit() |
1073 | wf_service.trg_validate( |
1074 | uid, 'ir.attachment.facturae.mx', attach, 'action_send_customer', cr) |
1075 | - cr.commit() |
1076 | + #cr.commit() |
1077 | wf_service.trg_validate( |
1078 | uid, 'ir.attachment.facturae.mx', attach, 'action_done', cr) |
1079 | - cr.commit() |
1080 | + #cr.commit() |
1081 | |
1082 | ir_model_data = self.pool.get('ir.model.data') |
1083 | |
1084 | @@ -222,24 +223,27 @@ |
1085 | (fileno, fname) = tempfile.mkstemp( |
1086 | '.pdf', 'openerp_' + (False or '') + '__facturae__') |
1087 | os.close(fileno) |
1088 | - file = invoice_obj.create_report(cr, uid, [invoice.id], |
1089 | + freport = invoice_obj.create_report(cr, uid, [invoice.id], |
1090 | "account.invoice.facturae.webkit", fname) |
1091 | - adjuntos = self.pool.get('ir.attachment').search(cr, uid, |
1092 | - [('res_model', '=', 'account.invoice'), ('res_id', '=', invoice), |
1093 | + #file = invoice_obj.create_report(cr, uid, [invoice.id], |
1094 | + #"account.invoice", fname) |
1095 | + attachment_ids = self.pool.get('ir.attachment').search(cr, uid, |
1096 | + [('res_model', '=', 'account.invoice'), ('res_id', '=', invoice.id), |
1097 | ('datas_fname', '=', invoice.fname_invoice+'.pdf')]) |
1098 | - for attachment in self.browse(cr, uid, adjuntos, context): |
1099 | - aids = attachment.id |
1100 | - self.pool.get('ir.attachment').write(cr, uid, attachment.id, { |
1101 | + for attachment in self.browse(cr, uid, attachment_ids, context=context): |
1102 | + aids = attachment.id #TODO: aids.append( attachment.id ) but without error in last write |
1103 | + self.pool.get('ir.attachment').write(cr, uid, [attachment.id], { |
1104 | 'name': invoice.fname_invoice + '.pdf', }, context={}) |
1105 | if aids: |
1106 | msj = _("Attached Successfully PDF\n") |
1107 | else: |
1108 | msj = _("Not Attached PDF\n") |
1109 | - return self.write(cr, uid, ids, { |
1110 | + writed = self.write(cr, uid, ids, { |
1111 | 'state': 'printable', |
1112 | 'file_pdf': aids or False, |
1113 | 'msj': msj, |
1114 | 'last_date': time.strftime('%Y-%m-%d %H:%M:%S')}, context=context) |
1115 | + return writed |
1116 | |
1117 | def action_send_customer(self, cr, uid, ids, context=None): |
1118 | attachments = [] |
1119 | @@ -319,7 +323,7 @@ |
1120 | adjuntos = self.pool.get('ir.attachment').search(cr, uid, [( |
1121 | 'res_model', '=', 'account.invoice'), ('res_id', '=', invoice)]) |
1122 | for attachment in self.browse(cr, uid, adjuntos, context): |
1123 | - ids2 = attach_obj.write(cr, uid, attachment.id, { |
1124 | + ids2 = attach_obj.write(cr, uid, [attachment.id], { |
1125 | 'res_id': False, }, context={}) |
1126 | return self.write(cr, uid, ids, |
1127 | {'state': 'cancel', |
1128 | |
1129 | === modified file 'l10n_mx_partner_address/demo/l10n_mx_partner_address_demo.xml' |
1130 | --- l10n_mx_partner_address/demo/l10n_mx_partner_address_demo.xml 2013-04-17 22:12:03 +0000 |
1131 | +++ l10n_mx_partner_address/demo/l10n_mx_partner_address_demo.xml 2013-08-05 23:13:29 +0000 |
1132 | @@ -3,42 +3,44 @@ |
1133 | <data noupdate="1"> |
1134 | |
1135 | <record id="res_partner_address_vauxoo_0" model="res.partner"> |
1136 | - <field name="name">Vauxoo</field> |
1137 | + <field name="name">VAUXOO S.A. de C.V.</field> |
1138 | <field eval="1" name="customer"/> |
1139 | <field name="is_company">1</field> |
1140 | - <field name="street">valle de señora</field> |
1141 | - <field name="street2">valle del campestre</field> |
1142 | - <field name="l10n_mx_street3">244</field> |
1143 | - <field name="l10n_mx_street4">103</field> |
1144 | - <field name="zip">37150</field> |
1145 | - <field name="l10n_mx_city2">Leon de los Aldama</field> |
1146 | - <field name="city">Leon</field> |
1147 | - <field name="state_id" ref="l10n_mx_states.res_country_state_mx_gto" model="res.country.state"/> |
1148 | + <field name="street">Campobasso Norte</field> |
1149 | + <field name="street2">Fraccionamiento Montecarlo</field> |
1150 | + <field name="l10n_mx_street3">3206</field> |
1151 | + <field name="l10n_mx_street4">9000</field> |
1152 | + <field name="zip">85134</field> |
1153 | + <field name="l10n_mx_city2">Ciudad Obregón</field> |
1154 | + <field name="city">Cajeme</field> |
1155 | + <field name="state_id" ref="l10n_mx_states.res_country_state_mx_son" model="res.country.state"/> |
1156 | <field name="country_id" ref="base.mx"/> |
1157 | - <field name="type">invoice</field> |
1158 | - <field name="email">info@vauxoo.com</field> |
1159 | - <field name="phone">477-773-3346</field> |
1160 | - <field name="vat">MXWOG0507257V9</field> |
1161 | + <!--<field name="type">invoice</field>--> |
1162 | + <field name="email">info(at)vauxoo.com</field> |
1163 | + <field name="phone"></field> |
1164 | + <field name="vat">MXVAU111017CG9</field> |
1165 | </record> |
1166 | |
1167 | <record id="res_partner_address_vauxoo_1" model="res.partner"> |
1168 | - <field name="name">Vauxoo</field> |
1169 | - <field eval="1" name="customer"/> |
1170 | - <field name="street">valle de señora</field> |
1171 | - <field name="street2">valle del campestre</field> |
1172 | - <field name="l10n_mx_street3">244</field> |
1173 | - <field name="l10n_mx_street4">103</field> |
1174 | - <field name="l10n_mx_city2">Leon de los Aldama</field> |
1175 | - <field name="zip">37150</field> |
1176 | - <field name="city">Leon</field> |
1177 | - <field name="state_id" ref="l10n_mx_states.res_country_state_mx_gto" model="res.country.state"/> |
1178 | - <field name="country_id" ref="base.mx"/> |
1179 | - <field name="type">invoice</field> |
1180 | - <field name="email">info@vauxoo.com</field> |
1181 | - <field name="phone">477-773-3346</field> |
1182 | + <field name="name">Alejandro Negrin</field> |
1183 | + <field eval="1" name="use_parent_address"/> |
1184 | <field name="parent_id" ref="res_partner_address_vauxoo_0"/> |
1185 | - <field eval="1" name="use_parent_address"/> |
1186 | + <!-- |
1187 | + <field eval="1" name="customer"/> |
1188 | + <field name="street">valle de señora</field> |
1189 | + <field name="street2">valle del campestre</field> |
1190 | + <field name="l10n_mx_street3">244</field> |
1191 | + <field name="l10n_mx_street4">103</field> |
1192 | + <field name="l10n_mx_city2">Leon de los Aldama</field> |
1193 | + <field name="zip">37150</field> |
1194 | + <field name="city">Leon</field> |
1195 | + <field name="state_id" ref="l10n_mx_states.res_country_state_mx_gto" model="res.country.state"/> |
1196 | + <field name="country_id" ref="base.mx"/> |
1197 | + <field name="type">invoice</field> |
1198 | + <field name="email">info(at)vauxoo.com</field> |
1199 | + <field name="phone">477-773-3346</field> |
1200 | <field name="vat">MXWOG0507257V9</field> |
1201 | + --> |
1202 | </record> |
1203 | |
1204 | </data> |
1205 | |
1206 | === modified file 'l10n_mx_payment_method/invoice_view.xml' |
1207 | --- l10n_mx_payment_method/invoice_view.xml 2013-06-28 22:52:28 +0000 |
1208 | +++ l10n_mx_payment_method/invoice_view.xml 2013-08-05 23:13:29 +0000 |
1209 | @@ -9,8 +9,22 @@ |
1210 | <field name="arch" type="xml"> |
1211 | <field name="fiscal_position" position="after"> |
1212 | <newline/> |
1213 | - <field name="pay_method_id" colspan="2" groups="l10n_mx_facturae_groups.group_l10n_mx_facturae_user"/> |
1214 | - <field name="acc_payment" colspan="2" domain = "[('partner_id', '=', partner_id)]" groups="l10n_mx_facturae_groups.group_l10n_mx_facturae_user"/> |
1215 | + <field name="pay_method_id" colspan="2" groups="l10n_mx_facturae_groups.group_l10n_mx_facturae_user"/> |
1216 | + <field name="acc_payment" colspan="2" domain = "[('partner_id', '=', partner_id)]" groups="l10n_mx_facturae_groups.group_l10n_mx_facturae_user"/> |
1217 | + </field> |
1218 | + </field> |
1219 | + </record> |
1220 | + |
1221 | + |
1222 | + <record model="ir.ui.view" id="view_account_invoice_supplier_form_inh_payment_method_22"> |
1223 | + <field name="name">view.account.invoice.supplier.form.inh.payment_method_22</field> |
1224 | + <field name="model">account.invoice</field> |
1225 | + <field name="inherit_id" ref="account.invoice_supplier_form"/> |
1226 | + <field name="arch" type="xml"> |
1227 | + <field name="fiscal_position" position="after"> |
1228 | + <newline/> |
1229 | + <field name="pay_method_id" colspan="2" groups="l10n_mx_facturae_groups.group_l10n_mx_facturae_user"/> |
1230 | + <field name="acc_payment" colspan="2" domain = "[('partner_id', '=', partner_id)]" groups="l10n_mx_facturae_groups.group_l10n_mx_facturae_user"/> |
1231 | </field> |
1232 | </field> |
1233 | </record> |
1234 | |
1235 | === modified file 'l10n_mx_regimen_fiscal/__openerp__.py' |
1236 | --- l10n_mx_regimen_fiscal/__openerp__.py 2013-07-16 22:00:59 +0000 |
1237 | +++ l10n_mx_regimen_fiscal/__openerp__.py 2013-08-05 23:13:29 +0000 |
1238 | @@ -37,7 +37,7 @@ |
1239 | "license" : "AGPL-3", |
1240 | "depends" : ["account", "l10n_mx_facturae_groups", |
1241 | ], |
1242 | - "demo" : [], |
1243 | + "demo" : ["demo/l10n_mx_regimen_fiscal_demo.xml",], |
1244 | "data" : [ |
1245 | #"security/regimen_fiscal.xml", |
1246 | "security/ir.model.access.csv", |
1247 | |
1248 | === added directory 'l10n_mx_regimen_fiscal/demo' |
1249 | === added file 'l10n_mx_regimen_fiscal/demo/l10n_mx_regimen_fiscal_demo.xml' |
1250 | --- l10n_mx_regimen_fiscal/demo/l10n_mx_regimen_fiscal_demo.xml 1970-01-01 00:00:00 +0000 |
1251 | +++ l10n_mx_regimen_fiscal/demo/l10n_mx_regimen_fiscal_demo.xml 2013-08-05 23:13:29 +0000 |
1252 | @@ -0,0 +1,10 @@ |
1253 | +<?xml version="1.0" ?> |
1254 | +<openerp> |
1255 | + <data noupdate="1"> |
1256 | + |
1257 | + <record id="base.main_partner" model="res.partner"> |
1258 | + <field name="regimen_fiscal_id" ref="regimen_fiscal_personasmoralesdelrgimengeneral0"/> |
1259 | + </record> |
1260 | + |
1261 | + </data> |
1262 | +</openerp> |