Merge lp:~danimaribeiro/openerp.pt-br-localiz/openerp.pt-br-localiz into lp:~openerp-brazil-core-team/openerp.pt-br-localiz/openerp.pt-br-localiz-v7.0

Proposed by Danimar Ribeiro
Status: Merged
Approved by: Renato Lima - http://www.akretion.com
Approved revision: 547
Merged at revision: 546
Proposed branch: lp:~danimaribeiro/openerp.pt-br-localiz/openerp.pt-br-localiz
Merge into: lp:~openerp-brazil-core-team/openerp.pt-br-localiz/openerp.pt-br-localiz-v7.0
Diff against target: 88 lines (+15/-6)
5 files modified
l10n_br_account/account_invoice.py (+2/-2)
l10n_br_account/l10n_br_account.py (+9/-1)
l10n_br_account/l10n_br_account_view.xml (+1/-0)
l10n_br_account_payment_extension/account_move_line.py (+2/-2)
l10n_br_sale/sale.py (+1/-1)
To merge this branch: bzr merge lp:~danimaribeiro/openerp.pt-br-localiz/openerp.pt-br-localiz
Reviewer Review Type Date Requested Status
Renato Lima - http://www.akretion.com Approve
Review via email: mp+167682@code.launchpad.net

Description of the change

Fixed problem converting prospects to sales order. Other problem with the type of a related field and a misspelled word.

To post a comment you must log in.
546. By Danimar Ribeiro

Implemented new field 'justificative' to the class l10n_br_account_invoice_invalid_number.

Revision history for this message
Renato Lima - http://www.akretion.com (renatonlima) wrote :

Olá Danimar,

Você poderia fazer um revert apenas do l10n_br_sale/sale.py? porque a sua solução não esta correta, pois o ["id"] do retorno do método read é do objeto (sale.shop) e não do fiscal_category_id. O Carlos Almeida já corrigiu isso e pediu o merge. O restante parece que esta tudo ok! assim que você fizer o revert do l10n_br_sale/sale.py da sua branch eu faço o merge.

Obrigado pela contribuição,

Renato Lima - http://www.akretion.com/pt-BR

review: Needs Fixing
547. By Danimar Ribeiro

Reverted changes to l10n_br_sale/sale.py

Revision history for this message
Danimar Ribeiro (danimaribeiro) wrote :

Olá Renato.
Efetuei novo commit revertendo as alterações desta classe.

Apenas uma duvida: eu estava utilizando no read ["default_fc_id.id"] , ou seja a meu ver isso retorna o id já da relação? ou isso não funciona?

Abraços.

Revision history for this message
Renato Lima - http://www.akretion.com (renatonlima) wrote :

Se você fizer um:

self.pool.get("sale.shop").read(cr, uid, [shop_id], ["default_fc_id"])

Ele vai retornar isso:

[{'default_fc_id': (13, u'Venda'), 'id': 1}]

A chave id é o o campo sale.shop.id

Revision history for this message
Renato Lima - http://www.akretion.com (renatonlima) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'l10n_br_account/account_invoice.py'
2--- l10n_br_account/account_invoice.py 2013-05-15 20:43:19 +0000
3+++ l10n_br_account/account_invoice.py 2013-06-14 13:46:30 +0000
4@@ -729,8 +729,8 @@
5 fcategory.property_journal.id or False
6 if not result['value'].get('journal_id', False):
7 raise orm.except_orm(
8- _('Nenhuma Diário !'),
9- _("Categoria fisca: '%s', não tem um diário contábil para a \
10+ _('Nenhum Diário !'),
11+ _("Categoria fiscal: '%s', não tem um diário contábil para a \
12 empresa %s") % (fcategory.name, obj_company.name))
13
14 obj_fp_rule = self.pool.get('account.fiscal.position.rule')
15
16=== modified file 'l10n_br_account/l10n_br_account.py'
17--- l10n_br_account/l10n_br_account.py 2013-04-16 13:39:09 +0000
18+++ l10n_br_account/l10n_br_account.py 2013-06-14 13:46:30 +0000
19@@ -230,6 +230,8 @@
20 'state': fields.selection(
21 [('draft', 'Rascunho'), ('cancel', 'Cancelado'),
22 ('done', u'Concluído')], 'Status', required=True),
23+ 'justificative': fields.char('Justificativa', size=255,
24+ readonly=True, states={'draft': [('readonly', False)]}, required=True),
25 }
26 _defaults = {
27 'state': 'draft',
28@@ -243,6 +245,11 @@
29 u'Sequência existente!'),
30 ]
31
32+ def _check_justificative(self, cr,uid, ids):
33+ for invalid in self.browse(cr, uid, ids):
34+ if len(invalid.justificative) < 15:return False
35+ return True
36+
37 def _check_range(self, cursor, user, ids, context=None):
38 for invalid_number in self.browse(cursor, user, ids, context=context):
39 where = []
40@@ -264,7 +271,8 @@
41
42 _constraints = [
43 (_check_range, u'Não é permitido faixas sobrepostas!',
44- ['number_start', 'number_end'])
45+ ['number_start', 'number_end']),
46+ (_check_justificative,'Justificativa deve ter tamanho minimo de 15 caracteres.', ['justificative'])
47 ]
48
49 def action_draft_done(self, cr, uid, ids, *args):
50
51=== modified file 'l10n_br_account/l10n_br_account_view.xml'
52--- l10n_br_account/l10n_br_account_view.xml 2013-04-16 13:39:09 +0000
53+++ l10n_br_account/l10n_br_account_view.xml 2013-06-14 13:46:30 +0000
54@@ -185,6 +185,7 @@
55 <field name="document_serie_id"/>
56 <field name="number_start"/>
57 <field name="number_end"/>
58+ <field name="justificative"/>
59 </group>
60 </form>
61 </field>
62
63=== modified file 'l10n_br_account_payment_extension/account_move_line.py'
64--- l10n_br_account_payment_extension/account_move_line.py 2013-01-29 03:08:16 +0000
65+++ l10n_br_account_payment_extension/account_move_line.py 2013-06-14 13:46:30 +0000
66@@ -24,7 +24,7 @@
67 _inherit = 'account.move.line'
68 _columns = {
69 'revenue_expense': fields.related(
70- 'journal_id', 'revenue_expense', type='many2one',
71- relation='account.journal', string='Revenue Expense',
72+ 'journal_id', 'revenue_expense', type='boolean',
73+ string='Revenue Expense',
74 store=True, readonly=True),
75 }
76
77=== modified file 'l10n_br_sale/sale.py'
78--- l10n_br_sale/sale.py 2013-04-16 15:06:39 +0000
79+++ l10n_br_sale/sale.py 2013-06-14 13:46:30 +0000
80@@ -75,7 +75,7 @@
81 cr, uid, ["shop_id"], context)["shop_id"])
82 return self.pool.get("sale.shop").read(
83 cr, uid, [shop_id], ["default_fc_id"])[0]["default_fc_id"]
84-
85+
86 _defaults = {
87 'fiscal_category_id': _default_fiscal_category,
88 }