Merge lp:~icsergio/openobject-italia/fix_sequential_dates_61 into lp:~openobject-italia-core-devs/openobject-italia/italian-addons-6.1
- fix_sequential_dates_61
- Merge into italian-addons-6.1
Status: | Merged |
---|---|
Merged at revision: | 239 |
Proposed branch: | lp:~icsergio/openobject-italia/fix_sequential_dates_61 |
Merge into: | lp:~openobject-italia-core-devs/openobject-italia/italian-addons-6.1 |
Diff against target: |
117 lines (+63/-13) 3 files modified
l10n_it_account/__openerp__.py (+2/-1) l10n_it_account/account/invoice.py (+33/-12) l10n_it_account/account/invoice_view.xml (+28/-0) |
To merge this branch: | bzr merge lp:~icsergio/openobject-italia/fix_sequential_dates_61 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Leonardo Pistone (community) | Needs Information | ||
Lorenzo Battistini | Approve | ||
Review via email: mp+184182@code.launchpad.net |
Commit message
Description of the change
- 240. By Sergio Corato
-
[FIX] view correction
- 241. By Sergio Corato
-
[FIX] view correction
Sergio Corato (icsergio) wrote : | # |
Dal contabile in fase di registrazione fattura d'acquisto
2013/9/6 Lorenzo Battistini - Agile BG <email address hidden>
> Review: Needs Information
>
> Il nuovo campo 'supplier_
> --
>
> https:/
> You are the owner of
> lp:~icsergio/openobject-italia/fix_sequential_dates_61.
>
Lorenzo Battistini (elbati) wrote : | # |
On 09/06/2013 01:09 PM, Sergio Corato wrote:
> Dal contabile in fase di registrazione fattura d'acquisto
Non lo vedo comparire in alcuna view. Probabilmente manca il file
account/
- 242. By Sergio Corato
-
[FIX] add missing xml
Sergio Corato (icsergio) wrote : | # |
piccola dimenticanza, non avevo fatto il bzr add * :)
- 243. By Sergio Corato
-
[FIX] registration of a sale invoice in state draft after cancel, with already a number
Lorenzo Battistini (elbati) wrote : | # |
Come mai la parte relativa alle 'in_invoice' e 'in_refund' è stata messa in 'action_
Sergio Corato (icsergio) wrote : | # |
Il 09/09/2013 08:20, Lorenzo Battistini - Agile BG ha scritto:
> Review: Needs Information
>
> Come mai la parte relativa alle 'in_invoice' e 'in_refund' è stata messa in 'action_
>
uhm, mi pareva non ci fossero tutte le variabili necessarie...
Ri-verifico.
--
Sergio Corato
IcsTools.it
web : www.icstools.it
skype : sergiocorato
mail : <email address hidden>
Sergio Corato (icsergio) wrote : | # |
Il 09/09/2013 13:36, Sergio Corato ha scritto:
> Il 09/09/2013 08:20, Lorenzo Battistini - Agile BG ha scritto:
>> Review: Needs Information
>>
>> Come mai la parte relativa alle 'in_invoice' e 'in_refund' è stata messa in 'action_
>>
> uhm, mi pareva non ci fossero tutte le variabili necessarie...
> Ri-verifico.
>
Ok, ho committato, dovrebbe essere meglio così.
--
Sergio Corato
IcsTools.it
web : www.icstools.it
skype : sergiocorato
mail : <email address hidden>
- 244. By Sergio Corato
-
[FIX] code improvements
Lorenzo Battistini (elbati) wrote : | # |
line 51 e 39: 'inv_type = obj_inv.type' è presente due volte
line 63: come mai c'è 'xxxx'?
- 245. By Sergio Corato
-
[FIX] typo error
Sergio Corato (icsergio) wrote : | # |
Il 10/09/2013 09:02, Lorenzo Battistini - Agile BG ha scritto:
> Review: Needs Fixing
>
> line 51 e 39: 'inv_type = obj_inv.type' è presente due volte
> line 63: come mai c'è 'xxxx'?
>
ops, sistemato
--
Sergio Corato
IcsTools.it
web : www.icstools.it
skype : sergiocorato
mail : <email address hidden>
Lorenzo Battistini (elbati) wrote : | # |
Grazie!
Per non lasciare nuove funzionalità solo su versioni vecchie, riesci a proporre le stesse modifiche su 'account_
Sergio Corato (icsergio) wrote : | # |
Il 11/09/2013 11:56, Lorenzo Battistini - Agile BG ha scritto:
> Review: Approve
>
> Grazie!
>
e grazie a te!
> Per non lasciare nuove funzionalità solo su versioni vecchie, riesci a proporre le stesse modifiche su 'account_
>
penso di sì
--
Sergio Corato
IcsTools.it
web : www.icstools.it
skype : sergiocorato
mail : <email address hidden>
Leonardo Pistone (lepistone) wrote : | # |
Ciao Sergio, Lorenzo
scusate se scrivo dopo il merge, mi sono accorto ora.
È corretto aggiungere una dipendenza?
Grazie!
Sergio Corato (icsergio) wrote : | # |
Il 18/09/2013 16:27, Leonardo Pistone - Agile BG ha scritto:
> Review: Needs Information
>
> Ciao Sergio, Lorenzo
>
> scusate se scrivo dopo il merge, mi sono accorto ora.
> È corretto aggiungere una dipendenza?
>
> Grazie!
>
Ciao Leonardo,
serve perchè questo modulo controlla la correttezza anche tramite il
campo registration_date che c'è nel modulo in dipendenza.
Si è appunto scelto di tenere separato questi controlli dal modulo
account_
Comunque se hai altri idee, siamo qua :D
--
Sergio Corato
IcsTools.it
web : www.icstools.it
skype : sergiocorato
mail : <email address hidden>
Leonardo Pistone (lepistone) wrote : | # |
Sergio,
Mi chiedevo solo se era una dimenticanza o ora una cosa pensata, se è pensata, OK!
grazie! leo
Preview Diff
1 | === modified file 'l10n_it_account/__openerp__.py' |
2 | --- l10n_it_account/__openerp__.py 2013-05-07 12:26:04 +0000 |
3 | +++ l10n_it_account/__openerp__.py 2013-09-10 11:40:17 +0000 |
4 | @@ -33,9 +33,10 @@ |
5 | 'author': 'OpenERP Italian Community', |
6 | 'website': 'http://www.openerp-italia.org', |
7 | 'license': 'AGPL-3', |
8 | - "depends" : ['account','base_vat','account_chart','base_iban', 'l10n_it_base'], |
9 | + "depends" : ['account','base_vat','account_chart','base_iban', 'l10n_it_base','account_invoice_entry_date'], |
10 | "init_xml": [ |
11 | 'account/partner_view.xml', |
12 | + 'account/invoice_view.xml', |
13 | 'wizard/fiscalcode_to_data_view.xml', |
14 | ], |
15 | "update_xml" : [], |
16 | |
17 | === modified file 'l10n_it_account/account/invoice.py' |
18 | --- l10n_it_account/account/invoice.py 2013-03-13 10:12:16 +0000 |
19 | +++ l10n_it_account/account/invoice.py 2013-09-10 11:40:17 +0000 |
20 | @@ -22,31 +22,52 @@ |
21 | import netsvc |
22 | import pooler, tools |
23 | |
24 | -from osv import fields, osv |
25 | +from openerp.osv import fields, orm |
26 | from tools.translate import _ |
27 | |
28 | -class account_invoice(osv.osv): |
29 | +class account_invoice(orm.Model): |
30 | |
31 | _inherit = 'account.invoice' |
32 | + _columns = { |
33 | + 'supplier_invoice_number': fields.char('Supplier invoice nr', size=16), |
34 | + } |
35 | |
36 | def action_number(self, cr, uid, ids, context=None): |
37 | super(account_invoice, self).action_number(cr, uid, ids, context) |
38 | for obj_inv in self.browse(cr, uid, ids): |
39 | inv_type = obj_inv.type |
40 | - if inv_type == 'in_invoice' or inv_type == 'in_refund': |
41 | - return True |
42 | number = obj_inv.number |
43 | date_invoice = obj_inv.date_invoice |
44 | + reg_date = obj_inv.registration_date |
45 | journal = obj_inv.journal_id.id |
46 | - res = self.search(cr, uid, [('type','=',inv_type),('date_invoice','>',date_invoice), |
47 | - ('number', '<', number), ('journal_id','=',journal)]) |
48 | - if res: |
49 | - raise osv.except_osv(_('Date Inconsistency'), |
50 | + date_start = obj_inv.registration_date or obj_inv.date_invoice or time.strftime('%Y-%m-%d') |
51 | + date_stop = obj_inv.registration_date or obj_inv.date_invoice or time.strftime('%Y-%m-%d') |
52 | + period_ids = self.pool.get('account.period').search( |
53 | + cr, uid, [('date_start','<=',date_start),('date_stop','>=',date_stop), |
54 | + ('company_id', '=', obj_inv.company_id.id)]) |
55 | + if inv_type == 'out_invoice' or inv_type == 'out_refund': |
56 | + #check if another invoice with a minor number and a superior date_invoice is posted |
57 | + res = self.search(cr, uid, [('type','=',inv_type),('date_invoice','>',date_invoice), |
58 | + ('number', '<', number), ('journal_id','=',journal),('period_id','in',period_ids)]) |
59 | + if res: |
60 | + raise orm.except_orm(_('Date Inconsistency'), |
61 | + _('Cannot create invoice! Post the invoice with a greater date')) |
62 | + if inv_type == 'in_invoice' or inv_type == 'in_refund': |
63 | + #check if an invoice with a superior registration_date is posted |
64 | + res = self.search(cr, uid, [('type','=',inv_type),('registration_date','>',reg_date), |
65 | + ('journal_id','=',journal),('period_id','in',period_ids)], context=context) |
66 | + if res: |
67 | + raise orm.except_orm(_('Date Inconsistency'), |
68 | _('Cannot create invoice! Post the invoice with a greater date')) |
69 | + #check duplication (only supplier's invoices) |
70 | + supplier_invoice_number = obj_inv.supplier_invoice_number |
71 | + partner_id = obj_inv.partner_id.id |
72 | + res = self.search(cr, uid, [('type','=',inv_type),('date_invoice','=',date_invoice), |
73 | + ('journal_id','=',journal),('supplier_invoice_number','=',supplier_invoice_number), |
74 | + ('partner_id','=',partner_id),('state','not in',('draft','cancel'))], context=context) |
75 | + if res: |
76 | + raise orm.except_orm(_('Invoice Duplication'), |
77 | + _('Invoice already posted!')) |
78 | return True |
79 | - |
80 | -account_invoice() |
81 | - |
82 | - |
83 | |
84 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
85 | |
86 | === added file 'l10n_it_account/account/invoice_view.xml' |
87 | --- l10n_it_account/account/invoice_view.xml 1970-01-01 00:00:00 +0000 |
88 | +++ l10n_it_account/account/invoice_view.xml 2013-09-10 11:40:17 +0000 |
89 | @@ -0,0 +1,28 @@ |
90 | +<?xml version="1.0" encoding="utf-8"?> |
91 | +<openerp> |
92 | + <data> |
93 | + |
94 | + <record id="invoice_tree_reg_date" model="ir.ui.view"> |
95 | + <field name="name">account.invoice.tree.reg_date</field> |
96 | + <field name="model">account.invoice</field> |
97 | + <field name="inherit_id" ref="account.invoice_tree"/> |
98 | + <field name="arch" type="xml"> |
99 | + <field name="date_invoice" position="after"> |
100 | + <field name="supplier_invoice_number" invisible="context.get('type') == 'out_invoice'"/> |
101 | + </field> |
102 | + </field> |
103 | + </record> |
104 | + |
105 | + <record id="invoice_supplier_form_reg_date" model="ir.ui.view"> |
106 | + <field name="name">account.invoice.supplier.form.reg_date</field> |
107 | + <field name="model">account.invoice</field> |
108 | + <field name="inherit_id" ref="account.invoice_supplier_form"/> |
109 | + <field name="arch" type="xml"> |
110 | + <field name="date_invoice" position="after"> |
111 | + <field name="supplier_invoice_number" attrs="{'readonly':[('state','!=','draft')]}"/> |
112 | + </field> |
113 | + </field> |
114 | + </record> |
115 | + |
116 | + </data> |
117 | +</openerp> |
Il nuovo campo 'supplier_ invoice_ number' quando e come viene riempito?