From d036478518726c940a4d99d46954899ee43ba243 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Tue, 31 Aug 2010 17:48:16 -0300 Subject: [PATCH 001/223] =?UTF-8?q?Adicionado=20m=C3=B3dulo=20l10n=5Fbr=5F?= =?UTF-8?q?delivery=20dependende=20do=20modulo=20delivery=20do=20addons=20?= =?UTF-8?q?para=20adicionar=20na=20nota=20fiscal=20as=20informa=C3=A7?= =?UTF-8?q?=C3=B5es=20de=20transporte,=20adicionado=20a=20series=20de=20do?= =?UTF-8?q?cumentos=20fiscais,=20e=20mudado=20views=20de=20vendas=20e=20no?= =?UTF-8?q?ta=20fiscal,=20para=20mudar=20a=20obrigatoriedade=20dos=20campo?= =?UTF-8?q?s=20da=20localiza=C3=A7=C3=A3o.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/__init__.py | 26 +++++++ l10n_br_delivery/__openerp__.py | 47 ++++++++++++ l10n_br_delivery/account_invoice_view.xml | 25 +++++++ l10n_br_delivery/delivery.py | 34 +++++++++ l10n_br_delivery/delivery_view.xml | 19 +++++ l10n_br_delivery/invoice.py | 45 ++++++++++++ l10n_br_delivery/sale.py | 90 +++++++++++++++++++++++ l10n_br_delivery/sale_view.xml | 8 ++ l10n_br_delivery/stock.py | 40 ++++++++++ l10n_br_delivery/stock_view.xml | 7 ++ 10 files changed, 341 insertions(+) create mode 100644 l10n_br_delivery/__init__.py create mode 100644 l10n_br_delivery/__openerp__.py create mode 100644 l10n_br_delivery/account_invoice_view.xml create mode 100644 l10n_br_delivery/delivery.py create mode 100644 l10n_br_delivery/delivery_view.xml create mode 100644 l10n_br_delivery/invoice.py create mode 100644 l10n_br_delivery/sale.py create mode 100644 l10n_br_delivery/sale_view.xml create mode 100644 l10n_br_delivery/stock.py create mode 100644 l10n_br_delivery/stock_view.xml diff --git a/l10n_br_delivery/__init__.py b/l10n_br_delivery/__init__.py new file mode 100644 index 000000000000..b1615337537c --- /dev/null +++ b/l10n_br_delivery/__init__.py @@ -0,0 +1,26 @@ +# -*- encoding: utf-8 -*- +################################################################################# +# # +# Copyright (C) 2009 Renato Lima - Akretion # +# # +#This program is free software: you can redistribute it and/or modify # +#it under the terms of the GNU General Public License as published by # +#the Free Software Foundation, either version 3 of the License, or # +#(at your option) any later version. # +# # +#This program is distributed in the hope that it will be useful, # +#but WITHOUT ANY WARRANTY; without even the implied warranty of # +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +#GNU General Public License for more details. # +# # +#You should have received a copy of the GNU General Public License # +#along with this program. If not, see . # +################################################################################# + +import invoice +import sale +import delivery +import stock + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/l10n_br_delivery/__openerp__.py b/l10n_br_delivery/__openerp__.py new file mode 100644 index 000000000000..903ed84ff0db --- /dev/null +++ b/l10n_br_delivery/__openerp__.py @@ -0,0 +1,47 @@ +# -*- encoding: utf-8 -*- +################################################################################# +# # +# Copyright (C) 2010 Renato Lima - Akretion # +# # +#This program is free software: you can redistribute it and/or modify # +#it under the terms of the GNU General Public License as published by # +#the Free Software Foundation, either version 3 of the License, or # +#(at your option) any later version. # +# # +#This program is distributed in the hope that it will be useful, # +#but WITHOUT ANY WARRANTY; without even the implied warranty of # +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +#GNU General Public License for more details. # +# # +#You should have received a copy of the GNU General Public License # +#along with this program. If not, see . # +################################################################################# + +{ + 'name' : 'Delivery for Brazilian Localization', + 'description' : 'Extend delivery module for Brazilian Localization', + 'author' : 'OpenERP Brasil', + 'website' : 'http://openerpbrasil.org', + 'version' : '0.6', + 'depends' : [ + 'base', + 'account', + 'sale', + 'stock', + 'delivery', + ], + 'init_xml': [ + + ], + 'update_xml' : [ + 'account_invoice_view.xml', + 'delivery_view.xml', + 'sale_view.xml', + 'stock_view.xml', + ], + 'category' : 'Localisation', + 'active': False, + 'installable': True +} + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/l10n_br_delivery/account_invoice_view.xml b/l10n_br_delivery/account_invoice_view.xml new file mode 100644 index 000000000000..99e055dc74f6 --- /dev/null +++ b/l10n_br_delivery/account_invoice_view.xml @@ -0,0 +1,25 @@ + + + + + + l10n_br_delivery.invoice.form + account.invoice + + + + + + + + + + + + + + + + + + diff --git a/l10n_br_delivery/delivery.py b/l10n_br_delivery/delivery.py new file mode 100644 index 000000000000..87eb8f83d94b --- /dev/null +++ b/l10n_br_delivery/delivery.py @@ -0,0 +1,34 @@ +# -*- encoding: utf-8 -*- +################################################################################# +# # +# Copyright (C) 2010 Renato Lima - Akretion # +# # +#This program is free software: you can redistribute it and/or modify # +#it under the terms of the GNU General Public License as published by # +#the Free Software Foundation, either version 3 of the License, or # +#(at your option) any later version. # +# # +#This program is distributed in the hope that it will be useful, # +#but WITHOUT ANY WARRANTY; without even the implied warranty of # +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +#GNU General Public License for more details. # +# # +#You should have received a copy of the GNU General Public License # +#along with this program. If not, see . # +################################################################################# + +import time +from osv import fields,osv +from tools.translate import _ + +class delivery_carrier(osv.osv): + _inherit = "delivery.carrier" + + _columns = { + 'antt_code': fields.char('Codigo ANTT', size=32), + } + +delivery_carrier() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/l10n_br_delivery/delivery_view.xml b/l10n_br_delivery/delivery_view.xml new file mode 100644 index 000000000000..720bdd31330a --- /dev/null +++ b/l10n_br_delivery/delivery_view.xml @@ -0,0 +1,19 @@ + + + + + + + l10n_br_delivery.carrier.form + delivery.carrier + form + + + + + + + + + + diff --git a/l10n_br_delivery/invoice.py b/l10n_br_delivery/invoice.py new file mode 100644 index 000000000000..1f4f493a88ba --- /dev/null +++ b/l10n_br_delivery/invoice.py @@ -0,0 +1,45 @@ +# -*- encoding: utf-8 -*- +################################################################################# +# # +# Copyright (C) 2010 Renato Lima - Akretion # +# # +#This program is free software: you can redistribute it and/or modify # +#it under the terms of the GNU General Public License as published by # +#the Free Software Foundation, either version 3 of the License, or # +#(at your option) any later version. # +# # +#This program is distributed in the hope that it will be useful, # +#but WITHOUT ANY WARRANTY; without even the implied warranty of # +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +#GNU General Public License for more details. # +# # +#You should have received a copy of the GNU General Public License # +#along with this program. If not, see . # +################################################################################# + +import time +import netsvc +from osv import fields, osv +import decimal_precision as dp +import pooler +from tools import config +from tools.translate import _ + +############################################################################## +# Fatura (Nota Fiscal) Personalizado +############################################################################## +class account_invoice(osv.osv): + _inherit = 'account.invoice' + + _columns = { + 'carrier_id':fields.many2one("delivery.carrier","Carrier", readonly=True, states={'draft':[('readonly',False)]}), + 'weight': fields.float('Gross weight', help="The gross weight in Kg.", readonly=True, states={'draft':[('readonly',False)]}), + 'weight_net': fields.float('Net weight', help="The net weight in Kg.", readonly=True, states={'draft':[('readonly',False)]}), + 'volume': fields.float('Volume', readonly=True, states={'draft':[('readonly',False)]}), + 'amount_insurance': fields.float('Valor do Seguro', digits_compute=dp.get_precision('Account'), readonly=True, states={'draft':[('readonly',False)]}), + 'amount_costs': fields.float('Outros Custos', digits_compute=dp.get_precision('Account'), readonly=True, states={'draft':[('readonly',False)]}), + } + +account_invoice() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/l10n_br_delivery/sale.py b/l10n_br_delivery/sale.py new file mode 100644 index 000000000000..9d0a482779a6 --- /dev/null +++ b/l10n_br_delivery/sale.py @@ -0,0 +1,90 @@ +# -*- encoding: utf-8 -*- +################################################################################# +# # +# Copyright (C) 2009 Renato Lima - Akretion # +# # +#This program is free software: you can redistribute it and/or modify # +#it under the terms of the GNU General Public License as published by # +#the Free Software Foundation, either version 3 of the License, or # +#(at your option) any later version. # +# # +#This program is distributed in the hope that it will be useful, # +#but WITHOUT ANY WARRANTY; without even the implied warranty of # +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +#GNU General Public License for more details. # +# # +#You should have received a copy of the GNU General Public License # +#along with this program. If not, see . # +################################################################################# + +import time +import netsvc +import decimal_precision as dp +from osv import fields, osv +import pooler +from tools import config +from tools.translate import _ + +############################################################################## +# Pedido de venda customizado +############################################################################## +class sale_order(osv.osv): + + _inherit = 'sale.order' + + def action_invoice_create(self, cr, uid, ids, grouped=False, states=['confirmed', 'done', 'exception'], date_inv = False, context=None): + + result = super(sale_order, self).action_invoice_create(cr, uid, ids, grouped, states, date_inv, context) + + if not result: + return result + + for order in self.browse(cr, uid, ids): + for invoice in order.invoice_ids: + if invoice.state in ('draft') and order.fiscal_operation_id: + self.pool.get('account.invoice').write(cr, uid, invoice.id, {'fiscal_operation_category_id': order.fiscal_operation_category_id.id, 'fiscal_operation_id': order.fiscal_operation_id.id, 'cfop_id': order.fiscal_operation_id.cfop_id.id, 'fiscal_document_id': order.fiscal_operation_id.fiscal_document_id.id}) + for inv_line in invoice.invoice_line: + self.pool.get('account.invoice.line').write(cr, uid, inv_line.id, {'cfop_id': order.fiscal_operation_id.cfop_id.id}) + + return result + + def action_ship_create(self, cr, uid, ids, *args): + + result = super(sale_order, self).action_ship_create(cr, uid, ids, *args) + + for order in self.browse(cr, uid, ids, context={}): + for picking in order.picking_ids: + self.pool.get('stock.picking').write(cr, uid, picking.id, {'fiscal_operation_category_id': order.fiscal_operation_category_id.id, 'fiscal_operation_id': order.fiscal_operation_id.id, 'fiscal_position': order.fiscal_position.id}) + + return result + + + +sale_order() + +############################################################################## +# Linha da Ordem de Venda Customizada +############################################################################## +class sale_order_line(osv.osv): + _inherit = 'sale.order.line' + + def create_sale_order_line_invoice(self, cr, uid, ids, context=None): + result = super(sale_order_line, self).create_sale_order_line_invoice(cr, uid, ids, context) + inv_ids = [] + if result: + + for so_line in self.browse(cr, uid, ids): + for inv_line in so_line.invoice_lines: + if inv_line.invoice_id.state in ('draft'): + if inv_line.invoice_id.id not in inv_ids: + inv_ids.append(inv_line.id) + self.pool.get('account.invoice').write(cr, uid, inv_line.invoice_id.id, {'fiscal_operation_category_id': so_line.order_id.fiscal_operation_category_id.id, 'fiscal_operation_id': so_line.order_id.fiscal_operation_id.id, 'cfop_id': so_line.order_id.fiscal_operation_id.cfop_id.id, 'fiscal_document_id': so_line.order_id.fiscal_operation_id.fiscal_document_id.id}) + self.pool.get('account.invoice.line').write(cr, uid, inv_line.id, {'cfop_id': so_line.order_id.fiscal_operation_id.cfop_id.id}) + + + + return result + +sale_order_line() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/l10n_br_delivery/sale_view.xml b/l10n_br_delivery/sale_view.xml new file mode 100644 index 000000000000..e13c0ef47c9f --- /dev/null +++ b/l10n_br_delivery/sale_view.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/l10n_br_delivery/stock.py b/l10n_br_delivery/stock.py new file mode 100644 index 000000000000..e79fb90d3679 --- /dev/null +++ b/l10n_br_delivery/stock.py @@ -0,0 +1,40 @@ +# -*- encoding: utf-8 -*- +################################################################################# +# # +# Copyright (C) 2009 Renato Lima - Akretion # +# # +#This program is free software: you can redistribute it and/or modify # +#it under the terms of the GNU General Public License as published by # +#the Free Software Foundation, either version 3 of the License, or # +#(at your option) any later version. # +# # +#This program is distributed in the hope that it will be useful, # +#but WITHOUT ANY WARRANTY; without even the implied warranty of # +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +#GNU General Public License for more details. # +# # +#You should have received a copy of the GNU General Public License # +#along with this program. If not, see . # +################################################################################# + +from osv import osv, fields + +class stock_picking(osv.osv): + _inherit = "stock.picking" + _description = "Picking List" + + def _invoice_line_hook(self, cr, uid, move_line, invoice_line_id): + '''Call after the creation of the invoice line''' + + self.pool.get('account.invoice.line').write(cr, uid, invoice_line_id, {'cfop_id': move_line.picking_id.fiscal_operation_id.cfop_id.id}) + + return super(stock_picking, self)._invoice_line_hook(cr, uid, move_line, invoice_line_id) + + def _invoice_hook(self, cr, uid, picking, invoice_id): + '''Call after the creation of the invoice''' + + self.pool.get('account.invoice').write(cr, uid, invoice_id, {'fiscal_operation_category_id': picking.fiscal_operation_category_id.id, 'fiscal_operation_id': picking.fiscal_operation_id.id, 'cfop_id': picking.fiscal_operation_id.cfop_id.id, 'fiscal_document_id': picking.fiscal_operation_id.fiscal_document_id.id, 'fiscal_position': picking.fiscal_position.id, 'carrier_id': picking.carrier_id, 'weight': picking.weight, 'weight_net': picking.weight_net, 'volume': picking.volume}) + + return super(stock_picking, self)._invoice_hook(cr, uid, picking, invoice_id) + +stock_picking() \ No newline at end of file diff --git a/l10n_br_delivery/stock_view.xml b/l10n_br_delivery/stock_view.xml new file mode 100644 index 000000000000..fddd4951f4ed --- /dev/null +++ b/l10n_br_delivery/stock_view.xml @@ -0,0 +1,7 @@ + + + + + + + From 64d974451b041da9c135f126b68fc0e468ad3bb4 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Tue, 31 Aug 2010 19:14:38 -0300 Subject: [PATCH 002/223] atualizando o commit anterior --- l10n_br_delivery/stock.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/l10n_br_delivery/stock.py b/l10n_br_delivery/stock.py index e79fb90d3679..94d6229bdbb0 100644 --- a/l10n_br_delivery/stock.py +++ b/l10n_br_delivery/stock.py @@ -23,6 +23,12 @@ class stock_picking(osv.osv): _inherit = "stock.picking" _description = "Picking List" + #TODO - Emquanto o merge não e feito pela openerp todo commit da loalização deve ser descomentado este campo + _columns = { + 'weight_net': fields.float('Net weight', help="The gross weight in Kg."), + } + + def _invoice_line_hook(self, cr, uid, move_line, invoice_line_id): '''Call after the creation of the invoice line''' From f5db7faaaa275dd1f26585ff6d01029bea14ee9d Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 8 Sep 2010 15:46:28 -0300 Subject: [PATCH 003/223] Removido o campo weight_net do objeto stock.picking do modulo l10n_br_delivery, pois foi aceito a proposta de merge: https://code.launchpad.net/~renatonlima/openobject-addons/delivery/+merge/34591 --- l10n_br_delivery/__openerp__.py | 1 + l10n_br_delivery/sale.py | 16 ++++------------ l10n_br_delivery/stock.py | 6 ------ 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/l10n_br_delivery/__openerp__.py b/l10n_br_delivery/__openerp__.py index 903ed84ff0db..4389b22f8f67 100644 --- a/l10n_br_delivery/__openerp__.py +++ b/l10n_br_delivery/__openerp__.py @@ -29,6 +29,7 @@ 'sale', 'stock', 'delivery', + 'l10n_br' ], 'init_xml': [ diff --git a/l10n_br_delivery/sale.py b/l10n_br_delivery/sale.py index 9d0a482779a6..9e50306feea1 100644 --- a/l10n_br_delivery/sale.py +++ b/l10n_br_delivery/sale.py @@ -42,24 +42,16 @@ def action_invoice_create(self, cr, uid, ids, grouped=False, states=['confirmed' for order in self.browse(cr, uid, ids): for invoice in order.invoice_ids: if invoice.state in ('draft') and order.fiscal_operation_id: + doc_serie_id = self.pool.get('l10n_br.document.serie').search(cr, uid,[('fiscal_document_id','=', order.fiscal_operation_id.fiscal_document_id.id),('active','=',True),('company_id','=',order.company_id.id)]) + if not doc_serie_id: + raise osv.except_osv(_('Nenhuma série de documento fiscal !'),_("Não existe nenhuma série de documento fiscal cadastrada para empresa: '%s'") % (order.company_id.name,)) + self.pool.get('account.invoice').write(cr, uid, invoice.id, {'fiscal_operation_category_id': order.fiscal_operation_category_id.id, 'fiscal_operation_id': order.fiscal_operation_id.id, 'cfop_id': order.fiscal_operation_id.cfop_id.id, 'fiscal_document_id': order.fiscal_operation_id.fiscal_document_id.id}) for inv_line in invoice.invoice_line: self.pool.get('account.invoice.line').write(cr, uid, inv_line.id, {'cfop_id': order.fiscal_operation_id.cfop_id.id}) return result - def action_ship_create(self, cr, uid, ids, *args): - - result = super(sale_order, self).action_ship_create(cr, uid, ids, *args) - - for order in self.browse(cr, uid, ids, context={}): - for picking in order.picking_ids: - self.pool.get('stock.picking').write(cr, uid, picking.id, {'fiscal_operation_category_id': order.fiscal_operation_category_id.id, 'fiscal_operation_id': order.fiscal_operation_id.id, 'fiscal_position': order.fiscal_position.id}) - - return result - - - sale_order() ############################################################################## diff --git a/l10n_br_delivery/stock.py b/l10n_br_delivery/stock.py index 94d6229bdbb0..e79fb90d3679 100644 --- a/l10n_br_delivery/stock.py +++ b/l10n_br_delivery/stock.py @@ -23,12 +23,6 @@ class stock_picking(osv.osv): _inherit = "stock.picking" _description = "Picking List" - #TODO - Emquanto o merge não e feito pela openerp todo commit da loalização deve ser descomentado este campo - _columns = { - 'weight_net': fields.float('Net weight', help="The gross weight in Kg."), - } - - def _invoice_line_hook(self, cr, uid, move_line, invoice_line_id): '''Call after the creation of the invoice line''' From 20d6fd77f4ad600c1ce33d28d947fa98c083234b Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Tue, 28 Sep 2010 19:51:17 -0300 Subject: [PATCH 004/223] =?UTF-8?q?Incluido=20o=20campo=20Descontar=20impo?= =?UTF-8?q?sto=20para=20os=20impostos=20que=20s=C3=A3o=20incluidos=20no=20?= =?UTF-8?q?pre=C3=A7o=20como=20ICMS,=20PIS=20e=20COFINS,=20criado=20os=20c?= =?UTF-8?q?ampos=20dos=20calculos=20destes=20impostos=20na=20linha=20da=20?= =?UTF-8?q?nota=20fiscal=20(account.invoice.line)=20e=20os=20totais=20na?= =?UTF-8?q?=20nota=20fiscal=20(account.invoice)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/account_invoice_view.xml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/l10n_br_delivery/account_invoice_view.xml b/l10n_br_delivery/account_invoice_view.xml index 99e055dc74f6..1a2d51134142 100644 --- a/l10n_br_delivery/account_invoice_view.xml +++ b/l10n_br_delivery/account_invoice_view.xml @@ -20,6 +20,25 @@ + + + l10n_br_delivery.invoice.form1 + account.invoice + + + + + + + + + + + + + + + From 1488be775101da566a752af0ca0d3091c5de988d Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 14 Oct 2010 02:00:07 -0300 Subject: [PATCH 005/223] =?UTF-8?q?concertado=20a=20vis=C3=B5es=20herdadas?= =?UTF-8?q?=20do=20modulo=20stock?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_delivery/sale.py b/l10n_br_delivery/sale.py index 9e50306feea1..db63869a9137 100644 --- a/l10n_br_delivery/sale.py +++ b/l10n_br_delivery/sale.py @@ -46,7 +46,7 @@ def action_invoice_create(self, cr, uid, ids, grouped=False, states=['confirmed' if not doc_serie_id: raise osv.except_osv(_('Nenhuma série de documento fiscal !'),_("Não existe nenhuma série de documento fiscal cadastrada para empresa: '%s'") % (order.company_id.name,)) - self.pool.get('account.invoice').write(cr, uid, invoice.id, {'fiscal_operation_category_id': order.fiscal_operation_category_id.id, 'fiscal_operation_id': order.fiscal_operation_id.id, 'cfop_id': order.fiscal_operation_id.cfop_id.id, 'fiscal_document_id': order.fiscal_operation_id.fiscal_document_id.id}) + self.pool.get('account.invoice').write(cr, uid, invoice.id, {'fiscal_operation_category_id': order.fiscal_operation_category_id.id, 'fiscal_operation_id': order.fiscal_operation_id.id, 'cfop_id': order.fiscal_operation_id.cfop_id.id, 'fiscal_document_id': order.fiscal_operation_id.fiscal_document_id.id, 'document_serie_id': doc_serie_id[0], 'carrier_id': order.carrier_id.id}) for inv_line in invoice.invoice_line: self.pool.get('account.invoice.line').write(cr, uid, inv_line.id, {'cfop_id': order.fiscal_operation_id.cfop_id.id}) From c5bec288d2a45379ade973acabad10b64c609ed7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Mon, 25 Oct 2010 21:08:39 -0200 Subject: [PATCH 006/223] [REF] extracted l10n_br_base, l10n_sale and l10n_stock from l10n_br; renamed l10n_br into 10n_br_account. BE CAREFFUL WITH MIGRATIONS, HACK YOUR ir.model.data, XML files and module dependencies first!! --- l10n_br_delivery/__openerp__.py | 13 ++++--------- l10n_br_delivery/account_invoice_view.xml | 4 ++-- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/l10n_br_delivery/__openerp__.py b/l10n_br_delivery/__openerp__.py index 4389b22f8f67..1281d90e568f 100644 --- a/l10n_br_delivery/__openerp__.py +++ b/l10n_br_delivery/__openerp__.py @@ -24,16 +24,11 @@ 'website' : 'http://openerpbrasil.org', 'version' : '0.6', 'depends' : [ - 'base', - 'account', - 'sale', - 'stock', - 'delivery', - 'l10n_br' + 'delivery', + 'l10n_br_sale', + 'l10n_br_stock', ], - 'init_xml': [ - - ], + 'init_xml': [], 'update_xml' : [ 'account_invoice_view.xml', 'delivery_view.xml', diff --git a/l10n_br_delivery/account_invoice_view.xml b/l10n_br_delivery/account_invoice_view.xml index 1a2d51134142..0daccc3c5742 100644 --- a/l10n_br_delivery/account_invoice_view.xml +++ b/l10n_br_delivery/account_invoice_view.xml @@ -5,7 +5,7 @@ l10n_br_delivery.invoice.form account.invoice - + @@ -24,7 +24,7 @@ l10n_br_delivery.invoice.form1 account.invoice - + From b002332d53b119a52016b7221d6a205e28130b81 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 27 Oct 2010 23:13:37 -0200 Subject: [PATCH 007/223] =?UTF-8?q?M=C3=B3dulo=20l10n=5Fbr=5Fdelivery:=20A?= =?UTF-8?q?lterado=20o=20campo=20volume=20para=20number=5Fof=5Fpackage=20n?= =?UTF-8?q?as=20notas=20fiscais,=20e=20atualizado=20depend=C3=AAncias?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/account_invoice_view.xml | 4 ++-- l10n_br_delivery/invoice.py | 2 +- l10n_br_delivery/sale.py | 2 +- l10n_br_delivery/stock.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/l10n_br_delivery/account_invoice_view.xml b/l10n_br_delivery/account_invoice_view.xml index 0daccc3c5742..6d888f79cdc2 100644 --- a/l10n_br_delivery/account_invoice_view.xml +++ b/l10n_br_delivery/account_invoice_view.xml @@ -15,7 +15,7 @@ - + @@ -34,7 +34,7 @@ - + diff --git a/l10n_br_delivery/invoice.py b/l10n_br_delivery/invoice.py index 1f4f493a88ba..2104a02d04d0 100644 --- a/l10n_br_delivery/invoice.py +++ b/l10n_br_delivery/invoice.py @@ -35,7 +35,7 @@ class account_invoice(osv.osv): 'carrier_id':fields.many2one("delivery.carrier","Carrier", readonly=True, states={'draft':[('readonly',False)]}), 'weight': fields.float('Gross weight', help="The gross weight in Kg.", readonly=True, states={'draft':[('readonly',False)]}), 'weight_net': fields.float('Net weight', help="The net weight in Kg.", readonly=True, states={'draft':[('readonly',False)]}), - 'volume': fields.float('Volume', readonly=True, states={'draft':[('readonly',False)]}), + 'number_of_packages': fields.integer('Volume', readonly=True, states={'draft':[('readonly',False)]}), 'amount_insurance': fields.float('Valor do Seguro', digits_compute=dp.get_precision('Account'), readonly=True, states={'draft':[('readonly',False)]}), 'amount_costs': fields.float('Outros Custos', digits_compute=dp.get_precision('Account'), readonly=True, states={'draft':[('readonly',False)]}), } diff --git a/l10n_br_delivery/sale.py b/l10n_br_delivery/sale.py index db63869a9137..984fb1fdaaf8 100644 --- a/l10n_br_delivery/sale.py +++ b/l10n_br_delivery/sale.py @@ -42,7 +42,7 @@ def action_invoice_create(self, cr, uid, ids, grouped=False, states=['confirmed' for order in self.browse(cr, uid, ids): for invoice in order.invoice_ids: if invoice.state in ('draft') and order.fiscal_operation_id: - doc_serie_id = self.pool.get('l10n_br.document.serie').search(cr, uid,[('fiscal_document_id','=', order.fiscal_operation_id.fiscal_document_id.id),('active','=',True),('company_id','=',order.company_id.id)]) + doc_serie_id = self.pool.get('l10n_br_account.document.serie').search(cr, uid,[('fiscal_document_id','=', order.fiscal_operation_id.fiscal_document_id.id),('active','=',True),('company_id','=',order.company_id.id)]) if not doc_serie_id: raise osv.except_osv(_('Nenhuma série de documento fiscal !'),_("Não existe nenhuma série de documento fiscal cadastrada para empresa: '%s'") % (order.company_id.name,)) diff --git a/l10n_br_delivery/stock.py b/l10n_br_delivery/stock.py index e79fb90d3679..0c49255d5cb4 100644 --- a/l10n_br_delivery/stock.py +++ b/l10n_br_delivery/stock.py @@ -33,7 +33,7 @@ def _invoice_line_hook(self, cr, uid, move_line, invoice_line_id): def _invoice_hook(self, cr, uid, picking, invoice_id): '''Call after the creation of the invoice''' - self.pool.get('account.invoice').write(cr, uid, invoice_id, {'fiscal_operation_category_id': picking.fiscal_operation_category_id.id, 'fiscal_operation_id': picking.fiscal_operation_id.id, 'cfop_id': picking.fiscal_operation_id.cfop_id.id, 'fiscal_document_id': picking.fiscal_operation_id.fiscal_document_id.id, 'fiscal_position': picking.fiscal_position.id, 'carrier_id': picking.carrier_id, 'weight': picking.weight, 'weight_net': picking.weight_net, 'volume': picking.volume}) + self.pool.get('account.invoice').write(cr, uid, invoice_id, {'fiscal_operation_category_id': picking.fiscal_operation_category_id.id, 'fiscal_operation_id': picking.fiscal_operation_id.id, 'cfop_id': picking.fiscal_operation_id.cfop_id.id, 'fiscal_document_id': picking.fiscal_operation_id.fiscal_document_id.id, 'fiscal_position': picking.fiscal_position.id, 'carrier_id': picking.carrier_id, 'weight': picking.weight, 'weight_net': picking.weight_net, 'number_of_packages': picking.number_of_packages}) return super(stock_picking, self)._invoice_hook(cr, uid, picking, invoice_id) From aecedc930db37902e8e2f099a374893840d55782 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 28 Oct 2010 01:01:38 -0200 Subject: [PATCH 008/223] =?UTF-8?q?Acertada=20vis=C3=A3o=20do=20modulo=20l?= =?UTF-8?q?10n=5Fbr=5Fdelivery?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/account_invoice_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/l10n_br_delivery/account_invoice_view.xml b/l10n_br_delivery/account_invoice_view.xml index 6d888f79cdc2..bc8038c1c4cf 100644 --- a/l10n_br_delivery/account_invoice_view.xml +++ b/l10n_br_delivery/account_invoice_view.xml @@ -5,7 +5,7 @@ l10n_br_delivery.invoice.form account.invoice - + @@ -24,7 +24,7 @@ l10n_br_delivery.invoice.form1 account.invoice - + From fedd7c8250f635a02362aeeb0ea71a4c78a0c4d1 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Mon, 29 Nov 2010 17:30:15 -0200 Subject: [PATCH 009/223] =?UTF-8?q?Adicionado=20integra=C3=A7=C3=A3o=20com?= =?UTF-8?q?=20NFe=20v2.00=20feita=20atrav=C3=A9s=20de=20arquivos=20XML=20o?= =?UTF-8?q?u=20TXT=20para=20ser=20importado=20no=20Emissor=20de=20NFe=20e?= =?UTF-8?q?=20modulo=20l10n=5Fbr=5Ffp=5Frule=5Fsale=5Flink=20para=20resolv?= =?UTF-8?q?er=20as=20compatibilidades?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/delivery.py | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/l10n_br_delivery/delivery.py b/l10n_br_delivery/delivery.py index 87eb8f83d94b..9985ab364d48 100644 --- a/l10n_br_delivery/delivery.py +++ b/l10n_br_delivery/delivery.py @@ -17,18 +17,42 @@ #along with this program. If not, see . # ################################################################################# -import time from osv import fields,osv -from tools.translate import _ class delivery_carrier(osv.osv): _inherit = "delivery.carrier" _columns = { 'antt_code': fields.char('Codigo ANTT', size=32), + # 'vehicle_ids': fields.one2many('l10n_br_delivey.carrier.vehicle', 'carrier_id', 'Vehicles'), } delivery_carrier() +class delivery_carrier_vehicle(osv.osv): + + _name = "l10n_br_delivey.carrier.vehicle" + _description = "Veiculos das transportadoras" + + _columns = { + 'name': fields.char('Nome', size=32), + 'description': fields.char('Descrição', size=132), + 'plate': fields.char('Placa', size=7), + 'driver': fields.char('Condudor', size=64), + 'antt_code': fields.char('Codigo ANTT', size=32), + 'country_id': fields.many2one('res.country', 'País'), + 'state_id': fields.many2one('res.country.state', 'Municipio', domain="[('country_id','=',country_id)]"), + 'city_id': fields.many2one('l10n_br_base.city', 'Municipio', domain="[('state_id','=',state_id)]"), + 'active': fields.boolean('Ativo'), + 'manufacture_year': fields.char('Ano de Fabricação', size=4), + 'model_year': fields.char('Ano do Modelo', size=4), + 'type': fields.selection([('bau','Caminhão Baú')], 'Ano do Modelo'), + 'carrier_id': fields.many2one('delivery.carrier', 'Carrier', select=True, required=True, ondelete='cascade'), + } + +delivery_carrier_vehicle() + + + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From 5cf162640716a2c5b68d920d94de199d001334d1 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Tue, 30 Nov 2010 14:26:32 -0200 Subject: [PATCH 010/223] =?UTF-8?q?Atualiza=C3=A7=C3=A3o=20das=20rotinas?= =?UTF-8?q?=20NFe,=20para=20tirar=20acentua=C3=A7=C3=B5es,=20e=20informar?= =?UTF-8?q?=20os=20campos=20suplementares=20dos=20impostos=20dependendo=20?= =?UTF-8?q?da=20CST?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/delivery.py | 2 +- l10n_br_delivery/delivery_view.xml | 21 +++++++++++++++++++++ l10n_br_delivery/stock.py | 3 +++ l10n_br_delivery/stock_view.xml | 14 +++++++++++++- 4 files changed, 38 insertions(+), 2 deletions(-) diff --git a/l10n_br_delivery/delivery.py b/l10n_br_delivery/delivery.py index 9985ab364d48..20499ebfdbfc 100644 --- a/l10n_br_delivery/delivery.py +++ b/l10n_br_delivery/delivery.py @@ -24,7 +24,7 @@ class delivery_carrier(osv.osv): _columns = { 'antt_code': fields.char('Codigo ANTT', size=32), - # 'vehicle_ids': fields.one2many('l10n_br_delivey.carrier.vehicle', 'carrier_id', 'Vehicles'), + 'vehicle_ids': fields.one2many('l10n_br_delivey.carrier.vehicle', 'carrier_id', 'Vehicles'), } delivery_carrier() diff --git a/l10n_br_delivery/delivery_view.xml b/l10n_br_delivery/delivery_view.xml index 720bdd31330a..63475e123d6c 100644 --- a/l10n_br_delivery/delivery_view.xml +++ b/l10n_br_delivery/delivery_view.xml @@ -11,6 +11,27 @@ + +
+ + + + + + + + + + + + + + + + + + +
diff --git a/l10n_br_delivery/stock.py b/l10n_br_delivery/stock.py index 0c49255d5cb4..d77f8576b51d 100644 --- a/l10n_br_delivery/stock.py +++ b/l10n_br_delivery/stock.py @@ -22,6 +22,9 @@ class stock_picking(osv.osv): _inherit = "stock.picking" _description = "Picking List" + _columns = { + 'vehicle_id': fields.many2one('delivery.carrier.vehicle', 'Veículo', select=True, required=True, domain="[('carrier_id','=',carrier_id)]"), + } def _invoice_line_hook(self, cr, uid, move_line, invoice_line_id): '''Call after the creation of the invoice line''' diff --git a/l10n_br_delivery/stock_view.xml b/l10n_br_delivery/stock_view.xml index fddd4951f4ed..e172635c0a85 100644 --- a/l10n_br_delivery/stock_view.xml +++ b/l10n_br_delivery/stock_view.xml @@ -2,6 +2,18 @@ - + + l10n_br_delivery.stock.picking.out.form + stock.picking + + 32 + + + + + + + + From cfb0d3fc99e4c30c00cbde27cbee13c624653c20 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Fri, 3 Dec 2010 03:51:25 -0200 Subject: [PATCH 011/223] Corrigido a classe vehicle do modulo l10n_br_delivery --- l10n_br_delivery/delivery.py | 14 ++++++-------- l10n_br_delivery/stock.py | 2 +- l10n_br_delivery/stock_view.xml | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/l10n_br_delivery/delivery.py b/l10n_br_delivery/delivery.py index 20499ebfdbfc..fcbce3839370 100644 --- a/l10n_br_delivery/delivery.py +++ b/l10n_br_delivery/delivery.py @@ -24,15 +24,15 @@ class delivery_carrier(osv.osv): _columns = { 'antt_code': fields.char('Codigo ANTT', size=32), - 'vehicle_ids': fields.one2many('l10n_br_delivey.carrier.vehicle', 'carrier_id', 'Vehicles'), + 'vehicle_ids': fields.one2many('l10n_br_delivery.carrier.vehicle', 'carrier_id', 'Vehicles'), } delivery_carrier() -class delivery_carrier_vehicle(osv.osv): +class l10n_br_delivery_carrier_vehicle(osv.osv): - _name = "l10n_br_delivey.carrier.vehicle" - _description = "Veiculos das transportadoras" + _name = 'l10n_br_delivery.carrier.vehicle' + _description = 'Veiculos das transportadoras' _columns = { 'name': fields.char('Nome', size=32), @@ -41,7 +41,7 @@ class delivery_carrier_vehicle(osv.osv): 'driver': fields.char('Condudor', size=64), 'antt_code': fields.char('Codigo ANTT', size=32), 'country_id': fields.many2one('res.country', 'País'), - 'state_id': fields.many2one('res.country.state', 'Municipio', domain="[('country_id','=',country_id)]"), + 'state_id': fields.many2one('res.country.state', 'Estado', domain="[('country_id','=',country_id)]"), 'city_id': fields.many2one('l10n_br_base.city', 'Municipio', domain="[('state_id','=',state_id)]"), 'active': fields.boolean('Ativo'), 'manufacture_year': fields.char('Ano de Fabricação', size=4), @@ -50,9 +50,7 @@ class delivery_carrier_vehicle(osv.osv): 'carrier_id': fields.many2one('delivery.carrier', 'Carrier', select=True, required=True, ondelete='cascade'), } -delivery_carrier_vehicle() - - +l10n_br_delivery_carrier_vehicle() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/l10n_br_delivery/stock.py b/l10n_br_delivery/stock.py index d77f8576b51d..873796137fe2 100644 --- a/l10n_br_delivery/stock.py +++ b/l10n_br_delivery/stock.py @@ -23,7 +23,7 @@ class stock_picking(osv.osv): _inherit = "stock.picking" _description = "Picking List" _columns = { - 'vehicle_id': fields.many2one('delivery.carrier.vehicle', 'Veículo', select=True, required=True, domain="[('carrier_id','=',carrier_id)]"), + 'vehicle_id': fields.many2one('l10n_br_delivery.carrier.vehicle', 'Veículo'), } def _invoice_line_hook(self, cr, uid, move_line, invoice_line_id): diff --git a/l10n_br_delivery/stock_view.xml b/l10n_br_delivery/stock_view.xml index e172635c0a85..204d23ee4a15 100644 --- a/l10n_br_delivery/stock_view.xml +++ b/l10n_br_delivery/stock_view.xml @@ -9,7 +9,7 @@ 32 - +
From 7fcd5ac72073d52869fc53a6e857b2f37ab4f468 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 9 Dec 2010 05:16:06 -0200 Subject: [PATCH 012/223] =?UTF-8?q?Adicionado=20customiza=C3=A7=C3=B5es=20?= =?UTF-8?q?nos=20calculos=20dos=20tributos=20e=20beneficios=20fiscais=20co?= =?UTF-8?q?mo=20redu=C3=A7=C3=A3o=20de=20base=20de=20calculo=20e=20mudan?= =?UTF-8?q?=C3=A7a=20das=20cst=20para=20cada=20imposto=20por=20opera=C3=A7?= =?UTF-8?q?=C3=A3o,=20posi=C3=A7=C3=A3o=20fiscal=20e=20NCM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/delivery.py | 51 ++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/l10n_br_delivery/delivery.py b/l10n_br_delivery/delivery.py index fcbce3839370..c199d5a74451 100644 --- a/l10n_br_delivery/delivery.py +++ b/l10n_br_delivery/delivery.py @@ -52,5 +52,56 @@ class l10n_br_delivery_carrier_vehicle(osv.osv): l10n_br_delivery_carrier_vehicle() + +class l10n_br_delivery_shipment(osv.osv): + + _name = 'l10n_br_delivery.shipment' + + def _cal_weight(self, cr, uid, ids, name, args, context=None): + res = {} + uom_obj = self.pool.get('product.uom') + for picking in self.browse(cr, uid, ids, context): + total_weight = total_weight_net = 0.00 + + for move in picking.move_lines: + total_weight += move.weight + total_weight_net += move.weight_net + + res[picking.id] = { + 'weight': total_weight, + 'weight_net': total_weight_net, + } + return res + + def _get_picking_line(self, cr, uid, ids, context=None): + result = {} + for line in self.pool.get('stock.move').browse(cr, uid, ids, context=context): + result[line.picking_id.id] = True + return result.keys() + + _columns = { + 'code': fields.char('Nome', size=32), + 'description': fields.char('Descrição', size=132), + 'carrier_id': fields.many2one('delivery.carrier', 'Carrier', select=True, required=True), + 'vehicle_id': fields.many2one('l10n_br_delivery.carrier.vehicle', 'Vehicle', select=True, required=True), + + #'weight': fields.function(_cal_weight, method=True, type='float', string='Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_weight', + # store={ + # 'stock.picking': (lambda self, cr, uid, ids, c={}: ids, ['move_lines'], 20), + # 'stock.move': (_get_picking_line, ['product_id','product_qty','product_uom','product_uos_qty'], 20), + # }), + #'weight_net': fields.function(_cal_weight, method=True, type='float', string='Net Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_weight', + # store={ + # 'stock.picking': (lambda self, cr, uid, ids, c={}: ids, ['move_lines'], 20), + # 'stock.move': (_get_picking_line, ['product_id','product_qty','product_uom','product_uos_qty'], 20), + # }), + 'volume': fields.float('Volume'), + 'carrier_tracking_ref': fields.char('Carrier Tracking Ref', size=32), + 'number_of_packages': fields.integer('Number of Packages'), + } + + +l10n_br_delivery_shipment() + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From 15ea22012387c0515c3e725d44fc4d55c6f71ab9 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Mon, 10 Jan 2011 13:32:12 -0200 Subject: [PATCH 013/223] =?UTF-8?q?Adicionado=20o=20campo=20amount=5Ffreig?= =?UTF-8?q?ht=20no=20objeto=20account.invoice=20do=20modulo=20l10n=5Fbr=5F?= =?UTF-8?q?delivery=20para=20colocar=20o=20valor=20total=20de=20frete=20da?= =?UTF-8?q?=20nota=20fiscal=20e=20atualziado=20a=20rotina=20de=20exporta?= =?UTF-8?q?=C3=A7=C3=A3o=20da=20nota=20fiscal=20para=20o=20emissor=20nfe?= =?UTF-8?q?=20para=20exportar=20este=20campo=20(amount=5Ffreight).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/account_invoice_view.xml | 1 + l10n_br_delivery/invoice.py | 1 + 2 files changed, 2 insertions(+) diff --git a/l10n_br_delivery/account_invoice_view.xml b/l10n_br_delivery/account_invoice_view.xml index bc8038c1c4cf..0b4644c6c456 100644 --- a/l10n_br_delivery/account_invoice_view.xml +++ b/l10n_br_delivery/account_invoice_view.xml @@ -11,6 +11,7 @@ + diff --git a/l10n_br_delivery/invoice.py b/l10n_br_delivery/invoice.py index 2104a02d04d0..aff0ed2fb644 100644 --- a/l10n_br_delivery/invoice.py +++ b/l10n_br_delivery/invoice.py @@ -38,6 +38,7 @@ class account_invoice(osv.osv): 'number_of_packages': fields.integer('Volume', readonly=True, states={'draft':[('readonly',False)]}), 'amount_insurance': fields.float('Valor do Seguro', digits_compute=dp.get_precision('Account'), readonly=True, states={'draft':[('readonly',False)]}), 'amount_costs': fields.float('Outros Custos', digits_compute=dp.get_precision('Account'), readonly=True, states={'draft':[('readonly',False)]}), + 'amount_freight': fields.float('Frete', digits_compute=dp.get_precision('Account'), readonly=True, states={'draft':[('readonly',False)]}), } account_invoice() From 0fdbdfa9f66f0030d12ab16a09b42c9aaf22b5d9 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Fri, 14 Jan 2011 13:12:37 -0200 Subject: [PATCH 014/223] =?UTF-8?q?l10n=5Fbr=5Fdelivery=20-=20Adicionado?= =?UTF-8?q?=20campos=20Tipo=20do=20Frete,=20Ve=C3=ADculo,=20Total=20do=20F?= =?UTF-8?q?rete=20na=20nota=20fiscal=20e=20o=20Tipo=20do=20Frete=20na=20Or?= =?UTF-8?q?dem=20de=20Entrega.=20l10n=5Fbr=5Faccount=20-=20Adicionado=20na?= =?UTF-8?q?s=20linhas=20da=20notas=20fiscal=20detalhamento=20dos=20imposto?= =?UTF-8?q?s=20ICMS,=20ICMS=20ST,=20IPI,=20PIS=20e=20COFINS,=20alterado=20?= =?UTF-8?q?a=20rotina=20de=20exporta=C3=A7=C3=A3o=20da=20notas=20fiscais?= =?UTF-8?q?=20para=20o=20emissor=20de=20nfe,=20para=20sair=20a=20observa?= =?UTF-8?q?=C3=A7=C3=A3o=20da=20NFE,=20dados=20do=20ve=C3=ADculos=20e=20ti?= =?UTF-8?q?po=20do=20frete.=20l10n=5Fbr=5Fpurchase=20-=20Alterado=20a=20ro?= =?UTF-8?q?tina=20da=20gera=C3=A7=C3=A3o=20da=20nota=20fiscal=20de=20entra?= =?UTF-8?q?da,=20pois=20agora=20o=20relacionado=20entre=20ordem=20de=20com?= =?UTF-8?q?pra=20e=20nota=20fiscal=20=C3=A9=20um=20many2many.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/__init__.py | 2 +- l10n_br_delivery/account_invoice_view.xml | 2 ++ l10n_br_delivery/delivery.py | 2 +- l10n_br_delivery/delivery_view.xml | 2 +- l10n_br_delivery/invoice.py | 2 ++ l10n_br_delivery/sale.py | 21 ++++++++++++++++++++- l10n_br_delivery/stock.py | 15 ++++++++++++++- l10n_br_delivery/stock_view.xml | 15 ++++++++++++++- 8 files changed, 55 insertions(+), 6 deletions(-) diff --git a/l10n_br_delivery/__init__.py b/l10n_br_delivery/__init__.py index b1615337537c..cf85afa1be5a 100644 --- a/l10n_br_delivery/__init__.py +++ b/l10n_br_delivery/__init__.py @@ -17,10 +17,10 @@ #along with this program. If not, see . # ################################################################################# -import invoice import sale import delivery import stock +import invoice # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/l10n_br_delivery/account_invoice_view.xml b/l10n_br_delivery/account_invoice_view.xml index 0b4644c6c456..f788372ba389 100644 --- a/l10n_br_delivery/account_invoice_view.xml +++ b/l10n_br_delivery/account_invoice_view.xml @@ -11,6 +11,8 @@ + + diff --git a/l10n_br_delivery/delivery.py b/l10n_br_delivery/delivery.py index c199d5a74451..09210aa1eb3b 100644 --- a/l10n_br_delivery/delivery.py +++ b/l10n_br_delivery/delivery.py @@ -39,7 +39,7 @@ class l10n_br_delivery_carrier_vehicle(osv.osv): 'description': fields.char('Descrição', size=132), 'plate': fields.char('Placa', size=7), 'driver': fields.char('Condudor', size=64), - 'antt_code': fields.char('Codigo ANTT', size=32), + 'rntc_code': fields.char('Codigo ANTT', size=32), 'country_id': fields.many2one('res.country', 'País'), 'state_id': fields.many2one('res.country.state', 'Estado', domain="[('country_id','=',country_id)]"), 'city_id': fields.many2one('l10n_br_base.city', 'Municipio', domain="[('state_id','=',state_id)]"), diff --git a/l10n_br_delivery/delivery_view.xml b/l10n_br_delivery/delivery_view.xml index 63475e123d6c..8c80f0d905b2 100644 --- a/l10n_br_delivery/delivery_view.xml +++ b/l10n_br_delivery/delivery_view.xml @@ -17,7 +17,7 @@ - + diff --git a/l10n_br_delivery/invoice.py b/l10n_br_delivery/invoice.py index aff0ed2fb644..42a0e0bef6d9 100644 --- a/l10n_br_delivery/invoice.py +++ b/l10n_br_delivery/invoice.py @@ -33,6 +33,8 @@ class account_invoice(osv.osv): _columns = { 'carrier_id':fields.many2one("delivery.carrier","Carrier", readonly=True, states={'draft':[('readonly',False)]}), + 'vehicle_id': fields.many2one('l10n_br_delivery.carrier.vehicle', 'Veículo'), + 'incoterm': fields.many2one('stock.incoterms', 'Tipo do Frete', help="Incoterm which stands for 'International Commercial terms' implies its a series of sales terms which are used in the commercial transaction."), 'weight': fields.float('Gross weight', help="The gross weight in Kg.", readonly=True, states={'draft':[('readonly',False)]}), 'weight_net': fields.float('Net weight', help="The net weight in Kg.", readonly=True, states={'draft':[('readonly',False)]}), 'number_of_packages': fields.integer('Volume', readonly=True, states={'draft':[('readonly',False)]}), diff --git a/l10n_br_delivery/sale.py b/l10n_br_delivery/sale.py index 984fb1fdaaf8..4dfd4a3fb04a 100644 --- a/l10n_br_delivery/sale.py +++ b/l10n_br_delivery/sale.py @@ -46,12 +46,31 @@ def action_invoice_create(self, cr, uid, ids, grouped=False, states=['confirmed' if not doc_serie_id: raise osv.except_osv(_('Nenhuma série de documento fiscal !'),_("Não existe nenhuma série de documento fiscal cadastrada para empresa: '%s'") % (order.company_id.name,)) - self.pool.get('account.invoice').write(cr, uid, invoice.id, {'fiscal_operation_category_id': order.fiscal_operation_category_id.id, 'fiscal_operation_id': order.fiscal_operation_id.id, 'cfop_id': order.fiscal_operation_id.cfop_id.id, 'fiscal_document_id': order.fiscal_operation_id.fiscal_document_id.id, 'document_serie_id': doc_serie_id[0], 'carrier_id': order.carrier_id.id}) + self.pool.get('account.invoice').write(cr, uid, invoice.id, { + 'fiscal_operation_category_id': order.fiscal_operation_category_id.id, + 'fiscal_operation_id': order.fiscal_operation_id.id, + 'cfop_id': order.fiscal_operation_id.cfop_id.id, + 'fiscal_document_id': order.fiscal_operation_id.fiscal_document_id.id, + 'document_serie_id': doc_serie_id[0], + 'carrier_id': order.carrier_id.id, + 'vehicle_id': order.vehicle_id.id, + 'incoterm': order.incoterm.id + }) for inv_line in invoice.invoice_line: self.pool.get('account.invoice.line').write(cr, uid, inv_line.id, {'cfop_id': order.fiscal_operation_id.cfop_id.id}) return result + def action_ship_create(self, cr, uid, ids, *args): + + result = super(sale_order, self).action_ship_create(cr, uid, ids, *args) + + for order in self.browse(cr, uid, ids, context={}): + for picking in order.picking_ids: + self.pool.get('stock.picking').write(cr, uid, picking.id, {'incoterm': order.incoterm.id}) + + return result + sale_order() ############################################################################## diff --git a/l10n_br_delivery/stock.py b/l10n_br_delivery/stock.py index 873796137fe2..72969f7313d7 100644 --- a/l10n_br_delivery/stock.py +++ b/l10n_br_delivery/stock.py @@ -24,6 +24,7 @@ class stock_picking(osv.osv): _description = "Picking List" _columns = { 'vehicle_id': fields.many2one('l10n_br_delivery.carrier.vehicle', 'Veículo'), + 'incoterm': fields.many2one('stock.incoterms', 'Tipo do Frete', help="Incoterm which stands for 'International Commercial terms' implies its a series of sales terms which are used in the commercial transaction."), } def _invoice_line_hook(self, cr, uid, move_line, invoice_line_id): @@ -36,7 +37,19 @@ def _invoice_line_hook(self, cr, uid, move_line, invoice_line_id): def _invoice_hook(self, cr, uid, picking, invoice_id): '''Call after the creation of the invoice''' - self.pool.get('account.invoice').write(cr, uid, invoice_id, {'fiscal_operation_category_id': picking.fiscal_operation_category_id.id, 'fiscal_operation_id': picking.fiscal_operation_id.id, 'cfop_id': picking.fiscal_operation_id.cfop_id.id, 'fiscal_document_id': picking.fiscal_operation_id.fiscal_document_id.id, 'fiscal_position': picking.fiscal_position.id, 'carrier_id': picking.carrier_id, 'weight': picking.weight, 'weight_net': picking.weight_net, 'number_of_packages': picking.number_of_packages}) + self.pool.get('account.invoice').write(cr, uid, invoice_id, { + 'fiscal_operation_category_id': picking.fiscal_operation_category_id.id, + 'fiscal_operation_id': picking.fiscal_operation_id.id, + 'cfop_id': picking.fiscal_operation_id.cfop_id.id, + 'fiscal_document_id': picking.fiscal_operation_id.fiscal_document_id.id, + 'fiscal_position': picking.fiscal_position.id, + 'carrier_id': picking.carrier_id.id, + 'vehicle_id': picking.vehicle_id.id, + 'incoterm': picking.incoterm.id, + 'weight': picking.weight, + 'weight_net': picking.weight_net, + 'number_of_packages': picking.number_of_packages + }) return super(stock_picking, self)._invoice_hook(cr, uid, picking, invoice_id) diff --git a/l10n_br_delivery/stock_view.xml b/l10n_br_delivery/stock_view.xml index 204d23ee4a15..aef801a7cac8 100644 --- a/l10n_br_delivery/stock_view.xml +++ b/l10n_br_delivery/stock_view.xml @@ -10,10 +10,23 @@ +
- + + + l10n_br_delivery.stock.picking.out.form1 + stock.picking + + 32 + + + + + + + From ef01309b4ddc0890f885a44d9fd9faf000ed5475 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Mon, 24 Jan 2011 13:11:07 -0200 Subject: [PATCH 015/223] =?UTF-8?q?l10n=5Fbr=5Faccount=20-=20Adicionado=20?= =?UTF-8?q?o=20regime=20tribut=C3=A1rio=20na=20empresa=20(exigido=20na=20N?= =?UTF-8?q?FE=202.00),=20adicionado=20o=20endere=C3=A7o=20de=20entrega=20n?= =?UTF-8?q?a=20nota=20fiscal,=20adicionado=20documentos=20fiscais=20contid?= =?UTF-8?q?os=20no=20SPED=20Fiscal,=20concertada=20as=20vis=C3=B5es=20da?= =?UTF-8?q?=20nota=20fiscal=20de=20entrada,=20l10n=5Fbr=5Fdata=5Fcep=20-?= =?UTF-8?q?=20Corrigido=20as=20refer=C3=AAncias=20de=20estados=20em=20cada?= =?UTF-8?q?=20estado.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/account_invoice_view.xml | 11 +++++++++++ l10n_br_delivery/invoice.py | 5 +++-- l10n_br_delivery/sale.py | 1 + l10n_br_delivery/stock.py | 1 + 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/l10n_br_delivery/account_invoice_view.xml b/l10n_br_delivery/account_invoice_view.xml index f788372ba389..49d179d0007f 100644 --- a/l10n_br_delivery/account_invoice_view.xml +++ b/l10n_br_delivery/account_invoice_view.xml @@ -42,6 +42,17 @@ + + + l10n_br_delivery.invoice.form2 + account.invoice + + + + + + + diff --git a/l10n_br_delivery/invoice.py b/l10n_br_delivery/invoice.py index 42a0e0bef6d9..1174c83111a9 100644 --- a/l10n_br_delivery/invoice.py +++ b/l10n_br_delivery/invoice.py @@ -32,9 +32,10 @@ class account_invoice(osv.osv): _inherit = 'account.invoice' _columns = { + 'partner_shipping_id': fields.many2one('res.partner.address', 'Endereço de Entrega', readonly=True, states={'draft': [('readonly', False)]}, help="Shipping address for current sales order."), 'carrier_id':fields.many2one("delivery.carrier","Carrier", readonly=True, states={'draft':[('readonly',False)]}), - 'vehicle_id': fields.many2one('l10n_br_delivery.carrier.vehicle', 'Veículo'), - 'incoterm': fields.many2one('stock.incoterms', 'Tipo do Frete', help="Incoterm which stands for 'International Commercial terms' implies its a series of sales terms which are used in the commercial transaction."), + 'vehicle_id': fields.many2one('l10n_br_delivery.carrier.vehicle', 'Veículo', readonly=True, states={'draft': [('readonly', False)]}), + 'incoterm': fields.many2one('stock.incoterms', 'Tipo do Frete', readonly=True, states={'draft': [('readonly', False)]}, help="Incoterm which stands for 'International Commercial terms' implies its a series of sales terms which are used in the commercial transaction."), 'weight': fields.float('Gross weight', help="The gross weight in Kg.", readonly=True, states={'draft':[('readonly',False)]}), 'weight_net': fields.float('Net weight', help="The net weight in Kg.", readonly=True, states={'draft':[('readonly',False)]}), 'number_of_packages': fields.integer('Volume', readonly=True, states={'draft':[('readonly',False)]}), diff --git a/l10n_br_delivery/sale.py b/l10n_br_delivery/sale.py index 4dfd4a3fb04a..0518f38069c0 100644 --- a/l10n_br_delivery/sale.py +++ b/l10n_br_delivery/sale.py @@ -47,6 +47,7 @@ def action_invoice_create(self, cr, uid, ids, grouped=False, states=['confirmed' raise osv.except_osv(_('Nenhuma série de documento fiscal !'),_("Não existe nenhuma série de documento fiscal cadastrada para empresa: '%s'") % (order.company_id.name,)) self.pool.get('account.invoice').write(cr, uid, invoice.id, { + 'partner_shipping_id': order.partner_shipping_id.id, 'fiscal_operation_category_id': order.fiscal_operation_category_id.id, 'fiscal_operation_id': order.fiscal_operation_id.id, 'cfop_id': order.fiscal_operation_id.cfop_id.id, diff --git a/l10n_br_delivery/stock.py b/l10n_br_delivery/stock.py index 72969f7313d7..e0f51ceedf1e 100644 --- a/l10n_br_delivery/stock.py +++ b/l10n_br_delivery/stock.py @@ -38,6 +38,7 @@ def _invoice_hook(self, cr, uid, picking, invoice_id): '''Call after the creation of the invoice''' self.pool.get('account.invoice').write(cr, uid, invoice_id, { + 'partner_shipping_id': picking.address_id.id, 'fiscal_operation_category_id': picking.fiscal_operation_category_id.id, 'fiscal_operation_id': picking.fiscal_operation_id.id, 'cfop_id': picking.fiscal_operation_id.cfop_id.id, From 3eb50f7e23b3d7d83adcfa93f0621156209844b2 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 3 Feb 2011 07:57:47 -0200 Subject: [PATCH 016/223] =?UTF-8?q?Altera=C3=A7=C3=A3o=20para=20permitir?= =?UTF-8?q?=20um=20pedido=20de=20venda,=20separa=C3=A7=C3=A3o=20e=20nota?= =?UTF-8?q?=20fiscal=20opera=C3=A7=C3=B5es=20por=20linhas=20permitindo=20q?= =?UTF-8?q?ue=20uma=20nota=20fiscal=20seja=20criada=20com=20mais=20de=201?= =?UTF-8?q?=20CFOP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_delivery/stock.py b/l10n_br_delivery/stock.py index e0f51ceedf1e..1e4f11415bc7 100644 --- a/l10n_br_delivery/stock.py +++ b/l10n_br_delivery/stock.py @@ -30,7 +30,7 @@ class stock_picking(osv.osv): def _invoice_line_hook(self, cr, uid, move_line, invoice_line_id): '''Call after the creation of the invoice line''' - self.pool.get('account.invoice.line').write(cr, uid, invoice_line_id, {'cfop_id': move_line.picking_id.fiscal_operation_id.cfop_id.id}) + self.pool.get('account.invoice.line').write(cr, uid, invoice_line_id, {'cfop_id': move_line.fiscal_operation_id.cfop_id.id, 'fiscal_operation_category_id': move_line.fiscal_operation_category_id.id ,'fiscal_operation_id': move_line.fiscal_operation_id.id}) return super(stock_picking, self)._invoice_line_hook(cr, uid, move_line, invoice_line_id) From 1ef013fee87182c1e46c4a47e24168db38ab54b4 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 3 Feb 2011 23:23:51 -0200 Subject: [PATCH 017/223] l10n_br_stock, concertado bug ao criar nota fiscal apartir do picking --- l10n_br_delivery/stock.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/l10n_br_delivery/stock.py b/l10n_br_delivery/stock.py index 1e4f11415bc7..ea3759d754d6 100644 --- a/l10n_br_delivery/stock.py +++ b/l10n_br_delivery/stock.py @@ -27,13 +27,6 @@ class stock_picking(osv.osv): 'incoterm': fields.many2one('stock.incoterms', 'Tipo do Frete', help="Incoterm which stands for 'International Commercial terms' implies its a series of sales terms which are used in the commercial transaction."), } - def _invoice_line_hook(self, cr, uid, move_line, invoice_line_id): - '''Call after the creation of the invoice line''' - - self.pool.get('account.invoice.line').write(cr, uid, invoice_line_id, {'cfop_id': move_line.fiscal_operation_id.cfop_id.id, 'fiscal_operation_category_id': move_line.fiscal_operation_category_id.id ,'fiscal_operation_id': move_line.fiscal_operation_id.id}) - - return super(stock_picking, self)._invoice_line_hook(cr, uid, move_line, invoice_line_id) - def _invoice_hook(self, cr, uid, picking, invoice_id): '''Call after the creation of the invoice''' From 80474e9bcb1469f0bb97ae82de11c1f3285b54b6 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Mon, 28 Feb 2011 20:27:25 -0300 Subject: [PATCH 018/223] =?UTF-8?q?l10n=5Fbr=5Fbase=20-=20Filtro=20de=20CN?= =?UTF-8?q?PJ=20na=20vis=C3=A3o=20de=20parceiros,=20adi=C3=A7=C3=A3o=20da?= =?UTF-8?q?=20chave=20=C3=BAnica=20para=20restringir=20o=20cadastro=20de?= =?UTF-8?q?=20dois=20parceiros=20com=20o=20mesmo=20CPNJ=20e=20assim=20evit?= =?UTF-8?q?ando=20a=20duplica=C3=A7=C3=A3o=20do=20cadastro=20de=20parceiro?= =?UTF-8?q?,=20l10n=5Fbr=5Faccount=20-=20Colocado=20o=20numero=20da=20nota?= =?UTF-8?q?=20fiscal=20na=20pesquisa=20das=20notas=20fiscais,=20dividido?= =?UTF-8?q?=20opera=C3=A7=C3=B5es=20de=20servi=C3=A7os=20e=20mercadorias,?= =?UTF-8?q?=20opera=C3=A7=C3=A3o=20fiscal=20com=20a=20opera=C3=A7=C3=A3o?= =?UTF-8?q?=20de=20devolu=C3=A7=C3=A3o,=20filtro=20de=20opera=C3=A7=C3=B5e?= =?UTF-8?q?s=20por=20entrada=20e=20saida,=20serie=20de=20servico=20e=20ser?= =?UTF-8?q?ies=20de=20documentos=20fiscais,=20cadastro=20de=20cnae,=20orga?= =?UTF-8?q?niza=C3=A7=C3=A3o=20dos=20menus=20da=20localiza=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/sale.py | 1 - 1 file changed, 1 deletion(-) diff --git a/l10n_br_delivery/sale.py b/l10n_br_delivery/sale.py index 0518f38069c0..1c21bfb1aabf 100644 --- a/l10n_br_delivery/sale.py +++ b/l10n_br_delivery/sale.py @@ -54,7 +54,6 @@ def action_invoice_create(self, cr, uid, ids, grouped=False, states=['confirmed' 'fiscal_document_id': order.fiscal_operation_id.fiscal_document_id.id, 'document_serie_id': doc_serie_id[0], 'carrier_id': order.carrier_id.id, - 'vehicle_id': order.vehicle_id.id, 'incoterm': order.incoterm.id }) for inv_line in invoice.invoice_line: From 18059883489aec0465d46e27cbd283f0d2db2499 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Tue, 12 Apr 2011 19:52:47 -0300 Subject: [PATCH 019/223] =?UTF-8?q?l10n=5Fbr=5Faccount=20-=20Resolu=C3=A7?= =?UTF-8?q?=C3=A3o=20da=20nota=20fiscal=20de=20servi=C3=A7o.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_delivery/__openerp__.py b/l10n_br_delivery/__openerp__.py index 1281d90e568f..3c6fd2a1daa4 100644 --- a/l10n_br_delivery/__openerp__.py +++ b/l10n_br_delivery/__openerp__.py @@ -20,7 +20,7 @@ { 'name' : 'Delivery for Brazilian Localization', 'description' : 'Extend delivery module for Brazilian Localization', - 'author' : 'OpenERP Brasil', + 'author' : 'Akretion, OpenERP Brasil', 'website' : 'http://openerpbrasil.org', 'version' : '0.6', 'depends' : [ From e89203be160136000e05cc44e2e41459b0478ecc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Sun, 24 Apr 2011 04:17:29 -0300 Subject: [PATCH 020/223] [IMP] moved delivery data NFe validation to l10n_br_delivery so there is no mor hidden dependency during NFe validation; removed error accents so validation errors are properly shown (they could be translated ideally) --- l10n_br_delivery/invoice.py | 67 +++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/l10n_br_delivery/invoice.py b/l10n_br_delivery/invoice.py index 1174c83111a9..acb8cb2320ca 100644 --- a/l10n_br_delivery/invoice.py +++ b/l10n_br_delivery/invoice.py @@ -44,6 +44,73 @@ class account_invoice(osv.osv): 'amount_freight': fields.float('Frete', digits_compute=dp.get_precision('Account'), readonly=True, states={'draft':[('readonly',False)]}), } + def nfe_check(self, cr, uid, ids, context=None): + res = super(account_invoice, self).nfe_check(cr, uid, ids) + strErro = '' + for inv in self.browse(cr, uid, ids): + #endereco de entrega + if inv.partner_shipping_id: + + if inv.address_invoice_id != inv.partner_shipping_id: + + if not inv.partner_shipping_id.street: + strErro = 'Destinatario / Endereco de Entrega - Logradouro\n' + + if not inv.partner_shipping_id.number: + strErro = 'Destinatario / Endereco de Entrega - Numero\n' + + if not inv.address_invoice_id.zip: + strErro = 'Destinatario / Endereco de Entrega - CEP\n' + + if not inv.partner_shipping_id.state_id: + strErro = 'Destinatario / Endereco de Entrega - Estado\n' + else: + if not inv.partner_shipping_id.state_id.ibge_code: + strErro = 'Destinatario / Endereco de Entrega - Código do IBGE do estado\n' + if not inv.partner_shipping_id.state_id.name: + strErro = 'Destinatario / Endereco de Entrega - Nome do estado\n' + + if not inv.partner_shipping_id.city_id: + strErro = 'Destinatario / Endereco - Municipio\n' + else: + if not inv.partner_shipping_id.city_id.name: + strErro = 'Destinatario / Endereco de Entrega - Nome do municipio\n' + if not inv.partner_shipping_id.city_id.ibge_code: + strErro = 'Destinatario / Endereco de Entrega - Codigo do IBGE do municipio\n' + + if not inv.partner_shipping_id.country_id: + strErro = 'Destinatario / Endereco de Entrega - País\n' + else: + if not inv.partner_shipping_id.country_id.name: + strErro = 'Destinatario / Endereço de Entrega - Nome do pais\n' + if not inv.partner_shipping_id.country_id.bc_code: + strErro = 'Destinatario / Endereço de Entrega - Codigo do BC do pais\n' + + #Transportadora + if inv.carrier_id: + + if not inv.carrier_id.partner_id.legal_name: + strErro = 'Transportadora - Razão Social\n' + + if not inv.carrier_id.partner_id.cnpj_cpf: + strErro = 'Transportadora - CNPJ/CPF\n' + + #Dados do Veiculo + if inv.vehicle_id: + + if not inv.vehicle_id.plate: + strErro = 'Transportadora / Veículo - Placa\n' + + if not inv.vehicle_id.plate.state_id.code: + strErro = 'Transportadora / Veículo - UF da Placa\n' + + if not inv.vehicle_id.rntc_code: + strErro = 'Transportadora / Veículo - RNTC\n' + if strErro: + raise osv.except_osv(_('Error !'),_("Validação da Nota fiscal:\n '%s'") % (strErro.encode('utf-8'))) + + return res + account_invoice() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From 924ddf4ca435bfeb0a17ed6e82d144e7eb77884b Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Mon, 9 May 2011 16:17:41 -0300 Subject: [PATCH 021/223] =?UTF-8?q?Alterado=20o=20nome=20do=20campo=20city?= =?UTF-8?q?=5Fid=20no=20objeto=20res.partner.address=20para=20l10n=5Fbr=5F?= =?UTF-8?q?city=5Fid,=20mudado=20as=20referencias=20de=20estados=20e=20mun?= =?UTF-8?q?icipios=20no=20modulo=20l10n=5Fbr=5Fdata=5Fcep,=20pois=20esses?= =?UTF-8?q?=20arquivos=20que=20estavam=20no=20modulo=20l10n=5Fbr=5Fdata=5F?= =?UTF-8?q?base=20agora=20estao=20no=20l10n=5Fbr=5Fbase,=20alterado=20o=20?= =?UTF-8?q?modulo=20l10n=5Fbr=5Fstock=20para=20gerar=20notas=20fiscais=20d?= =?UTF-8?q?iretamente=20de=20uma=20movimenta=C3=A7=C3=A3o=20de=20estoque.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/delivery.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/l10n_br_delivery/delivery.py b/l10n_br_delivery/delivery.py index 09210aa1eb3b..4f3a89233035 100644 --- a/l10n_br_delivery/delivery.py +++ b/l10n_br_delivery/delivery.py @@ -42,13 +42,17 @@ class l10n_br_delivery_carrier_vehicle(osv.osv): 'rntc_code': fields.char('Codigo ANTT', size=32), 'country_id': fields.many2one('res.country', 'País'), 'state_id': fields.many2one('res.country.state', 'Estado', domain="[('country_id','=',country_id)]"), - 'city_id': fields.many2one('l10n_br_base.city', 'Municipio', domain="[('state_id','=',state_id)]"), + 'l10n_br_city_id': fields.many2one('l10n_br_base.city', 'Municipio', domain="[('state_id','=',state_id)]"), 'active': fields.boolean('Ativo'), 'manufacture_year': fields.char('Ano de Fabricação', size=4), 'model_year': fields.char('Ano do Modelo', size=4), 'type': fields.selection([('bau','Caminhão Baú')], 'Ano do Modelo'), 'carrier_id': fields.many2one('delivery.carrier', 'Carrier', select=True, required=True, ondelete='cascade'), } + + _defaults = { + 'carrier_id': True, + } l10n_br_delivery_carrier_vehicle() From 92182e925438afb7f99ecd7634b779686c4c298f Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 11 May 2011 16:39:28 -0300 Subject: [PATCH 022/223] =?UTF-8?q?Renomeado=20o=20campo=20city=5Fid=20par?= =?UTF-8?q?a=20o=20l10n=5Fbr=5Fcity=5Fid=20no=20objeto=20l10n=5Fbr=5Fbase.?= =?UTF-8?q?cep=20e=20as=20vis=C3=B5es=20para=20o=20objeto=20correspondente?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/delivery_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_delivery/delivery_view.xml b/l10n_br_delivery/delivery_view.xml index 8c80f0d905b2..ebe4e80a360a 100644 --- a/l10n_br_delivery/delivery_view.xml +++ b/l10n_br_delivery/delivery_view.xml @@ -20,7 +20,7 @@ - + From 43b80bf2f7ed4b0d26c5fe40afcb34c3205b4bfb Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Tue, 17 May 2011 14:24:01 -0300 Subject: [PATCH 023/223] =?UTF-8?q?l10n=5Fbr=5Faccount:=20extendido=20o=20?= =?UTF-8?q?wizard=20do=20plano=20de=20contas=20para=20copiar=20o=20novos?= =?UTF-8?q?=20campos=20dos=20modelos=20account.tax.template=20e=20account.?= =?UTF-8?q?tax.code=20quando=20for=20criado=20um=20plano=20de=20contas.=20?= =?UTF-8?q?movido=20o=20campo=20partner=5Fshipping=5Fid=20(endere=C3=A7o?= =?UTF-8?q?=20de=20entrega=20da=20nota=20fiscal)=20que=20era=20extendido?= =?UTF-8?q?=20no=20modulo=20l10n=5Fbr=5Fdelivery=20para=20o=20l10n=5Fbr=5F?= =?UTF-8?q?account?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/__openerp__.py | 2 +- l10n_br_delivery/account_invoice_view.xml | 11 ------- l10n_br_delivery/invoice.py | 39 ----------------------- 3 files changed, 1 insertion(+), 51 deletions(-) diff --git a/l10n_br_delivery/__openerp__.py b/l10n_br_delivery/__openerp__.py index 3c6fd2a1daa4..2ce33c261d14 100644 --- a/l10n_br_delivery/__openerp__.py +++ b/l10n_br_delivery/__openerp__.py @@ -24,7 +24,7 @@ 'website' : 'http://openerpbrasil.org', 'version' : '0.6', 'depends' : [ - 'delivery', + 'delivery', 'l10n_br_sale', 'l10n_br_stock', ], diff --git a/l10n_br_delivery/account_invoice_view.xml b/l10n_br_delivery/account_invoice_view.xml index 49d179d0007f..f788372ba389 100644 --- a/l10n_br_delivery/account_invoice_view.xml +++ b/l10n_br_delivery/account_invoice_view.xml @@ -42,17 +42,6 @@ - - - l10n_br_delivery.invoice.form2 - account.invoice - - - - - - - diff --git a/l10n_br_delivery/invoice.py b/l10n_br_delivery/invoice.py index acb8cb2320ca..02bc6e2871bb 100644 --- a/l10n_br_delivery/invoice.py +++ b/l10n_br_delivery/invoice.py @@ -32,7 +32,6 @@ class account_invoice(osv.osv): _inherit = 'account.invoice' _columns = { - 'partner_shipping_id': fields.many2one('res.partner.address', 'Endereço de Entrega', readonly=True, states={'draft': [('readonly', False)]}, help="Shipping address for current sales order."), 'carrier_id':fields.many2one("delivery.carrier","Carrier", readonly=True, states={'draft':[('readonly',False)]}), 'vehicle_id': fields.many2one('l10n_br_delivery.carrier.vehicle', 'Veículo', readonly=True, states={'draft': [('readonly', False)]}), 'incoterm': fields.many2one('stock.incoterms', 'Tipo do Frete', readonly=True, states={'draft': [('readonly', False)]}, help="Incoterm which stands for 'International Commercial terms' implies its a series of sales terms which are used in the commercial transaction."), @@ -48,44 +47,6 @@ def nfe_check(self, cr, uid, ids, context=None): res = super(account_invoice, self).nfe_check(cr, uid, ids) strErro = '' for inv in self.browse(cr, uid, ids): - #endereco de entrega - if inv.partner_shipping_id: - - if inv.address_invoice_id != inv.partner_shipping_id: - - if not inv.partner_shipping_id.street: - strErro = 'Destinatario / Endereco de Entrega - Logradouro\n' - - if not inv.partner_shipping_id.number: - strErro = 'Destinatario / Endereco de Entrega - Numero\n' - - if not inv.address_invoice_id.zip: - strErro = 'Destinatario / Endereco de Entrega - CEP\n' - - if not inv.partner_shipping_id.state_id: - strErro = 'Destinatario / Endereco de Entrega - Estado\n' - else: - if not inv.partner_shipping_id.state_id.ibge_code: - strErro = 'Destinatario / Endereco de Entrega - Código do IBGE do estado\n' - if not inv.partner_shipping_id.state_id.name: - strErro = 'Destinatario / Endereco de Entrega - Nome do estado\n' - - if not inv.partner_shipping_id.city_id: - strErro = 'Destinatario / Endereco - Municipio\n' - else: - if not inv.partner_shipping_id.city_id.name: - strErro = 'Destinatario / Endereco de Entrega - Nome do municipio\n' - if not inv.partner_shipping_id.city_id.ibge_code: - strErro = 'Destinatario / Endereco de Entrega - Codigo do IBGE do municipio\n' - - if not inv.partner_shipping_id.country_id: - strErro = 'Destinatario / Endereco de Entrega - País\n' - else: - if not inv.partner_shipping_id.country_id.name: - strErro = 'Destinatario / Endereço de Entrega - Nome do pais\n' - if not inv.partner_shipping_id.country_id.bc_code: - strErro = 'Destinatario / Endereço de Entrega - Codigo do BC do pais\n' - #Transportadora if inv.carrier_id: From 563f28d68af0eff307a999e19b0dc03ed2ea9aaf Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Tue, 24 May 2011 20:15:08 -0300 Subject: [PATCH 024/223] =?UTF-8?q?removido=20o=20m=C3=B3dulo=20l10n=5Fbr?= =?UTF-8?q?=5Ffp=5Frule=5Fsale=5Flink,=20pois=20foi=20resolvido=20o=20prob?= =?UTF-8?q?lema=20de=20incompatiblidade=20entre=20o=20m=C3=B3dulo=20accoun?= =?UTF-8?q?t=5Ffiscal=5Fposition=5Frule=5Fsale=20e=20delivery,=20pois=20os?= =?UTF-8?q?=20dois=20utilizam=20o=20mesmo=20m=C3=A9todo=20na=20ordem=20de?= =?UTF-8?q?=20venda?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/delivery.py | 38 +++++++++++++++++------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/l10n_br_delivery/delivery.py b/l10n_br_delivery/delivery.py index 4f3a89233035..952c85590840 100644 --- a/l10n_br_delivery/delivery.py +++ b/l10n_br_delivery/delivery.py @@ -23,9 +23,9 @@ class delivery_carrier(osv.osv): _inherit = "delivery.carrier" _columns = { - 'antt_code': fields.char('Codigo ANTT', size=32), - 'vehicle_ids': fields.one2many('l10n_br_delivery.carrier.vehicle', 'carrier_id', 'Vehicles'), - } + 'antt_code': fields.char('Codigo ANTT', size=32), + 'vehicle_ids': fields.one2many('l10n_br_delivery.carrier.vehicle', 'carrier_id', 'Vehicles'), + } delivery_carrier() @@ -35,20 +35,20 @@ class l10n_br_delivery_carrier_vehicle(osv.osv): _description = 'Veiculos das transportadoras' _columns = { - 'name': fields.char('Nome', size=32), - 'description': fields.char('Descrição', size=132), - 'plate': fields.char('Placa', size=7), - 'driver': fields.char('Condudor', size=64), - 'rntc_code': fields.char('Codigo ANTT', size=32), - 'country_id': fields.many2one('res.country', 'País'), - 'state_id': fields.many2one('res.country.state', 'Estado', domain="[('country_id','=',country_id)]"), - 'l10n_br_city_id': fields.many2one('l10n_br_base.city', 'Municipio', domain="[('state_id','=',state_id)]"), - 'active': fields.boolean('Ativo'), - 'manufacture_year': fields.char('Ano de Fabricação', size=4), - 'model_year': fields.char('Ano do Modelo', size=4), - 'type': fields.selection([('bau','Caminhão Baú')], 'Ano do Modelo'), - 'carrier_id': fields.many2one('delivery.carrier', 'Carrier', select=True, required=True, ondelete='cascade'), - } + 'name': fields.char('Nome', size=32), + 'description': fields.char('Descrição', size=132), + 'plate': fields.char('Placa', size=7), + 'driver': fields.char('Condudor', size=64), + 'rntc_code': fields.char('Codigo ANTT', size=32), + 'country_id': fields.many2one('res.country', 'País'), + 'state_id': fields.many2one('res.country.state', 'Estado', domain="[('country_id','=',country_id)]"), + 'l10n_br_city_id': fields.many2one('l10n_br_base.city', 'Municipio', domain="[('state_id','=',state_id)]"), + 'active': fields.boolean('Ativo'), + 'manufacture_year': fields.char('Ano de Fabricação', size=4), + 'model_year': fields.char('Ano do Modelo', size=4), + 'type': fields.selection([('bau','Caminhão Baú')], 'Ano do Modelo'), + 'carrier_id': fields.many2one('delivery.carrier', 'Carrier', select=True, required=True, ondelete='cascade'), + } _defaults = { 'carrier_id': True, @@ -56,7 +56,6 @@ class l10n_br_delivery_carrier_vehicle(osv.osv): l10n_br_delivery_carrier_vehicle() - class l10n_br_delivery_shipment(osv.osv): _name = 'l10n_br_delivery.shipment' @@ -103,8 +102,7 @@ def _get_picking_line(self, cr, uid, ids, context=None): 'carrier_tracking_ref': fields.char('Carrier Tracking Ref', size=32), 'number_of_packages': fields.integer('Number of Packages'), } - - + l10n_br_delivery_shipment() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From 11a861a7ce59003869540786dd377f73ee9b5a15 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 9 Jun 2011 23:02:40 -0300 Subject: [PATCH 025/223] =?UTF-8?q?l10n=5Fbr=5Faccount:=20implementados=20?= =?UTF-8?q?filtros=20na=20vis=C3=A3o=20da=20nota=20fiscal,=20de=20produtos?= =?UTF-8?q?=20e=20servi=C3=A7os?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/account_invoice_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/l10n_br_delivery/account_invoice_view.xml b/l10n_br_delivery/account_invoice_view.xml index f788372ba389..4b99fa7403ba 100644 --- a/l10n_br_delivery/account_invoice_view.xml +++ b/l10n_br_delivery/account_invoice_view.xml @@ -8,7 +8,7 @@ - + @@ -30,7 +30,7 @@ - + From 2ef5fb91b74f444a2649761dd95c743364b89580 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Mon, 18 Jul 2011 03:12:11 -0300 Subject: [PATCH 026/223] =?UTF-8?q?l10n=5Fbr=5Faccount=20alterada=20a=20ro?= =?UTF-8?q?tina=20de=20nfe=20para=20pegar=20o=20valor=20do=20c=C3=B3digo?= =?UTF-8?q?=20do=20pais=20corretamente?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/__init__.py | 2 +- l10n_br_delivery/__openerp__.py | 4 +++- l10n_br_delivery/delivery.py | 2 +- l10n_br_delivery/invoice.py | 2 +- l10n_br_delivery/sale.py | 2 +- l10n_br_delivery/stock.py | 2 +- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/l10n_br_delivery/__init__.py b/l10n_br_delivery/__init__.py index cf85afa1be5a..15037a2e92aa 100644 --- a/l10n_br_delivery/__init__.py +++ b/l10n_br_delivery/__init__.py @@ -4,7 +4,7 @@ # Copyright (C) 2009 Renato Lima - Akretion # # # #This program is free software: you can redistribute it and/or modify # -#it under the terms of the GNU General Public License as published by # +#it under the terms of the GNU Affero General Public License as published by # #the Free Software Foundation, either version 3 of the License, or # #(at your option) any later version. # # # diff --git a/l10n_br_delivery/__openerp__.py b/l10n_br_delivery/__openerp__.py index 2ce33c261d14..2de83039b6e1 100644 --- a/l10n_br_delivery/__openerp__.py +++ b/l10n_br_delivery/__openerp__.py @@ -4,7 +4,7 @@ # Copyright (C) 2010 Renato Lima - Akretion # # # #This program is free software: you can redistribute it and/or modify # -#it under the terms of the GNU General Public License as published by # +#it under the terms of the GNU Affero General Public License as published by # #the Free Software Foundation, either version 3 of the License, or # #(at your option) any later version. # # # @@ -20,6 +20,8 @@ { 'name' : 'Delivery for Brazilian Localization', 'description' : 'Extend delivery module for Brazilian Localization', + 'license': 'Affero GPL-3', + 'license': 'Affero GPL-3', 'author' : 'Akretion, OpenERP Brasil', 'website' : 'http://openerpbrasil.org', 'version' : '0.6', diff --git a/l10n_br_delivery/delivery.py b/l10n_br_delivery/delivery.py index 952c85590840..22f8c4d6958c 100644 --- a/l10n_br_delivery/delivery.py +++ b/l10n_br_delivery/delivery.py @@ -4,7 +4,7 @@ # Copyright (C) 2010 Renato Lima - Akretion # # # #This program is free software: you can redistribute it and/or modify # -#it under the terms of the GNU General Public License as published by # +#it under the terms of the GNU Affero General Public License as published by # #the Free Software Foundation, either version 3 of the License, or # #(at your option) any later version. # # # diff --git a/l10n_br_delivery/invoice.py b/l10n_br_delivery/invoice.py index 02bc6e2871bb..e6df1ae1a66b 100644 --- a/l10n_br_delivery/invoice.py +++ b/l10n_br_delivery/invoice.py @@ -4,7 +4,7 @@ # Copyright (C) 2010 Renato Lima - Akretion # # # #This program is free software: you can redistribute it and/or modify # -#it under the terms of the GNU General Public License as published by # +#it under the terms of the GNU Affero General Public License as published by # #the Free Software Foundation, either version 3 of the License, or # #(at your option) any later version. # # # diff --git a/l10n_br_delivery/sale.py b/l10n_br_delivery/sale.py index 1c21bfb1aabf..a0ca2e6505a9 100644 --- a/l10n_br_delivery/sale.py +++ b/l10n_br_delivery/sale.py @@ -4,7 +4,7 @@ # Copyright (C) 2009 Renato Lima - Akretion # # # #This program is free software: you can redistribute it and/or modify # -#it under the terms of the GNU General Public License as published by # +#it under the terms of the GNU Affero General Public License as published by # #the Free Software Foundation, either version 3 of the License, or # #(at your option) any later version. # # # diff --git a/l10n_br_delivery/stock.py b/l10n_br_delivery/stock.py index ea3759d754d6..a24f7d8aff18 100644 --- a/l10n_br_delivery/stock.py +++ b/l10n_br_delivery/stock.py @@ -4,7 +4,7 @@ # Copyright (C) 2009 Renato Lima - Akretion # # # #This program is free software: you can redistribute it and/or modify # -#it under the terms of the GNU General Public License as published by # +#it under the terms of the GNU Affero General Public License as published by # #the Free Software Foundation, either version 3 of the License, or # #(at your option) any later version. # # # From 86b1bb53bb622234c43356be10217b4ea7bbeca9 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Mon, 18 Jul 2011 04:16:53 -0300 Subject: [PATCH 027/223] =?UTF-8?q?deixar=20explicito=20a=20licen=C3=A7a?= =?UTF-8?q?=20da=20localiza=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/__openerp__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/l10n_br_delivery/__openerp__.py b/l10n_br_delivery/__openerp__.py index 2de83039b6e1..1a61db9d9867 100644 --- a/l10n_br_delivery/__openerp__.py +++ b/l10n_br_delivery/__openerp__.py @@ -20,8 +20,7 @@ { 'name' : 'Delivery for Brazilian Localization', 'description' : 'Extend delivery module for Brazilian Localization', - 'license': 'Affero GPL-3', - 'license': 'Affero GPL-3', + 'license': 'AGPL-3', 'author' : 'Akretion, OpenERP Brasil', 'website' : 'http://openerpbrasil.org', 'version' : '0.6', From b9815f2134367ea8cdb37fada56c938f41f96380 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Tue, 27 Sep 2011 19:01:30 -0300 Subject: [PATCH 028/223] =?UTF-8?q?l10n=5Fbr=5Fdelivery=20corrigida=20vis?= =?UTF-8?q?=C3=A3o=20herdada=20do=20l10n=5Fbr=5Faccount?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/account_invoice_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_delivery/account_invoice_view.xml b/l10n_br_delivery/account_invoice_view.xml index 4b99fa7403ba..0482e8f0ccdc 100644 --- a/l10n_br_delivery/account_invoice_view.xml +++ b/l10n_br_delivery/account_invoice_view.xml @@ -5,7 +5,7 @@ l10n_br_delivery.invoice.form account.invoice - + From 4652c8c0a8b7438da7686139015b3852736599b3 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Mon, 14 Nov 2011 15:46:47 -0200 Subject: [PATCH 029/223] =?UTF-8?q?l10n=5Fbr=5Faccount:=20alterada=20a=20v?= =?UTF-8?q?is=C3=A3o=20dos=20dados=20adicionais=20da=20nota=20fiscal=20de?= =?UTF-8?q?=20entrada=20e=20saida,=20resolvido=20m=C3=A9todos=20onchange?= =?UTF-8?q?=20da=20localiza=C3=A7=C3=A3o,=20l10n=5Fbr=5Fdelivery:=20criado?= =?UTF-8?q?=20menu=20para=20veiculos,=20otimizada=20a=20vis=C3=A3o=20de=20?= =?UTF-8?q?veiculos,=20l10n=5Fbrs:=20Adicionada=20a=20pasta=20test=20dos?= =?UTF-8?q?=20modulos=20da=20localiza=C3=A7=C3=A3o=20para=20implementa?= =?UTF-8?q?=C3=A7=C3=A3o=20de=20testes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/__init__.py | 1 + l10n_br_delivery/__openerp__.py | 2 + .../{invoice.py => account_invoice.py} | 0 l10n_br_delivery/account_invoice_view.xml | 54 +++++----- l10n_br_delivery/delivery.py | 76 -------------- l10n_br_delivery/delivery_view.xml | 24 +---- l10n_br_delivery/l10n_br_delivery.py | 94 ++++++++++++++++++ l10n_br_delivery/l10n_br_delivery_view.xml | 57 +++++++++++ l10n_br_delivery/security/ir.model.access.csv | 12 +++ .../security/ir.model.accesss.csv | Bin 0 -> 1536 bytes 10 files changed, 197 insertions(+), 123 deletions(-) rename l10n_br_delivery/{invoice.py => account_invoice.py} (100%) create mode 100644 l10n_br_delivery/l10n_br_delivery.py create mode 100644 l10n_br_delivery/l10n_br_delivery_view.xml create mode 100644 l10n_br_delivery/security/ir.model.access.csv create mode 100644 l10n_br_delivery/security/ir.model.accesss.csv diff --git a/l10n_br_delivery/__init__.py b/l10n_br_delivery/__init__.py index 15037a2e92aa..301cb3960934 100644 --- a/l10n_br_delivery/__init__.py +++ b/l10n_br_delivery/__init__.py @@ -21,6 +21,7 @@ import delivery import stock import invoice +import l10n_br_delivery # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/l10n_br_delivery/__openerp__.py b/l10n_br_delivery/__openerp__.py index 1a61db9d9867..edc078c19386 100644 --- a/l10n_br_delivery/__openerp__.py +++ b/l10n_br_delivery/__openerp__.py @@ -35,6 +35,8 @@ 'delivery_view.xml', 'sale_view.xml', 'stock_view.xml', + 'l10n_br_delivery_view.xml', + 'security/ir.model.access.csv', ], 'category' : 'Localisation', 'active': False, diff --git a/l10n_br_delivery/invoice.py b/l10n_br_delivery/account_invoice.py similarity index 100% rename from l10n_br_delivery/invoice.py rename to l10n_br_delivery/account_invoice.py diff --git a/l10n_br_delivery/account_invoice_view.xml b/l10n_br_delivery/account_invoice_view.xml index 0482e8f0ccdc..6bcf046bcb95 100644 --- a/l10n_br_delivery/account_invoice_view.xml +++ b/l10n_br_delivery/account_invoice_view.xml @@ -7,20 +7,22 @@ account.invoice - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -29,17 +31,19 @@ account.invoice - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/l10n_br_delivery/delivery.py b/l10n_br_delivery/delivery.py index 22f8c4d6958c..5662f3ea2b23 100644 --- a/l10n_br_delivery/delivery.py +++ b/l10n_br_delivery/delivery.py @@ -29,81 +29,5 @@ class delivery_carrier(osv.osv): delivery_carrier() -class l10n_br_delivery_carrier_vehicle(osv.osv): - - _name = 'l10n_br_delivery.carrier.vehicle' - _description = 'Veiculos das transportadoras' - - _columns = { - 'name': fields.char('Nome', size=32), - 'description': fields.char('Descrição', size=132), - 'plate': fields.char('Placa', size=7), - 'driver': fields.char('Condudor', size=64), - 'rntc_code': fields.char('Codigo ANTT', size=32), - 'country_id': fields.many2one('res.country', 'País'), - 'state_id': fields.many2one('res.country.state', 'Estado', domain="[('country_id','=',country_id)]"), - 'l10n_br_city_id': fields.many2one('l10n_br_base.city', 'Municipio', domain="[('state_id','=',state_id)]"), - 'active': fields.boolean('Ativo'), - 'manufacture_year': fields.char('Ano de Fabricação', size=4), - 'model_year': fields.char('Ano do Modelo', size=4), - 'type': fields.selection([('bau','Caminhão Baú')], 'Ano do Modelo'), - 'carrier_id': fields.many2one('delivery.carrier', 'Carrier', select=True, required=True, ondelete='cascade'), - } - - _defaults = { - 'carrier_id': True, - } - -l10n_br_delivery_carrier_vehicle() - -class l10n_br_delivery_shipment(osv.osv): - - _name = 'l10n_br_delivery.shipment' - - def _cal_weight(self, cr, uid, ids, name, args, context=None): - res = {} - uom_obj = self.pool.get('product.uom') - for picking in self.browse(cr, uid, ids, context): - total_weight = total_weight_net = 0.00 - - for move in picking.move_lines: - total_weight += move.weight - total_weight_net += move.weight_net - - res[picking.id] = { - 'weight': total_weight, - 'weight_net': total_weight_net, - } - return res - - def _get_picking_line(self, cr, uid, ids, context=None): - result = {} - for line in self.pool.get('stock.move').browse(cr, uid, ids, context=context): - result[line.picking_id.id] = True - return result.keys() - - _columns = { - 'code': fields.char('Nome', size=32), - 'description': fields.char('Descrição', size=132), - 'carrier_id': fields.many2one('delivery.carrier', 'Carrier', select=True, required=True), - 'vehicle_id': fields.many2one('l10n_br_delivery.carrier.vehicle', 'Vehicle', select=True, required=True), - - #'weight': fields.function(_cal_weight, method=True, type='float', string='Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_weight', - # store={ - # 'stock.picking': (lambda self, cr, uid, ids, c={}: ids, ['move_lines'], 20), - # 'stock.move': (_get_picking_line, ['product_id','product_qty','product_uom','product_uos_qty'], 20), - # }), - #'weight_net': fields.function(_cal_weight, method=True, type='float', string='Net Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_weight', - # store={ - # 'stock.picking': (lambda self, cr, uid, ids, c={}: ids, ['move_lines'], 20), - # 'stock.move': (_get_picking_line, ['product_id','product_qty','product_uom','product_uos_qty'], 20), - # }), - 'volume': fields.float('Volume'), - 'carrier_tracking_ref': fields.char('Carrier Tracking Ref', size=32), - 'number_of_packages': fields.integer('Number of Packages'), - } - -l10n_br_delivery_shipment() - # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/l10n_br_delivery/delivery_view.xml b/l10n_br_delivery/delivery_view.xml index ebe4e80a360a..0ae765373dc9 100644 --- a/l10n_br_delivery/delivery_view.xml +++ b/l10n_br_delivery/delivery_view.xml @@ -2,7 +2,7 @@ - + l10n_br_delivery.carrier.form delivery.carrier @@ -11,27 +11,7 @@ - -
- - - - - - - - - - - - - - - - - - - +
diff --git a/l10n_br_delivery/l10n_br_delivery.py b/l10n_br_delivery/l10n_br_delivery.py new file mode 100644 index 000000000000..90e397b9df89 --- /dev/null +++ b/l10n_br_delivery/l10n_br_delivery.py @@ -0,0 +1,94 @@ +# -*- encoding: utf-8 -*- +################################################################################# +# # +# Copyright (C) 2010 Renato Lima - Akretion # +# # +#This program is free software: you can redistribute it and/or modify # +#it under the terms of the GNU Affero General Public License as published by # +#the Free Software Foundation, either version 3 of the License, or # +#(at your option) any later version. # +# # +#This program is distributed in the hope that it will be useful, # +#but WITHOUT ANY WARRANTY; without even the implied warranty of # +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +#GNU General Public License for more details. # +# # +#You should have received a copy of the GNU General Public License # +#along with this program. If not, see . # +################################################################################# + +from osv import fields,osv + +class l10n_br_delivery_carrier_vehicle(osv.osv): + + _name = 'l10n_br_delivery.carrier.vehicle' + _description = 'Veiculos das transportadoras' + + _columns = { + 'name': fields.char('Nome',required=True, size=32), + 'description': fields.char('Descrição', size=132), + 'plate': fields.char('Placa', size=7), + 'driver': fields.char('Condudor', size=64), + 'rntc_code': fields.char('Codigo ANTT', size=32), + 'country_id': fields.many2one('res.country', 'País'), + 'state_id': fields.many2one('res.country.state', 'Estado', domain="[('country_id','=',country_id)]"), + 'l10n_br_city_id': fields.many2one('l10n_br_base.city', 'Municipio', domain="[('state_id','=',state_id)]"), + 'active': fields.boolean('Ativo'), + 'manufacture_year': fields.char('Ano de Fabricação', size=4), + 'model_year': fields.char('Ano do Modelo', size=4), + 'type': fields.selection([('bau','Caminhão Baú')], 'Ano do Modelo'), + 'carrier_id': fields.many2one('delivery.carrier', 'Carrier', select=True, required=True, ondelete='cascade'), + } + +l10n_br_delivery_carrier_vehicle() + +class l10n_br_delivery_shipment(osv.osv): + + _name = 'l10n_br_delivery.shipment' + + def _cal_weight(self, cr, uid, ids, name, args, context=None): + res = {} + uom_obj = self.pool.get('product.uom') + for picking in self.browse(cr, uid, ids, context): + total_weight = total_weight_net = 0.00 + + for move in picking.move_lines: + total_weight += move.weight + total_weight_net += move.weight_net + + res[picking.id] = { + 'weight': total_weight, + 'weight_net': total_weight_net, + } + return res + + def _get_picking_line(self, cr, uid, ids, context=None): + result = {} + for line in self.pool.get('stock.move').browse(cr, uid, ids, context=context): + result[line.picking_id.id] = True + return result.keys() + + _columns = { + 'code': fields.char('Nome', size=32), + 'description': fields.char('Descrição', size=132), + 'carrier_id': fields.many2one('delivery.carrier', 'Carrier', select=True, required=True), + 'vehicle_id': fields.many2one('l10n_br_delivery.carrier.vehicle', 'Vehicle', select=True, required=True), + + #'weight': fields.function(_cal_weight, method=True, type='float', string='Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_weight', + # store={ + # 'stock.picking': (lambda self, cr, uid, ids, c={}: ids, ['move_lines'], 20), + # 'stock.move': (_get_picking_line, ['product_id','product_qty','product_uom','product_uos_qty'], 20), + # }), + #'weight_net': fields.function(_cal_weight, method=True, type='float', string='Net Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_weight', + # store={ + # 'stock.picking': (lambda self, cr, uid, ids, c={}: ids, ['move_lines'], 20), + # 'stock.move': (_get_picking_line, ['product_id','product_qty','product_uom','product_uos_qty'], 20), + # }), + 'volume': fields.float('Volume'), + 'carrier_tracking_ref': fields.char('Carrier Tracking Ref', size=32), + 'number_of_packages': fields.integer('Number of Packages'), + } + +l10n_br_delivery_shipment() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/l10n_br_delivery/l10n_br_delivery_view.xml b/l10n_br_delivery/l10n_br_delivery_view.xml new file mode 100644 index 000000000000..02bec0808035 --- /dev/null +++ b/l10n_br_delivery/l10n_br_delivery_view.xml @@ -0,0 +1,57 @@ + + + + + + + l10n_br_delivery.carrier.vehicle.form + l10n_br_delivery.carrier.vehicle + form + +
+ + + + + + + + + + + + + + + + + +
+ + + l10n_br_delivery.carrier.vehicle.tree + l10n_br_delivery.carrier.vehicle + tree + + + + + + + + + + + Veículo + ir.actions.act_window + l10n_br_delivery.carrier.vehicle + tree,form + form + + + + + +
+ +
\ No newline at end of file diff --git a/l10n_br_delivery/security/ir.model.access.csv b/l10n_br_delivery/security/ir.model.access.csv new file mode 100644 index 000000000000..5ea057c1e8f4 --- /dev/null +++ b/l10n_br_delivery/security/ir.model.access.csv @@ -0,0 +1,12 @@ +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +"access_l10n_br_delivery_carrier_vehicle_sale","l10n_br_delivery_carrier_vehicle","model_l10n_br_delivery_carrier_vehicle","base.group_sale_salesman",1,0,0,0 +"access_l10n_br_delivery_carrier_vehicle_sale_manager","l10n_br_delivery_carrier_vehicle","model_l10n_br_delivery_carrier_vehicle","base.group_sale_manager",1,0,0,0 +"access_l10n_br_delivery_carrier_vehicle_partner_manager","l10n_br_delivery_carrier_vehicle","model_l10n_br_delivery_carrier_vehicle","base.group_partner_manager",1,0,0,0 +"access_l10n_br_delivery_carrier_vehicle_stock_user","l10n_br_delivery_carrier_vehicle","model_l10n_br_delivery_carrier_vehicle","stock.group_stock_user",1,0,0,0 +"access_l10n_br_delivery_carrier_vehicle_stock_manager","l10n_br_delivery_carrier_vehicle","model_l10n_br_delivery_carrier_vehicle","stock.group_stock_manager",1,1,1,1 +"access_l10n_br_delivery_shipment_sale","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","base.group_sale_salesman",1,0,0,0 +"access_l10n_br_delivery_shipment_sale_manager","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","base.group_sale_manager",1,0,0,0 +"access_l10n_br_delivery_shipment_partner_manager","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","base.group_partner_manager",1,0,0,0 +"access_l10n_br_delivery_shipment_stock_user","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","stock.group_stock_user",1,0,0,0 +"access_l10n_br_delivery_shipment_stock_manager","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","stock.group_stock_manager",1,1,1,1 + diff --git a/l10n_br_delivery/security/ir.model.accesss.csv b/l10n_br_delivery/security/ir.model.accesss.csv new file mode 100644 index 0000000000000000000000000000000000000000..2f7d76bd3d559ee6baedc4ede64a613733d06aa0 GIT binary patch literal 1536 zcmca`Uhu)fjZzO8(10}qGsD0CoD6J8;*3Bx2!nwD15p0|e-Il+gV;c!Q80u;;4jdv zp!gdFBQpeo81jLzgh7G9l_3vE7co?VvN6#>jDZy;&l95&xx64oJs~y7F-J%(NPg6Q JNVyFP3jh_g|5pG2 literal 0 HcmV?d00001 From ffc1bd0c4a4a84a82815b3500ae60d8928dfacf6 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Tue, 15 Nov 2011 00:33:22 -0200 Subject: [PATCH 030/223] =?UTF-8?q?l10n=5Fbr=5Fsale=20e=20l10n=5Fbr=5Fdeli?= =?UTF-8?q?very:=20Resolvido=20compatibilidade=20entre=20os=20modulos,=20l?= =?UTF-8?q?10n=5Fbrs:=20adicionado=20a=20pasta=20test=20para=20a=20elabora?= =?UTF-8?q?=C3=A7=C3=A3o=20de=20testes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/__init__.py | 4 ++-- l10n_br_delivery/__openerp__.py | 6 +++--- l10n_br_delivery/sale.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/l10n_br_delivery/__init__.py b/l10n_br_delivery/__init__.py index 301cb3960934..092981e7200e 100644 --- a/l10n_br_delivery/__init__.py +++ b/l10n_br_delivery/__init__.py @@ -18,10 +18,10 @@ ################################################################################# import sale +import l10n_br_delivery import delivery -import stock import invoice -import l10n_br_delivery +import stock # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/l10n_br_delivery/__openerp__.py b/l10n_br_delivery/__openerp__.py index edc078c19386..8d2080963dd8 100644 --- a/l10n_br_delivery/__openerp__.py +++ b/l10n_br_delivery/__openerp__.py @@ -25,9 +25,9 @@ 'website' : 'http://openerpbrasil.org', 'version' : '0.6', 'depends' : [ - 'delivery', - 'l10n_br_sale', - 'l10n_br_stock', + 'l10n_br_stock', + 'l10n_br_sale', + 'delivery', ], 'init_xml': [], 'update_xml' : [ diff --git a/l10n_br_delivery/sale.py b/l10n_br_delivery/sale.py index a0ca2e6505a9..dc90d89e456d 100644 --- a/l10n_br_delivery/sale.py +++ b/l10n_br_delivery/sale.py @@ -31,7 +31,7 @@ class sale_order(osv.osv): _inherit = 'sale.order' - + def action_invoice_create(self, cr, uid, ids, grouped=False, states=['confirmed', 'done', 'exception'], date_inv = False, context=None): result = super(sale_order, self).action_invoice_create(cr, uid, ids, grouped, states, date_inv, context) From 7a06d0ea3e23f66b9d3445462201079c8e0361a0 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 23 Nov 2011 01:31:14 -0200 Subject: [PATCH 031/223] =?UTF-8?q?alterado=20coment=C3=A1rios=20dos=20arq?= =?UTF-8?q?uivos=20*.py=20e=20mudado=20estilo=20de=20codifica=C3=A7=C3=A3o?= =?UTF-8?q?=20para=20ficar=20mais=20limpo=20o=20c=C3=B3digo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/__init__.py | 5 ++-- l10n_br_delivery/__openerp__.py | 4 +-- l10n_br_delivery/account_invoice.py | 33 +++++++++++++---------- l10n_br_delivery/delivery.py | 6 ++--- l10n_br_delivery/l10n_br_delivery.py | 39 ++++++++++------------------ l10n_br_delivery/sale.py | 14 ++++------ l10n_br_delivery/stock.py | 17 +++++++----- 7 files changed, 56 insertions(+), 62 deletions(-) diff --git a/l10n_br_delivery/__init__.py b/l10n_br_delivery/__init__.py index 092981e7200e..3c69fc10e09b 100644 --- a/l10n_br_delivery/__init__.py +++ b/l10n_br_delivery/__init__.py @@ -11,9 +11,9 @@ #This program is distributed in the hope that it will be useful, # #but WITHOUT ANY WARRANTY; without even the implied warranty of # #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -#GNU General Public License for more details. # +#GNU Affero General Public License for more details. # # # -#You should have received a copy of the GNU General Public License # +#You should have received a copy of the GNU Affero General Public License # #along with this program. If not, see . # ################################################################################# @@ -24,4 +24,3 @@ import stock # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/l10n_br_delivery/__openerp__.py b/l10n_br_delivery/__openerp__.py index 8d2080963dd8..b4950e66b5b1 100644 --- a/l10n_br_delivery/__openerp__.py +++ b/l10n_br_delivery/__openerp__.py @@ -11,9 +11,9 @@ #This program is distributed in the hope that it will be useful, # #but WITHOUT ANY WARRANTY; without even the implied warranty of # #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -#GNU General Public License for more details. # +#GNU Affero General Public License for more details. # # # -#You should have received a copy of the GNU General Public License # +#You should have received a copy of the GNU Affero General Public License # #along with this program. If not, see . # ################################################################################# diff --git a/l10n_br_delivery/account_invoice.py b/l10n_br_delivery/account_invoice.py index e6df1ae1a66b..af4d835c2141 100644 --- a/l10n_br_delivery/account_invoice.py +++ b/l10n_br_delivery/account_invoice.py @@ -11,9 +11,9 @@ #This program is distributed in the hope that it will be useful, # #but WITHOUT ANY WARRANTY; without even the implied warranty of # #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -#GNU General Public License for more details. # +#GNU Affero General Public License for more details. # # # -#You should have received a copy of the GNU General Public License # +#You should have received a copy of the GNU Affero General Public License # #along with this program. If not, see . # ################################################################################# @@ -25,29 +25,34 @@ from tools import config from tools.translate import _ -############################################################################## -# Fatura (Nota Fiscal) Personalizado -############################################################################## class account_invoice(osv.osv): + _inherit = 'account.invoice' _columns = { 'carrier_id':fields.many2one("delivery.carrier","Carrier", readonly=True, states={'draft':[('readonly',False)]}), - 'vehicle_id': fields.many2one('l10n_br_delivery.carrier.vehicle', 'Veículo', readonly=True, states={'draft': [('readonly', False)]}), - 'incoterm': fields.many2one('stock.incoterms', 'Tipo do Frete', readonly=True, states={'draft': [('readonly', False)]}, help="Incoterm which stands for 'International Commercial terms' implies its a series of sales terms which are used in the commercial transaction."), - 'weight': fields.float('Gross weight', help="The gross weight in Kg.", readonly=True, states={'draft':[('readonly',False)]}), - 'weight_net': fields.float('Net weight', help="The net weight in Kg.", readonly=True, states={'draft':[('readonly',False)]}), + 'vehicle_id': fields.many2one('l10n_br_delivery.carrier.vehicle', 'Veículo', readonly=True, + states={'draft': [('readonly', False)]}), + 'incoterm': fields.many2one('stock.incoterms', 'Tipo do Frete', readonly=True, states={'draft': [('readonly', False)]}, + help="Incoterm which stands for 'International Commercial terms' implies its a series of sales terms which are used in the commercial transaction."), + 'weight': fields.float('Gross weight', help="The gross weight in Kg.", readonly=True, + states={'draft':[('readonly',False)]}), + 'weight_net': fields.float('Net weight', help="The net weight in Kg.", readonly=True, + states={'draft':[('readonly',False)]}), 'number_of_packages': fields.integer('Volume', readonly=True, states={'draft':[('readonly',False)]}), - 'amount_insurance': fields.float('Valor do Seguro', digits_compute=dp.get_precision('Account'), readonly=True, states={'draft':[('readonly',False)]}), - 'amount_costs': fields.float('Outros Custos', digits_compute=dp.get_precision('Account'), readonly=True, states={'draft':[('readonly',False)]}), - 'amount_freight': fields.float('Frete', digits_compute=dp.get_precision('Account'), readonly=True, states={'draft':[('readonly',False)]}), + 'amount_insurance': fields.float('Valor do Seguro', digits_compute=dp.get_precision('Account'), readonly=True, + states={'draft':[('readonly',False)]}), + 'amount_costs': fields.float('Outros Custos', digits_compute=dp.get_precision('Account'), readonly=True, + states={'draft':[('readonly',False)]}), + 'amount_freight': fields.float('Frete', digits_compute=dp.get_precision('Account'), readonly=True, + states={'draft':[('readonly',False)]}), } def nfe_check(self, cr, uid, ids, context=None): res = super(account_invoice, self).nfe_check(cr, uid, ids) strErro = '' for inv in self.browse(cr, uid, ids): - #Transportadora + #Carrier if inv.carrier_id: if not inv.carrier_id.partner_id.legal_name: @@ -56,7 +61,7 @@ def nfe_check(self, cr, uid, ids, context=None): if not inv.carrier_id.partner_id.cnpj_cpf: strErro = 'Transportadora - CNPJ/CPF\n' - #Dados do Veiculo + #Carrier Vehicle if inv.vehicle_id: if not inv.vehicle_id.plate: diff --git a/l10n_br_delivery/delivery.py b/l10n_br_delivery/delivery.py index 5662f3ea2b23..e82e453a4741 100644 --- a/l10n_br_delivery/delivery.py +++ b/l10n_br_delivery/delivery.py @@ -11,15 +11,16 @@ #This program is distributed in the hope that it will be useful, # #but WITHOUT ANY WARRANTY; without even the implied warranty of # #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -#GNU General Public License for more details. # +#GNU Affero General Public License for more details. # # # -#You should have received a copy of the GNU General Public License # +#You should have received a copy of the GNU Affero General Public License # #along with this program. If not, see . # ################################################################################# from osv import fields,osv class delivery_carrier(osv.osv): + _inherit = "delivery.carrier" _columns = { @@ -30,4 +31,3 @@ class delivery_carrier(osv.osv): delivery_carrier() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/l10n_br_delivery/l10n_br_delivery.py b/l10n_br_delivery/l10n_br_delivery.py index 90e397b9df89..b2d33ca02030 100644 --- a/l10n_br_delivery/l10n_br_delivery.py +++ b/l10n_br_delivery/l10n_br_delivery.py @@ -11,9 +11,9 @@ #This program is distributed in the hope that it will be useful, # #but WITHOUT ANY WARRANTY; without even the implied warranty of # #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -#GNU General Public License for more details. # +#GNU Affero General Public License for more details. # # # -#You should have received a copy of the GNU General Public License # +#You should have received a copy of the GNU Affero General Public License # #along with this program. If not, see . # ################################################################################# @@ -45,7 +45,17 @@ class l10n_br_delivery_carrier_vehicle(osv.osv): class l10n_br_delivery_shipment(osv.osv): _name = 'l10n_br_delivery.shipment' - + + _columns = { + 'code': fields.char('Nome', size=32), + 'description': fields.char('Descrição', size=132), + 'carrier_id': fields.many2one('delivery.carrier', 'Carrier', select=True, required=True), + 'vehicle_id': fields.many2one('l10n_br_delivery.carrier.vehicle', 'Vehicle', select=True, required=True), + 'volume': fields.float('Volume'), + 'carrier_tracking_ref': fields.char('Carrier Tracking Ref', size=32), + 'number_of_packages': fields.integer('Number of Packages'), + } + def _cal_weight(self, cr, uid, ids, name, args, context=None): res = {} uom_obj = self.pool.get('product.uom') @@ -67,28 +77,7 @@ def _get_picking_line(self, cr, uid, ids, context=None): for line in self.pool.get('stock.move').browse(cr, uid, ids, context=context): result[line.picking_id.id] = True return result.keys() - - _columns = { - 'code': fields.char('Nome', size=32), - 'description': fields.char('Descrição', size=132), - 'carrier_id': fields.many2one('delivery.carrier', 'Carrier', select=True, required=True), - 'vehicle_id': fields.many2one('l10n_br_delivery.carrier.vehicle', 'Vehicle', select=True, required=True), - - #'weight': fields.function(_cal_weight, method=True, type='float', string='Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_weight', - # store={ - # 'stock.picking': (lambda self, cr, uid, ids, c={}: ids, ['move_lines'], 20), - # 'stock.move': (_get_picking_line, ['product_id','product_qty','product_uom','product_uos_qty'], 20), - # }), - #'weight_net': fields.function(_cal_weight, method=True, type='float', string='Net Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_weight', - # store={ - # 'stock.picking': (lambda self, cr, uid, ids, c={}: ids, ['move_lines'], 20), - # 'stock.move': (_get_picking_line, ['product_id','product_qty','product_uom','product_uos_qty'], 20), - # }), - 'volume': fields.float('Volume'), - 'carrier_tracking_ref': fields.char('Carrier Tracking Ref', size=32), - 'number_of_packages': fields.integer('Number of Packages'), - } l10n_br_delivery_shipment() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/l10n_br_delivery/sale.py b/l10n_br_delivery/sale.py index dc90d89e456d..b1dc45421d28 100644 --- a/l10n_br_delivery/sale.py +++ b/l10n_br_delivery/sale.py @@ -11,9 +11,9 @@ #This program is distributed in the hope that it will be useful, # #but WITHOUT ANY WARRANTY; without even the implied warranty of # #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -#GNU General Public License for more details. # +#GNU Affero General Public License for more details. # # # -#You should have received a copy of the GNU General Public License # +#You should have received a copy of the GNU Affero General Public License # #along with this program. If not, see . # ################################################################################# @@ -25,14 +25,12 @@ from tools import config from tools.translate import _ -############################################################################## -# Pedido de venda customizado -############################################################################## class sale_order(osv.osv): _inherit = 'sale.order' - def action_invoice_create(self, cr, uid, ids, grouped=False, states=['confirmed', 'done', 'exception'], date_inv = False, context=None): + def action_invoice_create(self, cr, uid, ids, grouped=False, \ + states=['confirmed', 'done', 'exception'], date_inv = False, context=None): result = super(sale_order, self).action_invoice_create(cr, uid, ids, grouped, states, date_inv, context) @@ -73,10 +71,8 @@ def action_ship_create(self, cr, uid, ids, *args): sale_order() -############################################################################## -# Linha da Ordem de Venda Customizada -############################################################################## class sale_order_line(osv.osv): + _inherit = 'sale.order.line' def create_sale_order_line_invoice(self, cr, uid, ids, context=None): diff --git a/l10n_br_delivery/stock.py b/l10n_br_delivery/stock.py index a24f7d8aff18..8274c667266f 100644 --- a/l10n_br_delivery/stock.py +++ b/l10n_br_delivery/stock.py @@ -11,21 +11,24 @@ #This program is distributed in the hope that it will be useful, # #but WITHOUT ANY WARRANTY; without even the implied warranty of # #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -#GNU General Public License for more details. # +#GNU Affero General Public License for more details. # # # -#You should have received a copy of the GNU General Public License # +#You should have received a copy of the GNU Affero General Public License # #along with this program. If not, see . # ################################################################################# from osv import osv, fields class stock_picking(osv.osv): + _inherit = "stock.picking" _description = "Picking List" + _columns = { - 'vehicle_id': fields.many2one('l10n_br_delivery.carrier.vehicle', 'Veículo'), - 'incoterm': fields.many2one('stock.incoterms', 'Tipo do Frete', help="Incoterm which stands for 'International Commercial terms' implies its a series of sales terms which are used in the commercial transaction."), - } + 'vehicle_id': fields.many2one('l10n_br_delivery.carrier.vehicle', 'Veículo'), + 'incoterm': fields.many2one('stock.incoterms', 'Tipo do Frete', + help="Incoterm which stands for 'International Commercial terms' implies its a series of sales terms which are used in the commercial transaction."), + } def _invoice_hook(self, cr, uid, picking, invoice_id): '''Call after the creation of the invoice''' @@ -47,4 +50,6 @@ def _invoice_hook(self, cr, uid, picking, invoice_id): return super(stock_picking, self)._invoice_hook(cr, uid, picking, invoice_id) -stock_picking() \ No newline at end of file +stock_picking() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From ceee435fd4e3c97e96dbfa1c89e523babfc6b973 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 23 Nov 2011 03:02:46 -0200 Subject: [PATCH 032/223] =?UTF-8?q?Removido=20'\'=20do=20c=C3=B3digo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_delivery/sale.py b/l10n_br_delivery/sale.py index b1dc45421d28..f209068ca5a4 100644 --- a/l10n_br_delivery/sale.py +++ b/l10n_br_delivery/sale.py @@ -29,7 +29,7 @@ class sale_order(osv.osv): _inherit = 'sale.order' - def action_invoice_create(self, cr, uid, ids, grouped=False, \ + def action_invoice_create(self, cr, uid, ids, grouped=False, states=['confirmed', 'done', 'exception'], date_inv = False, context=None): result = super(sale_order, self).action_invoice_create(cr, uid, ids, grouped, states, date_inv, context) From 65633ea57f5c8c3da57414e99dde3739338aa6df Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 23 Nov 2011 03:40:43 -0200 Subject: [PATCH 033/223] =?UTF-8?q?l10n=5Fbr=5Fdelivery=20corrigido=20impo?= =?UTF-8?q?rta=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_delivery/__init__.py b/l10n_br_delivery/__init__.py index 3c69fc10e09b..9f198f3c40d6 100644 --- a/l10n_br_delivery/__init__.py +++ b/l10n_br_delivery/__init__.py @@ -20,7 +20,7 @@ import sale import l10n_br_delivery import delivery -import invoice +import account_invoice import stock # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From e63241b6b84f4599a4ebea8e57731ae1f4a56588 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 26 Jan 2012 17:39:51 -0200 Subject: [PATCH 034/223] =?UTF-8?q?l10n=5Fbr=5Fstock:=20Adicionado=20nas?= =?UTF-8?q?=20condi=C3=A7=C3=B5es=20de=20entregas=20o=20campo=20de=20despe?= =?UTF-8?q?sa=20por=20conta=20de:=200=20-=20Emitente,=201=20-=20Emitente?= =?UTF-8?q?=20e=20Destinat=C3=A1rio,=202=20-=20Emitente/Destinat=C3=A1rio?= =?UTF-8?q?=20e=209=20-=20Sem=20Frete,=20l10n=5Fbr=5Faccount:=20Alterado?= =?UTF-8?q?=20a=20exporta=C3=A7=C3=A3o=20da=20NFe=20para=20incluir=20o=20n?= =?UTF-8?q?ovo=20campo=20de=20frete=20por=20conta.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_delivery/sale.py b/l10n_br_delivery/sale.py index f209068ca5a4..ebc5bd11a212 100644 --- a/l10n_br_delivery/sale.py +++ b/l10n_br_delivery/sale.py @@ -52,7 +52,7 @@ def action_invoice_create(self, cr, uid, ids, grouped=False, 'fiscal_document_id': order.fiscal_operation_id.fiscal_document_id.id, 'document_serie_id': doc_serie_id[0], 'carrier_id': order.carrier_id.id, - 'incoterm': order.incoterm.id + 'incoterm': order.incoterm and order.incoterm.id or False }) for inv_line in invoice.invoice_line: self.pool.get('account.invoice.line').write(cr, uid, inv_line.id, {'cfop_id': order.fiscal_operation_id.cfop_id.id}) From da666955ab69860c12c01b2f50b2d92414edacd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Sun, 18 Mar 2012 20:56:21 -0300 Subject: [PATCH 035/223] [REF] more empty lines removal --- l10n_br_delivery/delivery.py | 1 - 1 file changed, 1 deletion(-) diff --git a/l10n_br_delivery/delivery.py b/l10n_br_delivery/delivery.py index e82e453a4741..84724f332d4d 100644 --- a/l10n_br_delivery/delivery.py +++ b/l10n_br_delivery/delivery.py @@ -20,7 +20,6 @@ from osv import fields,osv class delivery_carrier(osv.osv): - _inherit = "delivery.carrier" _columns = { From ea241ffad7cf4e4d3dfac9c52b504abaf1cd7514 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Thu, 22 Mar 2012 01:31:45 -0300 Subject: [PATCH 036/223] [IMP] l10n_br_delivery: do not blow out in case of missing fiscal parameters on picking when creating invoice --- l10n_br_delivery/stock.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/l10n_br_delivery/stock.py b/l10n_br_delivery/stock.py index 8274c667266f..97b508908c00 100644 --- a/l10n_br_delivery/stock.py +++ b/l10n_br_delivery/stock.py @@ -20,7 +20,6 @@ from osv import osv, fields class stock_picking(osv.osv): - _inherit = "stock.picking" _description = "Picking List" @@ -32,16 +31,15 @@ class stock_picking(osv.osv): def _invoice_hook(self, cr, uid, picking, invoice_id): '''Call after the creation of the invoice''' - self.pool.get('account.invoice').write(cr, uid, invoice_id, { 'partner_shipping_id': picking.address_id.id, - 'fiscal_operation_category_id': picking.fiscal_operation_category_id.id, - 'fiscal_operation_id': picking.fiscal_operation_id.id, - 'cfop_id': picking.fiscal_operation_id.cfop_id.id, - 'fiscal_document_id': picking.fiscal_operation_id.fiscal_document_id.id, - 'fiscal_position': picking.fiscal_position.id, - 'carrier_id': picking.carrier_id.id, - 'vehicle_id': picking.vehicle_id.id, + 'fiscal_operation_category_id': picking.fiscal_operation_category_id and picking.fiscal_operation_category_id.id, + 'fiscal_operation_id': picking.fiscal_operation_id and picking.fiscal_operation_id.id, + 'cfop_id': picking.fiscal_operation_id and picking.fiscal_operation_id.cfop_id.id, + 'fiscal_document_id': picking.fiscal_operation_id and picking.fiscal_operation_id.fiscal_document_id.id, + 'fiscal_position': picking.fiscal_position and picking.fiscal_position.id, + 'carrier_id': picking.carrier_id and picking.carrier_id.id, + 'vehicle_id': picking.vehicle_id and picking.vehicle_id.id, 'incoterm': picking.incoterm.id, 'weight': picking.weight, 'weight_net': picking.weight_net, From 52e5e715d4d2997efaee8676298eb113ccf89215 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Tue, 30 Oct 2012 13:04:43 -0200 Subject: [PATCH 037/223] =?UTF-8?q?l10n=5Fbr=5Fdelivery:=20limpeza=20e=20f?= =?UTF-8?q?ormata=C3=A7=C3=A3o=20do=20c=C3=B3digo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/__init__.py | 36 +++++---- l10n_br_delivery/__openerp__.py | 38 +++++----- l10n_br_delivery/account_invoice.py | 88 ++++++++++++---------- l10n_br_delivery/delivery.py | 44 +++++------ l10n_br_delivery/sale.py | 111 +++++++++++++++------------- l10n_br_delivery/stock.py | 79 ++++++++++---------- 6 files changed, 206 insertions(+), 190 deletions(-) diff --git a/l10n_br_delivery/__init__.py b/l10n_br_delivery/__init__.py index 9f198f3c40d6..41c7601a3f91 100644 --- a/l10n_br_delivery/__init__.py +++ b/l10n_br_delivery/__init__.py @@ -1,26 +1,24 @@ # -*- encoding: utf-8 -*- -################################################################################# -# # -# Copyright (C) 2009 Renato Lima - Akretion # -# # -#This program is free software: you can redistribute it and/or modify # -#it under the terms of the GNU Affero General Public License as published by # -#the Free Software Foundation, either version 3 of the License, or # -#(at your option) any later version. # -# # -#This program is distributed in the hope that it will be useful, # -#but WITHOUT ANY WARRANTY; without even the implied warranty of # -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -#GNU Affero General Public License for more details. # -# # -#You should have received a copy of the GNU Affero General Public License # -#along with this program. If not, see . # -################################################################################# +############################################################################### +# # +# Copyright (C) 2009 Renato Lima - Akretion # +# # +#This program is free software: you can redistribute it and/or modify # +#it under the terms of the GNU Affero General Public License as published by # +#the Free Software Foundation, either version 3 of the License, or # +#(at your option) any later version. # +# # +#This program is distributed in the hope that it will be useful, # +#but WITHOUT ANY WARRANTY; without even the implied warranty of # +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +#GNU Affero General Public License for more details. # +# # +#You should have received a copy of the GNU Affero General Public License # +#along with this program. If not, see . # +############################################################################### import sale import l10n_br_delivery import delivery import account_invoice import stock - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/l10n_br_delivery/__openerp__.py b/l10n_br_delivery/__openerp__.py index b4950e66b5b1..f96a615ccece 100644 --- a/l10n_br_delivery/__openerp__.py +++ b/l10n_br_delivery/__openerp__.py @@ -1,21 +1,21 @@ # -*- encoding: utf-8 -*- -################################################################################# -# # -# Copyright (C) 2010 Renato Lima - Akretion # -# # -#This program is free software: you can redistribute it and/or modify # -#it under the terms of the GNU Affero General Public License as published by # -#the Free Software Foundation, either version 3 of the License, or # -#(at your option) any later version. # -# # -#This program is distributed in the hope that it will be useful, # -#but WITHOUT ANY WARRANTY; without even the implied warranty of # -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -#GNU Affero General Public License for more details. # -# # -#You should have received a copy of the GNU Affero General Public License # -#along with this program. If not, see . # -################################################################################# +############################################################################### +# # +# Copyright (C) 2010 Renato Lima - Akretion # +# # +#This program is free software: you can redistribute it and/or modify # +#it under the terms of the GNU Affero General Public License as published by # +#the Free Software Foundation, either version 3 of the License, or # +#(at your option) any later version. # +# # +#This program is distributed in the hope that it will be useful, # +#but WITHOUT ANY WARRANTY; without even the implied warranty of # +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +#GNU Affero General Public License for more details. # +# # +#You should have received a copy of the GNU Affero General Public License # +#along with this program. If not, see . # +############################################################################### { 'name' : 'Delivery for Brazilian Localization', @@ -28,7 +28,7 @@ 'l10n_br_stock', 'l10n_br_sale', 'delivery', - ], + ], 'init_xml': [], 'update_xml' : [ 'account_invoice_view.xml', @@ -42,5 +42,3 @@ 'active': False, 'installable': True } - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/l10n_br_delivery/account_invoice.py b/l10n_br_delivery/account_invoice.py index af4d835c2141..b7f637011ca0 100644 --- a/l10n_br_delivery/account_invoice.py +++ b/l10n_br_delivery/account_invoice.py @@ -1,21 +1,21 @@ # -*- encoding: utf-8 -*- -################################################################################# -# # -# Copyright (C) 2010 Renato Lima - Akretion # -# # -#This program is free software: you can redistribute it and/or modify # -#it under the terms of the GNU Affero General Public License as published by # -#the Free Software Foundation, either version 3 of the License, or # -#(at your option) any later version. # -# # -#This program is distributed in the hope that it will be useful, # -#but WITHOUT ANY WARRANTY; without even the implied warranty of # -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -#GNU Affero General Public License for more details. # -# # -#You should have received a copy of the GNU Affero General Public License # -#along with this program. If not, see . # -################################################################################# +############################################################################### +# # +# Copyright (C) 2010 Renato Lima - Akretion # +# # +#This program is free software: you can redistribute it and/or modify # +#it under the terms of the GNU Affero General Public License as published by # +#the Free Software Foundation, either version 3 of the License, or # +#(at your option) any later version. # +# # +#This program is distributed in the hope that it will be useful, # +#but WITHOUT ANY WARRANTY; without even the implied warranty of # +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +#GNU Affero General Public License for more details. # +# # +#You should have received a copy of the GNU Affero General Public License # +#along with this program. If not, see . # +############################################################################### import time import netsvc @@ -26,26 +26,38 @@ from tools.translate import _ class account_invoice(osv.osv): - _inherit = 'account.invoice' - _columns = { - 'carrier_id':fields.many2one("delivery.carrier","Carrier", readonly=True, states={'draft':[('readonly',False)]}), - 'vehicle_id': fields.many2one('l10n_br_delivery.carrier.vehicle', 'Veículo', readonly=True, - states={'draft': [('readonly', False)]}), - 'incoterm': fields.many2one('stock.incoterms', 'Tipo do Frete', readonly=True, states={'draft': [('readonly', False)]}, - help="Incoterm which stands for 'International Commercial terms' implies its a series of sales terms which are used in the commercial transaction."), - 'weight': fields.float('Gross weight', help="The gross weight in Kg.", readonly=True, - states={'draft':[('readonly',False)]}), - 'weight_net': fields.float('Net weight', help="The net weight in Kg.", readonly=True, - states={'draft':[('readonly',False)]}), - 'number_of_packages': fields.integer('Volume', readonly=True, states={'draft':[('readonly',False)]}), - 'amount_insurance': fields.float('Valor do Seguro', digits_compute=dp.get_precision('Account'), readonly=True, - states={'draft':[('readonly',False)]}), - 'amount_costs': fields.float('Outros Custos', digits_compute=dp.get_precision('Account'), readonly=True, - states={'draft':[('readonly',False)]}), - 'amount_freight': fields.float('Frete', digits_compute=dp.get_precision('Account'), readonly=True, - states={'draft':[('readonly',False)]}), + 'carrier_id':fields.many2one("delivery.carrier", "Carrier", + readonly=True, + states={'draft':[('readonly',False)]}), + 'vehicle_id': fields.many2one('l10n_br_delivery.carrier.vehicle', + 'Veículo', readonly=True, + states={'draft': [('readonly', False)]}), + 'incoterm': fields.many2one('stock.incoterms', 'Tipo do Frete', + readonly=True, + states={'draft': [('readonly', False)]}, + help="Incoterm which stands for \ + 'International Commercial terms' implies \ + its a series of sales terms which are \ + used in the commercial transaction."), + 'weight': fields.float('Gross weight',readonly=True, + states={'draft':[('readonly',False)]}, + help="The gross weight in Kg.",), + 'weight_net': fields.float('Net weight', help="The net weight in Kg.", + readonly=True, + states={'draft':[('readonly',False)]}), + 'number_of_packages': fields.integer( + 'Volume', readonly=True, states={'draft':[('readonly',False)]}), + 'amount_insurance': fields.float( + 'Valor do Seguro', digits_compute=dp.get_precision('Account'), + readonly=True, states={'draft':[('readonly',False)]}), + 'amount_costs': fields.float( + 'Outros Custos', digits_compute=dp.get_precision('Account'), + readonly=True, states={'draft':[('readonly',False)]}), + 'amount_freight': fields.float( + 'Frete', digits_compute=dp.get_precision('Account'), + readonly=True, states={'draft':[('readonly',False)]}), } def nfe_check(self, cr, uid, ids, context=None): @@ -73,10 +85,10 @@ def nfe_check(self, cr, uid, ids, context=None): if not inv.vehicle_id.rntc_code: strErro = 'Transportadora / Veículo - RNTC\n' if strErro: - raise osv.except_osv(_('Error !'),_("Validação da Nota fiscal:\n '%s'") % (strErro.encode('utf-8'))) + raise osv.except_osv( + _('Error !'), + _("Validação da Nota fiscal:\n '%s'") % (strErro.encode('utf-8'))) return res account_invoice() - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/l10n_br_delivery/delivery.py b/l10n_br_delivery/delivery.py index 84724f332d4d..c1aebe5e5fee 100644 --- a/l10n_br_delivery/delivery.py +++ b/l10n_br_delivery/delivery.py @@ -1,32 +1,32 @@ # -*- encoding: utf-8 -*- -################################################################################# -# # -# Copyright (C) 2010 Renato Lima - Akretion # -# # -#This program is free software: you can redistribute it and/or modify # -#it under the terms of the GNU Affero General Public License as published by # -#the Free Software Foundation, either version 3 of the License, or # -#(at your option) any later version. # -# # -#This program is distributed in the hope that it will be useful, # -#but WITHOUT ANY WARRANTY; without even the implied warranty of # -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -#GNU Affero General Public License for more details. # -# # -#You should have received a copy of the GNU Affero General Public License # -#along with this program. If not, see . # -################################################################################# +############################################################################### +# # +# Copyright (C) 2010 Renato Lima - Akretion # +# # +#This program is free software: you can redistribute it and/or modify # +#it under the terms of the GNU Affero General Public License as published by # +#the Free Software Foundation, either version 3 of the License, or # +#(at your option) any later version. # +# # +#This program is distributed in the hope that it will be useful, # +#but WITHOUT ANY WARRANTY; without even the implied warranty of # +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +#GNU Affero General Public License for more details. # +# # +#You should have received a copy of the GNU Affero General Public License # +#along with this program. If not, see . # +############################################################################### from osv import fields,osv -class delivery_carrier(osv.osv): - _inherit = "delivery.carrier" +class delivery_carrier(osv.osv): + _inherit = 'delivery.carrier' _columns = { 'antt_code': fields.char('Codigo ANTT', size=32), - 'vehicle_ids': fields.one2many('l10n_br_delivery.carrier.vehicle', 'carrier_id', 'Vehicles'), + 'vehicle_ids': fields.one2many( + 'l10n_br_delivery.carrier.vehicle', 'carrier_id', + 'Vehicles'), } delivery_carrier() - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/l10n_br_delivery/sale.py b/l10n_br_delivery/sale.py index ebc5bd11a212..548ab73ea705 100644 --- a/l10n_br_delivery/sale.py +++ b/l10n_br_delivery/sale.py @@ -1,21 +1,21 @@ # -*- encoding: utf-8 -*- -################################################################################# -# # -# Copyright (C) 2009 Renato Lima - Akretion # -# # -#This program is free software: you can redistribute it and/or modify # -#it under the terms of the GNU Affero General Public License as published by # -#the Free Software Foundation, either version 3 of the License, or # -#(at your option) any later version. # -# # -#This program is distributed in the hope that it will be useful, # -#but WITHOUT ANY WARRANTY; without even the implied warranty of # -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -#GNU Affero General Public License for more details. # -# # -#You should have received a copy of the GNU Affero General Public License # -#along with this program. If not, see . # -################################################################################# +############################################################################### +# # +# Copyright (C) 2009 Renato Lima - Akretion # +# # +#This program is free software: you can redistribute it and/or modify # +#it under the terms of the GNU Affero General Public License as published by # +#the Free Software Foundation, either version 3 of the License, or # +#(at your option) any later version. # +# # +#This program is distributed in the hope that it will be useful, # +#but WITHOUT ANY WARRANTY; without even the implied warranty of # +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +#GNU Affero General Public License for more details. # +# # +#You should have received a copy of the GNU Affero General Public License # +#along with this program. If not, see . # +############################################################################### import time import netsvc @@ -25,73 +25,82 @@ from tools import config from tools.translate import _ + class sale_order(osv.osv): - _inherit = 'sale.order' - + def action_invoice_create(self, cr, uid, ids, grouped=False, - states=['confirmed', 'done', 'exception'], date_inv = False, context=None): - - result = super(sale_order, self).action_invoice_create(cr, uid, ids, grouped, states, date_inv, context) - - if not result: + states=['confirmed', 'done', 'exception'], + date_inv = False, context=None): + + result = super(sale_order, self).action_invoice_create( + cr, uid, ids, grouped, states, date_inv, context) + + if not result: return result - + for order in self.browse(cr, uid, ids): for invoice in order.invoice_ids: if invoice.state in ('draft') and order.fiscal_operation_id: doc_serie_id = self.pool.get('l10n_br_account.document.serie').search(cr, uid,[('fiscal_document_id','=', order.fiscal_operation_id.fiscal_document_id.id),('active','=',True),('company_id','=',order.company_id.id)]) if not doc_serie_id: - raise osv.except_osv(_('Nenhuma série de documento fiscal !'),_("Não existe nenhuma série de documento fiscal cadastrada para empresa: '%s'") % (order.company_id.name,)) + raise osv.except_osv( + _('Nenhuma série de documento fiscal !'), + _("Não existe nenhuma série de documento fiscal \ + cadastrada para empresa: '%s'") % (order.company_id.name,)) + + self.pool.get('account.invoice').write( + cr, uid, invoice.id, { + 'partner_shipping_id': order.partner_shipping_id.id, + 'fiscal_operation_category_id': order.fiscal_operation_category_id.id, + 'fiscal_operation_id': order.fiscal_operation_id.id, + 'cfop_id': order.fiscal_operation_id.cfop_id.id, + 'fiscal_document_id': order.fiscal_operation_id.fiscal_document_id.id, + 'document_serie_id': doc_serie_id[0], + 'carrier_id': order.carrier_id.id, + 'incoterm': order.incoterm and order.incoterm.id or False}) - self.pool.get('account.invoice').write(cr, uid, invoice.id, { - 'partner_shipping_id': order.partner_shipping_id.id, - 'fiscal_operation_category_id': order.fiscal_operation_category_id.id, - 'fiscal_operation_id': order.fiscal_operation_id.id, - 'cfop_id': order.fiscal_operation_id.cfop_id.id, - 'fiscal_document_id': order.fiscal_operation_id.fiscal_document_id.id, - 'document_serie_id': doc_serie_id[0], - 'carrier_id': order.carrier_id.id, - 'incoterm': order.incoterm and order.incoterm.id or False - }) for inv_line in invoice.invoice_line: self.pool.get('account.invoice.line').write(cr, uid, inv_line.id, {'cfop_id': order.fiscal_operation_id.cfop_id.id}) return result def action_ship_create(self, cr, uid, ids, *args): - result = super(sale_order, self).action_ship_create(cr, uid, ids, *args) - + for order in self.browse(cr, uid, ids, context={}): for picking in order.picking_ids: self.pool.get('stock.picking').write(cr, uid, picking.id, {'incoterm': order.incoterm.id}) - + return result - + sale_order() + class sale_order_line(osv.osv): - _inherit = 'sale.order.line' - + def create_sale_order_line_invoice(self, cr, uid, ids, context=None): - result = super(sale_order_line, self).create_sale_order_line_invoice(cr, uid, ids, context) + result = super(sale_order_line, self).create_sale_order_line_invoice( + cr, uid, ids, context) inv_ids = [] - if result: + if result: for so_line in self.browse(cr, uid, ids): for inv_line in so_line.invoice_lines: if inv_line.invoice_id.state in ('draft'): if inv_line.invoice_id.id not in inv_ids: inv_ids.append(inv_line.id) - self.pool.get('account.invoice').write(cr, uid, inv_line.invoice_id.id, {'fiscal_operation_category_id': so_line.order_id.fiscal_operation_category_id.id, 'fiscal_operation_id': so_line.order_id.fiscal_operation_id.id, 'cfop_id': so_line.order_id.fiscal_operation_id.cfop_id.id, 'fiscal_document_id': so_line.order_id.fiscal_operation_id.fiscal_document_id.id}) - self.pool.get('account.invoice.line').write(cr, uid, inv_line.id, {'cfop_id': so_line.order_id.fiscal_operation_id.cfop_id.id}) - - - + self.pool.get('account.invoice').write( + cr, uid, inv_line.invoice_id.id, + {'fiscal_operation_category_id': so_line.order_id.fiscal_operation_category_id.id, + 'fiscal_operation_id': so_line.order_id.fiscal_operation_id.id, + 'cfop_id': so_line.order_id.fiscal_operation_id.cfop_id.id, + 'fiscal_document_id': so_line.order_id.fiscal_operation_id.fiscal_document_id.id}) + self.pool.get('account.invoice.line').write( + cr, uid, inv_line.id, + {'cfop_id': so_line.order_id.fiscal_operation_id.cfop_id.id}) + return result sale_order_line() - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/l10n_br_delivery/stock.py b/l10n_br_delivery/stock.py index 97b508908c00..3498bae6a349 100644 --- a/l10n_br_delivery/stock.py +++ b/l10n_br_delivery/stock.py @@ -1,53 +1,52 @@ # -*- encoding: utf-8 -*- -################################################################################# -# # -# Copyright (C) 2009 Renato Lima - Akretion # -# # -#This program is free software: you can redistribute it and/or modify # -#it under the terms of the GNU Affero General Public License as published by # -#the Free Software Foundation, either version 3 of the License, or # -#(at your option) any later version. # -# # -#This program is distributed in the hope that it will be useful, # -#but WITHOUT ANY WARRANTY; without even the implied warranty of # -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -#GNU Affero General Public License for more details. # -# # -#You should have received a copy of the GNU Affero General Public License # -#along with this program. If not, see . # -################################################################################# +############################################################################### +# # +# Copyright (C) 2009 Renato Lima - Akretion # +# # +#This program is free software: you can redistribute it and/or modify # +#it under the terms of the GNU Affero General Public License as published by # +#the Free Software Foundation, either version 3 of the License, or # +#(at your option) any later version. # +# # +#This program is distributed in the hope that it will be useful, # +#but WITHOUT ANY WARRANTY; without even the implied warranty of # +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +#GNU Affero General Public License for more details. # +# # +#You should have received a copy of the GNU Affero General Public License # +#along with this program. If not, see . # +############################################################################### from osv import osv, fields class stock_picking(osv.osv): - _inherit = "stock.picking" + _inherit = 'stock.picking' _description = "Picking List" - _columns = { - 'vehicle_id': fields.many2one('l10n_br_delivery.carrier.vehicle', 'Veículo'), - 'incoterm': fields.many2one('stock.incoterms', 'Tipo do Frete', - help="Incoterm which stands for 'International Commercial terms' implies its a series of sales terms which are used in the commercial transaction."), - } + 'vehicle_id': fields.many2one('l10n_br_delivery.carrier.vehicle', + 'Veículo'), + 'incoterm': fields.many2one('stock.incoterms', 'Tipo do Frete', + help="Incoterm which stands for 'International Commercial terms' \ + implies its a series of sales terms which are used in the commercial \ + transaction.")} def _invoice_hook(self, cr, uid, picking, invoice_id): - '''Call after the creation of the invoice''' - self.pool.get('account.invoice').write(cr, uid, invoice_id, { - 'partner_shipping_id': picking.address_id.id, - 'fiscal_operation_category_id': picking.fiscal_operation_category_id and picking.fiscal_operation_category_id.id, - 'fiscal_operation_id': picking.fiscal_operation_id and picking.fiscal_operation_id.id, - 'cfop_id': picking.fiscal_operation_id and picking.fiscal_operation_id.cfop_id.id, - 'fiscal_document_id': picking.fiscal_operation_id and picking.fiscal_operation_id.fiscal_document_id.id, - 'fiscal_position': picking.fiscal_position and picking.fiscal_position.id, - 'carrier_id': picking.carrier_id and picking.carrier_id.id, - 'vehicle_id': picking.vehicle_id and picking.vehicle_id.id, - 'incoterm': picking.incoterm.id, - 'weight': picking.weight, - 'weight_net': picking.weight_net, - 'number_of_packages': picking.number_of_packages - }) + """Call after the creation of the invoice.""" + self.pool.get('account.invoice').write( + cr, uid, invoice_id, { + 'partner_shipping_id': picking.address_id.id, + 'fiscal_operation_category_id': picking.fiscal_operation_category_id and picking.fiscal_operation_category_id.id, + 'fiscal_operation_id': picking.fiscal_operation_id and picking.fiscal_operation_id.id, + 'cfop_id': picking.fiscal_operation_id and picking.fiscal_operation_id.cfop_id.id, + 'fiscal_document_id': picking.fiscal_operation_id and picking.fiscal_operation_id.fiscal_document_id.id, + 'fiscal_position': picking.fiscal_position and picking.fiscal_position.id, + 'carrier_id': picking.carrier_id and picking.carrier_id.id, + 'vehicle_id': picking.vehicle_id and picking.vehicle_id.id, + 'incoterm': picking.incoterm.id, + 'weight': picking.weight, + 'weight_net': picking.weight_net, + 'number_of_packages': picking.number_of_packages}) return super(stock_picking, self)._invoice_hook(cr, uid, picking, invoice_id) stock_picking() - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From c0b38142d049b63531f2ba1179a2caff567ca384 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 8 Nov 2012 11:42:13 -0200 Subject: [PATCH 038/223] =?UTF-8?q?Transferido=20os=20campos=20obrigat?= =?UTF-8?q?=C3=B3rios=20no=20documento=20fiscal=20implementado=20no=20l10n?= =?UTF-8?q?=5Fbr=5Fdelivery=20para=20o=20m=C3=B3dulo=20l10n=5Fbr=5Faccount?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/__init__.py | 1 - l10n_br_delivery/__openerp__.py | 1 - l10n_br_delivery/account_invoice.py | 94 ----------------------- l10n_br_delivery/account_invoice_view.xml | 51 ------------ 4 files changed, 147 deletions(-) delete mode 100644 l10n_br_delivery/account_invoice.py delete mode 100644 l10n_br_delivery/account_invoice_view.xml diff --git a/l10n_br_delivery/__init__.py b/l10n_br_delivery/__init__.py index 41c7601a3f91..e4151844167d 100644 --- a/l10n_br_delivery/__init__.py +++ b/l10n_br_delivery/__init__.py @@ -20,5 +20,4 @@ import sale import l10n_br_delivery import delivery -import account_invoice import stock diff --git a/l10n_br_delivery/__openerp__.py b/l10n_br_delivery/__openerp__.py index f96a615ccece..bd5051c94f24 100644 --- a/l10n_br_delivery/__openerp__.py +++ b/l10n_br_delivery/__openerp__.py @@ -31,7 +31,6 @@ ], 'init_xml': [], 'update_xml' : [ - 'account_invoice_view.xml', 'delivery_view.xml', 'sale_view.xml', 'stock_view.xml', diff --git a/l10n_br_delivery/account_invoice.py b/l10n_br_delivery/account_invoice.py deleted file mode 100644 index b7f637011ca0..000000000000 --- a/l10n_br_delivery/account_invoice.py +++ /dev/null @@ -1,94 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################### -# # -# Copyright (C) 2010 Renato Lima - Akretion # -# # -#This program is free software: you can redistribute it and/or modify # -#it under the terms of the GNU Affero General Public License as published by # -#the Free Software Foundation, either version 3 of the License, or # -#(at your option) any later version. # -# # -#This program is distributed in the hope that it will be useful, # -#but WITHOUT ANY WARRANTY; without even the implied warranty of # -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -#GNU Affero General Public License for more details. # -# # -#You should have received a copy of the GNU Affero General Public License # -#along with this program. If not, see . # -############################################################################### - -import time -import netsvc -from osv import fields, osv -import decimal_precision as dp -import pooler -from tools import config -from tools.translate import _ - -class account_invoice(osv.osv): - _inherit = 'account.invoice' - _columns = { - 'carrier_id':fields.many2one("delivery.carrier", "Carrier", - readonly=True, - states={'draft':[('readonly',False)]}), - 'vehicle_id': fields.many2one('l10n_br_delivery.carrier.vehicle', - 'Veículo', readonly=True, - states={'draft': [('readonly', False)]}), - 'incoterm': fields.many2one('stock.incoterms', 'Tipo do Frete', - readonly=True, - states={'draft': [('readonly', False)]}, - help="Incoterm which stands for \ - 'International Commercial terms' implies \ - its a series of sales terms which are \ - used in the commercial transaction."), - 'weight': fields.float('Gross weight',readonly=True, - states={'draft':[('readonly',False)]}, - help="The gross weight in Kg.",), - 'weight_net': fields.float('Net weight', help="The net weight in Kg.", - readonly=True, - states={'draft':[('readonly',False)]}), - 'number_of_packages': fields.integer( - 'Volume', readonly=True, states={'draft':[('readonly',False)]}), - 'amount_insurance': fields.float( - 'Valor do Seguro', digits_compute=dp.get_precision('Account'), - readonly=True, states={'draft':[('readonly',False)]}), - 'amount_costs': fields.float( - 'Outros Custos', digits_compute=dp.get_precision('Account'), - readonly=True, states={'draft':[('readonly',False)]}), - 'amount_freight': fields.float( - 'Frete', digits_compute=dp.get_precision('Account'), - readonly=True, states={'draft':[('readonly',False)]}), - } - - def nfe_check(self, cr, uid, ids, context=None): - res = super(account_invoice, self).nfe_check(cr, uid, ids) - strErro = '' - for inv in self.browse(cr, uid, ids): - #Carrier - if inv.carrier_id: - - if not inv.carrier_id.partner_id.legal_name: - strErro = 'Transportadora - Razão Social\n' - - if not inv.carrier_id.partner_id.cnpj_cpf: - strErro = 'Transportadora - CNPJ/CPF\n' - - #Carrier Vehicle - if inv.vehicle_id: - - if not inv.vehicle_id.plate: - strErro = 'Transportadora / Veículo - Placa\n' - - if not inv.vehicle_id.plate.state_id.code: - strErro = 'Transportadora / Veículo - UF da Placa\n' - - if not inv.vehicle_id.rntc_code: - strErro = 'Transportadora / Veículo - RNTC\n' - if strErro: - raise osv.except_osv( - _('Error !'), - _("Validação da Nota fiscal:\n '%s'") % (strErro.encode('utf-8'))) - - return res - -account_invoice() diff --git a/l10n_br_delivery/account_invoice_view.xml b/l10n_br_delivery/account_invoice_view.xml deleted file mode 100644 index 6bcf046bcb95..000000000000 --- a/l10n_br_delivery/account_invoice_view.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - l10n_br_delivery.invoice.form - account.invoice - - - - - - - - - - - - - - - - - - - - - - - l10n_br_delivery.invoice.form1 - account.invoice - - - - - - - - - - - - - - - - - - - - From cd04b0466e1840c9e1d3b4eea7b0e5c7f806c44a Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 8 Nov 2012 12:33:47 -0200 Subject: [PATCH 039/223] =?UTF-8?q?Transferido=20os=20campos=20obrigat?= =?UTF-8?q?=C3=B3rios=20no=20documento=20fiscal=20implementado=20no=20l10n?= =?UTF-8?q?=5Fbr=5Fdelivery=20para=20o=20m=C3=B3dulo=20l10n=5Fbr=5Faccount?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/__init__.py | 1 + l10n_br_delivery/__openerp__.py | 1 + l10n_br_delivery/account_invoice.py | 77 +++++++++++++++++++++++ l10n_br_delivery/account_invoice_view.xml | 34 ++++++++++ 4 files changed, 113 insertions(+) create mode 100644 l10n_br_delivery/account_invoice.py create mode 100644 l10n_br_delivery/account_invoice_view.xml diff --git a/l10n_br_delivery/__init__.py b/l10n_br_delivery/__init__.py index e4151844167d..41c7601a3f91 100644 --- a/l10n_br_delivery/__init__.py +++ b/l10n_br_delivery/__init__.py @@ -20,4 +20,5 @@ import sale import l10n_br_delivery import delivery +import account_invoice import stock diff --git a/l10n_br_delivery/__openerp__.py b/l10n_br_delivery/__openerp__.py index bd5051c94f24..55a188ad99bf 100644 --- a/l10n_br_delivery/__openerp__.py +++ b/l10n_br_delivery/__openerp__.py @@ -31,6 +31,7 @@ ], 'init_xml': [], 'update_xml' : [ + 'account_invoice_view.xml', 'delivery_view.xml', 'sale_view.xml', 'stock_view.xml', diff --git a/l10n_br_delivery/account_invoice.py b/l10n_br_delivery/account_invoice.py new file mode 100644 index 000000000000..dae8b1e7b748 --- /dev/null +++ b/l10n_br_delivery/account_invoice.py @@ -0,0 +1,77 @@ +# -*- encoding: utf-8 -*- +############################################################################### +# # +# Copyright (C) 2010 Renato Lima - Akretion # +# # +#This program is free software: you can redistribute it and/or modify # +#it under the terms of the GNU Affero General Public License as published by # +#the Free Software Foundation, either version 3 of the License, or # +#(at your option) any later version. # +# # +#This program is distributed in the hope that it will be useful, # +#but WITHOUT ANY WARRANTY; without even the implied warranty of # +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +#GNU Affero General Public License for more details. # +# # +#You should have received a copy of the GNU Affero General Public License # +#along with this program. If not, see . # +############################################################################### + +import time +import netsvc +from osv import fields, osv +import decimal_precision as dp +import pooler +from tools import config +from tools.translate import _ + + +class account_invoice(osv.osv): + _inherit = 'account.invoice' + _columns = { + 'carrier_id':fields.many2one("delivery.carrier", "Carrier", + readonly=True, + states={'draft':[('readonly',False)]}), + 'vehicle_id': fields.many2one('l10n_br_delivery.carrier.vehicle', + 'Veículo', readonly=True, + states={'draft': [('readonly', False)]}), + 'incoterm': fields.many2one('stock.incoterms', 'Tipo do Frete', + readonly=True, + states={'draft': [('readonly', False)]}, + help="Incoterm which stands for \ + 'International Commercial terms' implies \ + its a series of sales terms which are \ + used in the commercial transaction."),} + + def nfe_check(self, cr, uid, ids, context=None): + res = super(account_invoice, self).nfe_check(cr, uid, ids) + strErro = '' + for inv in self.browse(cr, uid, ids): + #Carrier + if inv.carrier_id: + + if not inv.carrier_id.partner_id.legal_name: + strErro = 'Transportadora - Razão Social\n' + + if not inv.carrier_id.partner_id.cnpj_cpf: + strErro = 'Transportadora - CNPJ/CPF\n' + + #Carrier Vehicle + if inv.vehicle_id: + + if not inv.vehicle_id.plate: + strErro = 'Transportadora / Veículo - Placa\n' + + if not inv.vehicle_id.plate.state_id.code: + strErro = 'Transportadora / Veículo - UF da Placa\n' + + if not inv.vehicle_id.rntc_code: + strErro = 'Transportadora / Veículo - RNTC\n' + if strErro: + raise osv.except_osv( + _('Error !'), + _("Validação da Nota fiscal:\n '%s'") % (strErro.encode('utf-8'))) + + return res + +account_invoice() diff --git a/l10n_br_delivery/account_invoice_view.xml b/l10n_br_delivery/account_invoice_view.xml new file mode 100644 index 000000000000..175408bdad63 --- /dev/null +++ b/l10n_br_delivery/account_invoice_view.xml @@ -0,0 +1,34 @@ + + + + + + l10n_br_delivery.invoice.form + account.invoice + + + + + + + + + + + + + l10n_br_delivery.invoice.form1 + account.invoice + + + + + + + + + + + + + \ No newline at end of file From d84e060f8c283b463a14bbc99aae959d94f3cd3f Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Tue, 11 Dec 2012 22:54:20 -0200 Subject: [PATCH 040/223] =?UTF-8?q?[FIX]=20l10n=5Fbr=5Fdelivery,=20l10n=5F?= =?UTF-8?q?br=5Faccount:=20adicionado=20filtro=20nas=20regras=20de=20posi?= =?UTF-8?q?=C3=A7=C3=B5es=20fiscais,=20[FIX]=20l10n=5Fbr=5Fpurchase?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/stock.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/l10n_br_delivery/stock.py b/l10n_br_delivery/stock.py index 3498bae6a349..7c29c262201a 100644 --- a/l10n_br_delivery/stock.py +++ b/l10n_br_delivery/stock.py @@ -35,11 +35,10 @@ def _invoice_hook(self, cr, uid, picking, invoice_id): self.pool.get('account.invoice').write( cr, uid, invoice_id, { 'partner_shipping_id': picking.address_id.id, - 'fiscal_operation_category_id': picking.fiscal_operation_category_id and picking.fiscal_operation_category_id.id, - 'fiscal_operation_id': picking.fiscal_operation_id and picking.fiscal_operation_id.id, - 'cfop_id': picking.fiscal_operation_id and picking.fiscal_operation_id.cfop_id.id, - 'fiscal_document_id': picking.fiscal_operation_id and picking.fiscal_operation_id.fiscal_document_id.id, - 'fiscal_position': picking.fiscal_position and picking.fiscal_position.id, + #'fiscal_category_id': picking.fiscal_category_id and picking.fiscal_category_id.id, + #'cfop_id': picking.fiscal_operation_id and picking.fiscal_operation_id.cfop_id.id, + #'fiscal_document_id': picking.fiscal_operation_id and picking.fiscal_operation_id.fiscal_document_id.id, + #'fiscal_position': picking.fiscal_position and picking.fiscal_position.id, 'carrier_id': picking.carrier_id and picking.carrier_id.id, 'vehicle_id': picking.vehicle_id and picking.vehicle_id.id, 'incoterm': picking.incoterm.id, From 724fad200a7dfc0f2ed77e27d6d9d93ce2c060f8 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Fri, 14 Dec 2012 09:57:54 -0200 Subject: [PATCH 041/223] =?UTF-8?q?[FIX]=20Alterado=20m=C3=A9todos=20de=20?= =?UTF-8?q?cria=C3=A7=C3=A3o=20de=20nota=20fiscal=20no=20m=C3=B3dulo=20l10?= =?UTF-8?q?n=5Fbr=5Fdelivery?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/sale.py | 43 --------------------------------------- l10n_br_delivery/stock.py | 8 +++----- 2 files changed, 3 insertions(+), 48 deletions(-) diff --git a/l10n_br_delivery/sale.py b/l10n_br_delivery/sale.py index 548ab73ea705..d3abb9456cba 100644 --- a/l10n_br_delivery/sale.py +++ b/l10n_br_delivery/sale.py @@ -42,26 +42,11 @@ def action_invoice_create(self, cr, uid, ids, grouped=False, for order in self.browse(cr, uid, ids): for invoice in order.invoice_ids: if invoice.state in ('draft') and order.fiscal_operation_id: - doc_serie_id = self.pool.get('l10n_br_account.document.serie').search(cr, uid,[('fiscal_document_id','=', order.fiscal_operation_id.fiscal_document_id.id),('active','=',True),('company_id','=',order.company_id.id)]) - if not doc_serie_id: - raise osv.except_osv( - _('Nenhuma série de documento fiscal !'), - _("Não existe nenhuma série de documento fiscal \ - cadastrada para empresa: '%s'") % (order.company_id.name,)) - self.pool.get('account.invoice').write( cr, uid, invoice.id, { 'partner_shipping_id': order.partner_shipping_id.id, - 'fiscal_operation_category_id': order.fiscal_operation_category_id.id, - 'fiscal_operation_id': order.fiscal_operation_id.id, - 'cfop_id': order.fiscal_operation_id.cfop_id.id, - 'fiscal_document_id': order.fiscal_operation_id.fiscal_document_id.id, - 'document_serie_id': doc_serie_id[0], 'carrier_id': order.carrier_id.id, 'incoterm': order.incoterm and order.incoterm.id or False}) - - for inv_line in invoice.invoice_line: - self.pool.get('account.invoice.line').write(cr, uid, inv_line.id, {'cfop_id': order.fiscal_operation_id.cfop_id.id}) return result @@ -76,31 +61,3 @@ def action_ship_create(self, cr, uid, ids, *args): sale_order() - -class sale_order_line(osv.osv): - _inherit = 'sale.order.line' - - def create_sale_order_line_invoice(self, cr, uid, ids, context=None): - result = super(sale_order_line, self).create_sale_order_line_invoice( - cr, uid, ids, context) - inv_ids = [] - - if result: - for so_line in self.browse(cr, uid, ids): - for inv_line in so_line.invoice_lines: - if inv_line.invoice_id.state in ('draft'): - if inv_line.invoice_id.id not in inv_ids: - inv_ids.append(inv_line.id) - self.pool.get('account.invoice').write( - cr, uid, inv_line.invoice_id.id, - {'fiscal_operation_category_id': so_line.order_id.fiscal_operation_category_id.id, - 'fiscal_operation_id': so_line.order_id.fiscal_operation_id.id, - 'cfop_id': so_line.order_id.fiscal_operation_id.cfop_id.id, - 'fiscal_document_id': so_line.order_id.fiscal_operation_id.fiscal_document_id.id}) - self.pool.get('account.invoice.line').write( - cr, uid, inv_line.id, - {'cfop_id': so_line.order_id.fiscal_operation_id.cfop_id.id}) - - return result - -sale_order_line() diff --git a/l10n_br_delivery/stock.py b/l10n_br_delivery/stock.py index 7c29c262201a..55a16c57b966 100644 --- a/l10n_br_delivery/stock.py +++ b/l10n_br_delivery/stock.py @@ -35,10 +35,6 @@ def _invoice_hook(self, cr, uid, picking, invoice_id): self.pool.get('account.invoice').write( cr, uid, invoice_id, { 'partner_shipping_id': picking.address_id.id, - #'fiscal_category_id': picking.fiscal_category_id and picking.fiscal_category_id.id, - #'cfop_id': picking.fiscal_operation_id and picking.fiscal_operation_id.cfop_id.id, - #'fiscal_document_id': picking.fiscal_operation_id and picking.fiscal_operation_id.fiscal_document_id.id, - #'fiscal_position': picking.fiscal_position and picking.fiscal_position.id, 'carrier_id': picking.carrier_id and picking.carrier_id.id, 'vehicle_id': picking.vehicle_id and picking.vehicle_id.id, 'incoterm': picking.incoterm.id, @@ -46,6 +42,8 @@ def _invoice_hook(self, cr, uid, picking, invoice_id): 'weight_net': picking.weight_net, 'number_of_packages': picking.number_of_packages}) - return super(stock_picking, self)._invoice_hook(cr, uid, picking, invoice_id) + return super(stock_picking, self)._invoice_hook( + cr, uid, picking, invoice_id) stock_picking() + From 0a33438505a18aeec59f991e214be07d04444365 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Mon, 17 Dec 2012 22:10:47 -0200 Subject: [PATCH 042/223] [FIX] removed fiscal_operation_id field --- l10n_br_delivery/sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_delivery/sale.py b/l10n_br_delivery/sale.py index d3abb9456cba..4837bdfc2655 100644 --- a/l10n_br_delivery/sale.py +++ b/l10n_br_delivery/sale.py @@ -41,7 +41,7 @@ def action_invoice_create(self, cr, uid, ids, grouped=False, for order in self.browse(cr, uid, ids): for invoice in order.invoice_ids: - if invoice.state in ('draft') and order.fiscal_operation_id: + if invoice.state in ('draft'): self.pool.get('account.invoice').write( cr, uid, invoice.id, { 'partner_shipping_id': order.partner_shipping_id.id, From 93d18edab1ff4d19356cedbd43a89e8e5b2c3d46 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Tue, 29 Jan 2013 01:08:16 -0200 Subject: [PATCH 043/223] =?UTF-8?q?formata=C3=A7=C3=A3o=20do=20c=C3=B3digo?= =?UTF-8?q?=20PEP8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/__openerp__.py | 38 ++++++++++++++--------------- l10n_br_delivery/account_invoice.py | 4 +-- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/l10n_br_delivery/__openerp__.py b/l10n_br_delivery/__openerp__.py index 55a188ad99bf..64473d580001 100644 --- a/l10n_br_delivery/__openerp__.py +++ b/l10n_br_delivery/__openerp__.py @@ -18,27 +18,27 @@ ############################################################################### { - 'name' : 'Delivery for Brazilian Localization', - 'description' : 'Extend delivery module for Brazilian Localization', + 'name': 'Delivery for Brazilian Localization', + 'description': 'Extend delivery module for Brazilian Localization', 'license': 'AGPL-3', - 'author' : 'Akretion, OpenERP Brasil', - 'website' : 'http://openerpbrasil.org', - 'version' : '0.6', - 'depends' : [ - 'l10n_br_stock', - 'l10n_br_sale', - 'delivery', - ], + 'author': 'Akretion, OpenERP Brasil', + 'website': 'http://openerpbrasil.org', + 'version': '0.6', + 'depends': [ + 'l10n_br_stock', + 'l10n_br_sale', + 'delivery', + ], 'init_xml': [], - 'update_xml' : [ - 'account_invoice_view.xml', - 'delivery_view.xml', - 'sale_view.xml', - 'stock_view.xml', - 'l10n_br_delivery_view.xml', - 'security/ir.model.access.csv', - ], - 'category' : 'Localisation', + 'update_xml': [ + 'account_invoice_view.xml', + 'delivery_view.xml', + 'sale_view.xml', + 'stock_view.xml', + 'l10n_br_delivery_view.xml', + 'security/ir.model.access.csv', + ], + 'category': 'Localisation', 'active': False, 'installable': True } diff --git a/l10n_br_delivery/account_invoice.py b/l10n_br_delivery/account_invoice.py index dae8b1e7b748..2f9f06bfc9ac 100644 --- a/l10n_br_delivery/account_invoice.py +++ b/l10n_br_delivery/account_invoice.py @@ -26,7 +26,7 @@ from tools.translate import _ -class account_invoice(osv.osv): +class account_invoice(osv.Model): _inherit = 'account.invoice' _columns = { 'carrier_id':fields.many2one("delivery.carrier", "Carrier", @@ -73,5 +73,3 @@ def nfe_check(self, cr, uid, ids, context=None): _("Validação da Nota fiscal:\n '%s'") % (strErro.encode('utf-8'))) return res - -account_invoice() From cb74cd32bf52166e3acd04ec5e0a5e4a52f269a5 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 6 Feb 2013 17:08:18 -0200 Subject: [PATCH 044/223] =?UTF-8?q?[MIGR]=20migra=C3=A7=C3=A3o=20do=20modu?= =?UTF-8?q?lo=20l10n=5Fbr=5Fdelivery?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/account_invoice.py | 31 +++--- l10n_br_delivery/account_invoice_view.xml | 8 +- l10n_br_delivery/delivery.py | 15 ++- l10n_br_delivery/l10n_br_delivery.py | 104 ++++++++++----------- l10n_br_delivery/l10n_br_delivery_view.xml | 8 +- l10n_br_delivery/sale.py | 62 +++++------- l10n_br_delivery/stock.py | 42 +++++++-- l10n_br_delivery/stock_view.xml | 30 ++---- 8 files changed, 145 insertions(+), 155 deletions(-) diff --git a/l10n_br_delivery/account_invoice.py b/l10n_br_delivery/account_invoice.py index 2f9f06bfc9ac..eaef7222aebd 100644 --- a/l10n_br_delivery/account_invoice.py +++ b/l10n_br_delivery/account_invoice.py @@ -17,31 +17,26 @@ #along with this program. If not, see . # ############################################################################### -import time -import netsvc from osv import fields, osv -import decimal_precision as dp -import pooler -from tools import config from tools.translate import _ class account_invoice(osv.Model): _inherit = 'account.invoice' _columns = { - 'carrier_id':fields.many2one("delivery.carrier", "Carrier", - readonly=True, - states={'draft':[('readonly',False)]}), - 'vehicle_id': fields.many2one('l10n_br_delivery.carrier.vehicle', - 'Veículo', readonly=True, - states={'draft': [('readonly', False)]}), - 'incoterm': fields.many2one('stock.incoterms', 'Tipo do Frete', - readonly=True, - states={'draft': [('readonly', False)]}, - help="Incoterm which stands for \ - 'International Commercial terms' implies \ - its a series of sales terms which are \ - used in the commercial transaction."),} + 'carrier_id': fields.many2one( + 'delivery.carrier', 'Transportadora', readonly=True, + states={'draft': [('readonly', False)]}), + 'vehicle_id': fields.many2one( + 'l10n_br_delivery.carrier.vehicle', 'Veículo', readonly=True, + states={'draft': [('readonly', False)]}), + 'incoterm': fields.many2one( + 'stock.incoterms', 'Tipo do Frete', readonly=True, + states={'draft': [('readonly', False)]}, + help="Incoterm which stands for 'International Commercial terms' " + "implies its a series of sales terms which are used in the " + "commercial transaction."), + } def nfe_check(self, cr, uid, ids, context=None): res = super(account_invoice, self).nfe_check(cr, uid, ids) diff --git a/l10n_br_delivery/account_invoice_view.xml b/l10n_br_delivery/account_invoice_view.xml index 175408bdad63..10582881545f 100644 --- a/l10n_br_delivery/account_invoice_view.xml +++ b/l10n_br_delivery/account_invoice_view.xml @@ -5,11 +5,11 @@ l10n_br_delivery.invoice.form account.invoice - + - + @@ -19,7 +19,7 @@ l10n_br_delivery.invoice.form1 account.invoice - + @@ -31,4 +31,4 @@
-
\ No newline at end of file + diff --git a/l10n_br_delivery/delivery.py b/l10n_br_delivery/delivery.py index c1aebe5e5fee..acf052dfa60e 100644 --- a/l10n_br_delivery/delivery.py +++ b/l10n_br_delivery/delivery.py @@ -17,16 +17,13 @@ #along with this program. If not, see . # ############################################################################### -from osv import fields,osv +from osv import fields, osv -class delivery_carrier(osv.osv): +class delivery_carrier(osv.Model): _inherit = 'delivery.carrier' _columns = { - 'antt_code': fields.char('Codigo ANTT', size=32), - 'vehicle_ids': fields.one2many( - 'l10n_br_delivery.carrier.vehicle', 'carrier_id', - 'Vehicles'), - } - -delivery_carrier() + 'antt_code': fields.char('Codigo ANTT', size=32), + 'vehicle_ids': fields.one2many( + 'l10n_br_delivery.carrier.vehicle', 'carrier_id', u'Veículos'), + } diff --git a/l10n_br_delivery/l10n_br_delivery.py b/l10n_br_delivery/l10n_br_delivery.py index b2d33ca02030..8eec0cd885f3 100644 --- a/l10n_br_delivery/l10n_br_delivery.py +++ b/l10n_br_delivery/l10n_br_delivery.py @@ -1,64 +1,68 @@ # -*- encoding: utf-8 -*- -################################################################################# -# # -# Copyright (C) 2010 Renato Lima - Akretion # -# # -#This program is free software: you can redistribute it and/or modify # -#it under the terms of the GNU Affero General Public License as published by # -#the Free Software Foundation, either version 3 of the License, or # -#(at your option) any later version. # -# # -#This program is distributed in the hope that it will be useful, # -#but WITHOUT ANY WARRANTY; without even the implied warranty of # -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -#GNU Affero General Public License for more details. # -# # -#You should have received a copy of the GNU Affero General Public License # -#along with this program. If not, see . # -################################################################################# +############################################################################### +# # +# Copyright (C) 2010 Renato Lima - Akretion # +# # +#This program is free software: you can redistribute it and/or modify # +#it under the terms of the GNU Affero General Public License as published by # +#the Free Software Foundation, either version 3 of the License, or # +#(at your option) any later version. # +# # +#This program is distributed in the hope that it will be useful, # +#but WITHOUT ANY WARRANTY; without even the implied warranty of # +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +#GNU Affero General Public License for more details. # +# # +#You should have received a copy of the GNU Affero General Public License # +#along with this program. If not, see . # +############################################################################### -from osv import fields,osv +from osv import fields, osv -class l10n_br_delivery_carrier_vehicle(osv.osv): - + +class l10n_br_delivery_carrier_vehicle(osv.Model): _name = 'l10n_br_delivery.carrier.vehicle' _description = 'Veiculos das transportadoras' - _columns = { - 'name': fields.char('Nome',required=True, size=32), - 'description': fields.char('Descrição', size=132), - 'plate': fields.char('Placa', size=7), - 'driver': fields.char('Condudor', size=64), - 'rntc_code': fields.char('Codigo ANTT', size=32), - 'country_id': fields.many2one('res.country', 'País'), - 'state_id': fields.many2one('res.country.state', 'Estado', domain="[('country_id','=',country_id)]"), - 'l10n_br_city_id': fields.many2one('l10n_br_base.city', 'Municipio', domain="[('state_id','=',state_id)]"), - 'active': fields.boolean('Ativo'), - 'manufacture_year': fields.char('Ano de Fabricação', size=4), - 'model_year': fields.char('Ano do Modelo', size=4), - 'type': fields.selection([('bau','Caminhão Baú')], 'Ano do Modelo'), - 'carrier_id': fields.many2one('delivery.carrier', 'Carrier', select=True, required=True, ondelete='cascade'), - } + 'name': fields.char('Nome', required=True, size=32), + 'description': fields.char('Descrição', size=132), + 'plate': fields.char('Placa', size=7), + 'driver': fields.char('Condudor', size=64), + 'rntc_code': fields.char('Codigo ANTT', size=32), + 'country_id': fields.many2one('res.country', 'País'), + 'state_id': fields.many2one( + 'res.country.state', 'Estado', + domain="[('country_id', '=', country_id)]"), + 'l10n_br_city_id': fields.many2one('l10n_br_base.city', 'Municipio', + domain="[('state_id','=',state_id)]"), + 'active': fields.boolean('Ativo'), + 'manufacture_year': fields.char('Ano de Fabricação', size=4), + 'model_year': fields.char('Ano do Modelo', size=4), + 'type': fields.selection([('bau', 'Caminhão Baú')], 'Ano do Modelo'), + 'carrier_id': fields.many2one( + 'delivery.carrier', 'Carrier', select=True, + required=True, ondelete='cascade'), + } -l10n_br_delivery_carrier_vehicle() -class l10n_br_delivery_shipment(osv.osv): - +class l10n_br_delivery_shipment(osv.Model): _name = 'l10n_br_delivery.shipment' - _columns = { - 'code': fields.char('Nome', size=32), - 'description': fields.char('Descrição', size=132), - 'carrier_id': fields.many2one('delivery.carrier', 'Carrier', select=True, required=True), - 'vehicle_id': fields.many2one('l10n_br_delivery.carrier.vehicle', 'Vehicle', select=True, required=True), - 'volume': fields.float('Volume'), - 'carrier_tracking_ref': fields.char('Carrier Tracking Ref', size=32), - 'number_of_packages': fields.integer('Number of Packages'), - } + 'code': fields.char('Nome', size=32), + 'description': fields.char('Descrição', size=132), + 'carrier_id': fields.many2one( + 'delivery.carrier', 'Carrier', select=True, required=True), + 'vehicle_id': fields.many2one( + 'l10n_br_delivery.carrier.vehicle', 'Vehicle', select=True, + required=True), + 'volume': fields.float('Volume'), + 'carrier_tracking_ref': fields.char('Carrier Tracking Ref', size=32), + 'number_of_packages': fields.integer('Number of Packages'), + } def _cal_weight(self, cr, uid, ids, name, args, context=None): res = {} - uom_obj = self.pool.get('product.uom') + #uom_obj = self.pool.get('product.uom') for picking in self.browse(cr, uid, ids, context): total_weight = total_weight_net = 0.00 @@ -77,7 +81,3 @@ def _get_picking_line(self, cr, uid, ids, context=None): for line in self.pool.get('stock.move').browse(cr, uid, ids, context=context): result[line.picking_id.id] = True return result.keys() - -l10n_br_delivery_shipment() - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/l10n_br_delivery/l10n_br_delivery_view.xml b/l10n_br_delivery/l10n_br_delivery_view.xml index 02bec0808035..9ef545b65c46 100644 --- a/l10n_br_delivery/l10n_br_delivery_view.xml +++ b/l10n_br_delivery/l10n_br_delivery_view.xml @@ -1,7 +1,7 @@ - + l10n_br_delivery.carrier.vehicle.form @@ -51,7 +51,7 @@ - + - - \ No newline at end of file + + diff --git a/l10n_br_delivery/sale.py b/l10n_br_delivery/sale.py index 4837bdfc2655..dc6c09ba3d9b 100644 --- a/l10n_br_delivery/sale.py +++ b/l10n_br_delivery/sale.py @@ -14,50 +14,38 @@ #GNU Affero General Public License for more details. # # # #You should have received a copy of the GNU Affero General Public License # -#along with this program. If not, see . # +#along with this program. If not, see . # ############################################################################### -import time -import netsvc -import decimal_precision as dp -from osv import fields, osv -import pooler -from tools import config -from tools.translate import _ +from osv import osv -class sale_order(osv.osv): +class sale_order(osv.Model): _inherit = 'sale.order' - def action_invoice_create(self, cr, uid, ids, grouped=False, - states=['confirmed', 'done', 'exception'], - date_inv = False, context=None): - - result = super(sale_order, self).action_invoice_create( - cr, uid, ids, grouped, states, date_inv, context) - - if not result: - return result - - for order in self.browse(cr, uid, ids): - for invoice in order.invoice_ids: - if invoice.state in ('draft'): - self.pool.get('account.invoice').write( - cr, uid, invoice.id, { - 'partner_shipping_id': order.partner_shipping_id.id, - 'carrier_id': order.carrier_id.id, - 'incoterm': order.incoterm and order.incoterm.id or False}) - + def _prepare_invoice(self, cr, uid, order, lines, context=None): + """Prepare the dict of values to create the new invoice for a + sale order. This method may be overridden to implement custom + invoice generation (making sure to call super() to establish + a clean extension chain). + + :param browse_record order: sale.order record to invoice + :param list(int) line: list of invoice line IDs that must be + attached to the invoice + :return: dict of value to create() the invoice + """ + result = super(sale_order, self)._prepare_invoice( + cr, uid, order, lines, context) + + result['carrier_id'] = order.carrier_id.id, + result['incoterm'] = order.incoterm and order.incoterm.id or False return result - - def action_ship_create(self, cr, uid, ids, *args): - result = super(sale_order, self).action_ship_create(cr, uid, ids, *args) - for order in self.browse(cr, uid, ids, context={}): - for picking in order.picking_ids: - self.pool.get('stock.picking').write(cr, uid, picking.id, {'incoterm': order.incoterm.id}) + def _prepare_order_picking(self, cr, uid, order, context=None): + result = super(sale_order, self)._prepare_order_picking(cr, uid, + order, context) + # TODO - Possível bug do modulo delivery do OpenERP + # porque esse campo já deveria ser copiado pelo módulo nativo delivery + result['incoterm'] = order.incoterm and order.incoterm.id or False return result - -sale_order() - diff --git a/l10n_br_delivery/stock.py b/l10n_br_delivery/stock.py index 55a16c57b966..166483e57097 100644 --- a/l10n_br_delivery/stock.py +++ b/l10n_br_delivery/stock.py @@ -19,22 +19,23 @@ from osv import osv, fields -class stock_picking(osv.osv): + +class stock_picking(osv.Model): _inherit = 'stock.picking' - _description = "Picking List" _columns = { - 'vehicle_id': fields.many2one('l10n_br_delivery.carrier.vehicle', - 'Veículo'), - 'incoterm': fields.many2one('stock.incoterms', 'Tipo do Frete', - help="Incoterm which stands for 'International Commercial terms' \ - implies its a series of sales terms which are used in the commercial \ - transaction.")} + 'vehicle_id': fields.many2one( + 'l10n_br_delivery.carrier.vehicle', 'Veículo'), + 'incoterm': fields.many2one( + 'stock.incoterms', 'Tipo do Frete', + help="Incoterm which stands for 'International Commercial terms" + "implies its a series of sales terms which are used in the " + "commercial transaction.")} def _invoice_hook(self, cr, uid, picking, invoice_id): """Call after the creation of the invoice.""" self.pool.get('account.invoice').write( cr, uid, invoice_id, { - 'partner_shipping_id': picking.address_id.id, + 'partner_shipping_id': picking.partner_id.id, 'carrier_id': picking.carrier_id and picking.carrier_id.id, 'vehicle_id': picking.vehicle_id and picking.vehicle_id.id, 'incoterm': picking.incoterm.id, @@ -45,5 +46,26 @@ def _invoice_hook(self, cr, uid, picking, invoice_id): return super(stock_picking, self)._invoice_hook( cr, uid, picking, invoice_id) -stock_picking() +class stock_picking_in(osv.Model): + _inherit = 'stock.picking.in' + _columns = { + 'vehicle_id': fields.many2one( + 'l10n_br_delivery.carrier.vehicle', 'Veículo'), + 'incoterm': fields.many2one( + 'stock.incoterms', 'Tipo do Frete', + help="Incoterm which stands for 'International Commercial terms" + "implies its a series of sales terms which are used in the " + "commercial transaction.")} + + +class stock_picking_out(osv.Model): + _inherit = 'stock.picking.out' + _columns = { + 'vehicle_id': fields.many2one( + 'l10n_br_delivery.carrier.vehicle', 'Veículo'), + 'incoterm': fields.many2one( + 'stock.incoterms', 'Tipo do Frete', + help="Incoterm which stands for 'International Commercial terms" + "implies its a series of sales terms which are used in the " + "commercial transaction.")} diff --git a/l10n_br_delivery/stock_view.xml b/l10n_br_delivery/stock_view.xml index aef801a7cac8..3bfc3d5eaaeb 100644 --- a/l10n_br_delivery/stock_view.xml +++ b/l10n_br_delivery/stock_view.xml @@ -2,31 +2,19 @@ - + l10n_br_delivery.stock.picking.out.form - stock.picking + stock.picking.out 32 - - - - - - - - - - l10n_br_delivery.stock.picking.out.form1 - stock.picking - - 32 - - + + - + + - - - + + + From ba0b481727eb3468bf5a928cf519b931a908e3b2 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Mon, 11 Feb 2013 13:51:01 -0200 Subject: [PATCH 045/223] =?UTF-8?q?[MIGR]=20trocadas=20chaves=20update=5Fx?= =?UTF-8?q?ml,=20init=5Fxml=20por=20data=20e=20demo=5Fxml=20por=20demo=20n?= =?UTF-8?q?os=20arquivos=20=5F=5Fopenerp=5F=5F.py=20de=20todos=20modulos?= =?UTF-8?q?=20da=20localiza=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/__openerp__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/l10n_br_delivery/__openerp__.py b/l10n_br_delivery/__openerp__.py index 64473d580001..1d7338bd34cd 100644 --- a/l10n_br_delivery/__openerp__.py +++ b/l10n_br_delivery/__openerp__.py @@ -29,8 +29,7 @@ 'l10n_br_sale', 'delivery', ], - 'init_xml': [], - 'update_xml': [ + 'data': [ 'account_invoice_view.xml', 'delivery_view.xml', 'sale_view.xml', @@ -38,6 +37,7 @@ 'l10n_br_delivery_view.xml', 'security/ir.model.access.csv', ], + 'demo': [], 'category': 'Localisation', 'active': False, 'installable': True From 5c193037338771e4207355ab3e8cbfe979315392 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Tue, 16 Apr 2013 11:55:11 -0300 Subject: [PATCH 046/223] =?UTF-8?q?[MERGE]=20migra=C3=A7=C3=A3o=20do=20m?= =?UTF-8?q?=C3=B3dulo=20l10n=5Fbr=5Fdata=5Fdelivery=20para=20vers=C3=A3o?= =?UTF-8?q?=207.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/account_invoice.py | 8 ++++---- l10n_br_delivery/delivery.py | 4 ++-- l10n_br_delivery/l10n_br_delivery.py | 9 +++++---- l10n_br_delivery/sale.py | 16 ++++++++++------ l10n_br_delivery/security/ir.model.accesss.csv | Bin 1536 -> 0 bytes l10n_br_delivery/stock.py | 8 ++++---- 6 files changed, 25 insertions(+), 20 deletions(-) delete mode 100644 l10n_br_delivery/security/ir.model.accesss.csv diff --git a/l10n_br_delivery/account_invoice.py b/l10n_br_delivery/account_invoice.py index eaef7222aebd..8855037e287d 100644 --- a/l10n_br_delivery/account_invoice.py +++ b/l10n_br_delivery/account_invoice.py @@ -17,11 +17,11 @@ #along with this program. If not, see . # ############################################################################### -from osv import fields, osv -from tools.translate import _ +from openerp.osv import orm, fields +from openerp.tools.translate import _ -class account_invoice(osv.Model): +class account_invoice(orm.Model): _inherit = 'account.invoice' _columns = { 'carrier_id': fields.many2one( @@ -63,7 +63,7 @@ def nfe_check(self, cr, uid, ids, context=None): if not inv.vehicle_id.rntc_code: strErro = 'Transportadora / Veículo - RNTC\n' if strErro: - raise osv.except_osv( + raise orm.except_orm( _('Error !'), _("Validação da Nota fiscal:\n '%s'") % (strErro.encode('utf-8'))) diff --git a/l10n_br_delivery/delivery.py b/l10n_br_delivery/delivery.py index acf052dfa60e..83850c3af6a3 100644 --- a/l10n_br_delivery/delivery.py +++ b/l10n_br_delivery/delivery.py @@ -17,10 +17,10 @@ #along with this program. If not, see . # ############################################################################### -from osv import fields, osv +from openerp.osv import orm, fields -class delivery_carrier(osv.Model): +class delivery_carrier(orm.Model): _inherit = 'delivery.carrier' _columns = { 'antt_code': fields.char('Codigo ANTT', size=32), diff --git a/l10n_br_delivery/l10n_br_delivery.py b/l10n_br_delivery/l10n_br_delivery.py index 8eec0cd885f3..636d95174f71 100644 --- a/l10n_br_delivery/l10n_br_delivery.py +++ b/l10n_br_delivery/l10n_br_delivery.py @@ -17,10 +17,10 @@ #along with this program. If not, see . # ############################################################################### -from osv import fields, osv +from openerp.osv import orm, fields -class l10n_br_delivery_carrier_vehicle(osv.Model): +class l10n_br_delivery_carrier_vehicle(orm.Model): _name = 'l10n_br_delivery.carrier.vehicle' _description = 'Veiculos das transportadoras' _columns = { @@ -45,7 +45,7 @@ class l10n_br_delivery_carrier_vehicle(osv.Model): } -class l10n_br_delivery_shipment(osv.Model): +class l10n_br_delivery_shipment(orm.Model): _name = 'l10n_br_delivery.shipment' _columns = { 'code': fields.char('Nome', size=32), @@ -78,6 +78,7 @@ def _cal_weight(self, cr, uid, ids, name, args, context=None): def _get_picking_line(self, cr, uid, ids, context=None): result = {} - for line in self.pool.get('stock.move').browse(cr, uid, ids, context=context): + for line in self.pool.get('stock.move').browse( + cr, uid, ids, context=context): result[line.picking_id.id] = True return result.keys() diff --git a/l10n_br_delivery/sale.py b/l10n_br_delivery/sale.py index dc6c09ba3d9b..a06c3196b1ad 100644 --- a/l10n_br_delivery/sale.py +++ b/l10n_br_delivery/sale.py @@ -17,10 +17,10 @@ #along with this program. If not, see . # ############################################################################### -from osv import osv +from openerp.osv import orm -class sale_order(osv.Model): +class sale_order(orm.Model): _inherit = 'sale.order' def _prepare_invoice(self, cr, uid, order, lines, context=None): @@ -37,15 +37,19 @@ def _prepare_invoice(self, cr, uid, order, lines, context=None): result = super(sale_order, self)._prepare_invoice( cr, uid, order, lines, context) - result['carrier_id'] = order.carrier_id.id, - result['incoterm'] = order.incoterm and order.incoterm.id or False + if order.carrier_id: + result['carrier_id'] = order.carrier_id.id + + if order.incoterm: + result['incoterm'] = order.incoterm.id return result def _prepare_order_picking(self, cr, uid, order, context=None): result = super(sale_order, self)._prepare_order_picking(cr, uid, order, context) - # TODO - Possível bug do modulo delivery do OpenERP - # porque esse campo já deveria ser copiado pelo módulo nativo delivery + # FIXME - Confirmado bug do OpenERP + # https://bugs.launchpad.net/bugs/1161138 + # Esse campo já deveria ser copiado pelo módulo nativo delivery result['incoterm'] = order.incoterm and order.incoterm.id or False return result diff --git a/l10n_br_delivery/security/ir.model.accesss.csv b/l10n_br_delivery/security/ir.model.accesss.csv deleted file mode 100644 index 2f7d76bd3d559ee6baedc4ede64a613733d06aa0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1536 zcmca`Uhu)fjZzO8(10}qGsD0CoD6J8;*3Bx2!nwD15p0|e-Il+gV;c!Q80u;;4jdv zp!gdFBQpeo81jLzgh7G9l_3vE7co?VvN6#>jDZy;&l95&xx64oJs~y7F-J%(NPg6Q JNVyFP3jh_g|5pG2 diff --git a/l10n_br_delivery/stock.py b/l10n_br_delivery/stock.py index 166483e57097..87f1ddddb464 100644 --- a/l10n_br_delivery/stock.py +++ b/l10n_br_delivery/stock.py @@ -17,10 +17,10 @@ #along with this program. If not, see . # ############################################################################### -from osv import osv, fields +from openerp.osv import orm, fields -class stock_picking(osv.Model): +class stock_picking(orm.Model): _inherit = 'stock.picking' _columns = { 'vehicle_id': fields.many2one( @@ -47,7 +47,7 @@ def _invoice_hook(self, cr, uid, picking, invoice_id): cr, uid, picking, invoice_id) -class stock_picking_in(osv.Model): +class stock_picking_in(orm.Model): _inherit = 'stock.picking.in' _columns = { 'vehicle_id': fields.many2one( @@ -59,7 +59,7 @@ class stock_picking_in(osv.Model): "commercial transaction.")} -class stock_picking_out(osv.Model): +class stock_picking_out(orm.Model): _inherit = 'stock.picking.out' _columns = { 'vehicle_id': fields.many2one( From 040eb1426d3ef1cddf0ee0673fed83f9e12cdd48 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Sat, 25 May 2013 16:31:38 -0300 Subject: [PATCH 047/223] =?UTF-8?q?[FIX]=20rotina=20de=20valida=C3=A7?= =?UTF-8?q?=C3=A3o=20da=20NFe=20do=20m=C3=B3dulo=20l10n=5Fbr=5Fdelivery?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/account_invoice.py | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/l10n_br_delivery/account_invoice.py b/l10n_br_delivery/account_invoice.py index 8855037e287d..9371b4ea0476 100644 --- a/l10n_br_delivery/account_invoice.py +++ b/l10n_br_delivery/account_invoice.py @@ -39,32 +39,34 @@ class account_invoice(orm.Model): } def nfe_check(self, cr, uid, ids, context=None): - res = super(account_invoice, self).nfe_check(cr, uid, ids) + result = super(account_invoice, self).nfe_check(cr, uid, ids, context) strErro = '' - for inv in self.browse(cr, uid, ids): - #Carrier + + for inv in self.browse(cr, uid, ids, context=context): + # Carrier if inv.carrier_id: if not inv.carrier_id.partner_id.legal_name: - strErro = 'Transportadora - Razão Social\n' + strErro = u'Transportadora - Razão Social\n' if not inv.carrier_id.partner_id.cnpj_cpf: strErro = 'Transportadora - CNPJ/CPF\n' - #Carrier Vehicle + # Carrier Vehicle if inv.vehicle_id: if not inv.vehicle_id.plate: - strErro = 'Transportadora / Veículo - Placa\n' + strErro = u'Transportadora / Veículo - Placa\n' - if not inv.vehicle_id.plate.state_id.code: - strErro = 'Transportadora / Veículo - UF da Placa\n' + if not inv.vehicle_id.state_id.code: + strErro = u'Transportadora / Veículo - UF da Placa\n' if not inv.vehicle_id.rntc_code: - strErro = 'Transportadora / Veículo - RNTC\n' + strErro = u'Transportadora / Veículo - RNTC\n' + if strErro: raise orm.except_orm( - _('Error !'), - _("Validação da Nota fiscal:\n '%s'") % (strErro.encode('utf-8'))) + _('Error!'), + _(u"Validação da Nota fiscal:\n '%s'") % (strErro)) - return res + return result From 7a4fc9b0343f2101f37c8f4756ce3534bba066d2 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Fri, 30 Aug 2013 20:38:35 -0300 Subject: [PATCH 048/223] =?UTF-8?q?Alterado=20o=20nome=20de=20alguns=20m?= =?UTF-8?q?=C3=B3dulos=20para=20deixar=20mais=20leg=C3=ADvel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_delivery/__openerp__.py b/l10n_br_delivery/__openerp__.py index 1d7338bd34cd..0a67dc2e0ff3 100644 --- a/l10n_br_delivery/__openerp__.py +++ b/l10n_br_delivery/__openerp__.py @@ -18,7 +18,7 @@ ############################################################################### { - 'name': 'Delivery for Brazilian Localization', + 'name': 'Brazilian Localization Delivery', 'description': 'Extend delivery module for Brazilian Localization', 'license': 'AGPL-3', 'author': 'Akretion, OpenERP Brasil', From 44ac7b18f93dbcee4c85bb992c5f7f78f3b354fc Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 12 Dec 2013 14:02:17 -0200 Subject: [PATCH 049/223] =?UTF-8?q?Adicionado=20arquivos=20de=20tradu?= =?UTF-8?q?=C3=A7=C3=A3o=20vazios=20pt=5FBR.po=20para=20evitar=20mensagens?= =?UTF-8?q?=20de=20alertas=20no=20log=20e=20futura=20internacionaliza?= =?UTF-8?q?=C3=A7=C3=A3o=20dos=20termos=20da=20localiza=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/i18n/pt_BR.po | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 l10n_br_delivery/i18n/pt_BR.po diff --git a/l10n_br_delivery/i18n/pt_BR.po b/l10n_br_delivery/i18n/pt_BR.po new file mode 100644 index 000000000000..e69de29bb2d1 From da99ee3732140061b0afe1c878a208b395c11f48 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 12 Dec 2013 14:38:17 -0200 Subject: [PATCH 050/223] =?UTF-8?q?Atualiza=C3=A7=C3=A3o=20das=20vers?= =?UTF-8?q?=C3=B5es=20dos=20m=C3=B3dulos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_delivery/__openerp__.py b/l10n_br_delivery/__openerp__.py index 0a67dc2e0ff3..99335795baef 100644 --- a/l10n_br_delivery/__openerp__.py +++ b/l10n_br_delivery/__openerp__.py @@ -23,7 +23,7 @@ 'license': 'AGPL-3', 'author': 'Akretion, OpenERP Brasil', 'website': 'http://openerpbrasil.org', - 'version': '0.6', + 'version': '7.0', 'depends': [ 'l10n_br_stock', 'l10n_br_sale', From 17f1294d661280ee1da5405d233466eb3245061a Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Fri, 13 Dec 2013 18:07:59 -0200 Subject: [PATCH 051/223] =?UTF-8?q?[REF]=20Refatorado=20aquivos=20no=20m?= =?UTF-8?q?=C3=B3dulo=20l10n=5Fbr=5Fdelivery?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/__openerp__.py | 2 +- l10n_br_delivery/account_invoice.py | 8 ++++---- l10n_br_delivery/delivery.py | 2 +- l10n_br_delivery/l10n_br_delivery.py | 21 +++++++++++---------- l10n_br_delivery/sale.py | 8 ++++---- l10n_br_delivery/stock.py | 14 +++++++------- 6 files changed, 28 insertions(+), 27 deletions(-) diff --git a/l10n_br_delivery/__openerp__.py b/l10n_br_delivery/__openerp__.py index 99335795baef..ad1ce855318a 100644 --- a/l10n_br_delivery/__openerp__.py +++ b/l10n_br_delivery/__openerp__.py @@ -39,6 +39,6 @@ ], 'demo': [], 'category': 'Localisation', - 'active': False, + 'active': True, 'installable': True } diff --git a/l10n_br_delivery/account_invoice.py b/l10n_br_delivery/account_invoice.py index 9371b4ea0476..7aa04fcdbeab 100644 --- a/l10n_br_delivery/account_invoice.py +++ b/l10n_br_delivery/account_invoice.py @@ -21,14 +21,14 @@ from openerp.tools.translate import _ -class account_invoice(orm.Model): +class AccountInvoice(orm.Model): _inherit = 'account.invoice' _columns = { 'carrier_id': fields.many2one( 'delivery.carrier', 'Transportadora', readonly=True, states={'draft': [('readonly', False)]}), 'vehicle_id': fields.many2one( - 'l10n_br_delivery.carrier.vehicle', 'Veículo', readonly=True, + 'l10n_br_delivery.carrier.vehicle', u'Veículo', readonly=True, states={'draft': [('readonly', False)]}), 'incoterm': fields.many2one( 'stock.incoterms', 'Tipo do Frete', readonly=True, @@ -39,8 +39,8 @@ class account_invoice(orm.Model): } def nfe_check(self, cr, uid, ids, context=None): - result = super(account_invoice, self).nfe_check(cr, uid, ids, context) - strErro = '' + result = super(AccountInvoice, self).nfe_check(cr, uid, ids, context) + strErro = u'' for inv in self.browse(cr, uid, ids, context=context): # Carrier diff --git a/l10n_br_delivery/delivery.py b/l10n_br_delivery/delivery.py index 83850c3af6a3..9049e660817d 100644 --- a/l10n_br_delivery/delivery.py +++ b/l10n_br_delivery/delivery.py @@ -20,7 +20,7 @@ from openerp.osv import orm, fields -class delivery_carrier(orm.Model): +class DeliveryCarrier(orm.Model): _inherit = 'delivery.carrier' _columns = { 'antt_code': fields.char('Codigo ANTT', size=32), diff --git a/l10n_br_delivery/l10n_br_delivery.py b/l10n_br_delivery/l10n_br_delivery.py index 636d95174f71..0511ad9bbce4 100644 --- a/l10n_br_delivery/l10n_br_delivery.py +++ b/l10n_br_delivery/l10n_br_delivery.py @@ -20,7 +20,7 @@ from openerp.osv import orm, fields -class l10n_br_delivery_carrier_vehicle(orm.Model): +class L10n_brDeliveryCarrierVehicle(orm.Model): _name = 'l10n_br_delivery.carrier.vehicle' _description = 'Veiculos das transportadoras' _columns = { @@ -45,7 +45,7 @@ class l10n_br_delivery_carrier_vehicle(orm.Model): } -class l10n_br_delivery_shipment(orm.Model): +class L10n_brDeliveryShipment(orm.Model): _name = 'l10n_br_delivery.shipment' _columns = { 'code': fields.char('Nome', size=32), @@ -61,8 +61,8 @@ class l10n_br_delivery_shipment(orm.Model): } def _cal_weight(self, cr, uid, ids, name, args, context=None): - res = {} - #uom_obj = self.pool.get('product.uom') + result = {} + for picking in self.browse(cr, uid, ids, context): total_weight = total_weight_net = 0.00 @@ -70,15 +70,16 @@ def _cal_weight(self, cr, uid, ids, name, args, context=None): total_weight += move.weight total_weight_net += move.weight_net - res[picking.id] = { - 'weight': total_weight, - 'weight_net': total_weight_net, - } - return res + result[picking.id] = { + 'weight': total_weight, + 'weight_net': total_weight_net, + } + + return result def _get_picking_line(self, cr, uid, ids, context=None): result = {} for line in self.pool.get('stock.move').browse( cr, uid, ids, context=context): result[line.picking_id.id] = True - return result.keys() + return list(result.keys()) diff --git a/l10n_br_delivery/sale.py b/l10n_br_delivery/sale.py index a06c3196b1ad..019a61cfd3b6 100644 --- a/l10n_br_delivery/sale.py +++ b/l10n_br_delivery/sale.py @@ -20,7 +20,7 @@ from openerp.osv import orm -class sale_order(orm.Model): +class SaleOrder(orm.Model): _inherit = 'sale.order' def _prepare_invoice(self, cr, uid, order, lines, context=None): @@ -34,7 +34,7 @@ def _prepare_invoice(self, cr, uid, order, lines, context=None): attached to the invoice :return: dict of value to create() the invoice """ - result = super(sale_order, self)._prepare_invoice( + result = super(SaleOrder, self)._prepare_invoice( cr, uid, order, lines, context) if order.carrier_id: @@ -45,8 +45,8 @@ def _prepare_invoice(self, cr, uid, order, lines, context=None): return result def _prepare_order_picking(self, cr, uid, order, context=None): - result = super(sale_order, self)._prepare_order_picking(cr, uid, - order, context) + result = super(SaleOrder, self)._prepare_order_picking( + cr, uid, order, context) # FIXME - Confirmado bug do OpenERP # https://bugs.launchpad.net/bugs/1161138 diff --git a/l10n_br_delivery/stock.py b/l10n_br_delivery/stock.py index 87f1ddddb464..fd4a96d79e52 100644 --- a/l10n_br_delivery/stock.py +++ b/l10n_br_delivery/stock.py @@ -20,11 +20,11 @@ from openerp.osv import orm, fields -class stock_picking(orm.Model): +class StockPicking(orm.Model): _inherit = 'stock.picking' _columns = { 'vehicle_id': fields.many2one( - 'l10n_br_delivery.carrier.vehicle', 'Veículo'), + 'l10n_br_delivery.carrier.vehicle', u'Veículo'), 'incoterm': fields.many2one( 'stock.incoterms', 'Tipo do Frete', help="Incoterm which stands for 'International Commercial terms" @@ -43,15 +43,15 @@ def _invoice_hook(self, cr, uid, picking, invoice_id): 'weight_net': picking.weight_net, 'number_of_packages': picking.number_of_packages}) - return super(stock_picking, self)._invoice_hook( + return super(StockPicking, self)._invoice_hook( cr, uid, picking, invoice_id) -class stock_picking_in(orm.Model): +class StockPickingIn(orm.Model): _inherit = 'stock.picking.in' _columns = { 'vehicle_id': fields.many2one( - 'l10n_br_delivery.carrier.vehicle', 'Veículo'), + 'l10n_br_delivery.carrier.vehicle', u'Veículo'), 'incoterm': fields.many2one( 'stock.incoterms', 'Tipo do Frete', help="Incoterm which stands for 'International Commercial terms" @@ -59,11 +59,11 @@ class stock_picking_in(orm.Model): "commercial transaction.")} -class stock_picking_out(orm.Model): +class StockPickingOut(orm.Model): _inherit = 'stock.picking.out' _columns = { 'vehicle_id': fields.many2one( - 'l10n_br_delivery.carrier.vehicle', 'Veículo'), + 'l10n_br_delivery.carrier.vehicle', u'Veículo'), 'incoterm': fields.many2one( 'stock.incoterms', 'Tipo do Frete', help="Incoterm which stands for 'International Commercial terms" From a467d88fb262b2a3ba51e147aaaeb7f6d29b5ce6 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Fri, 13 Dec 2013 18:09:06 -0200 Subject: [PATCH 052/223] =?UTF-8?q?[REF]=20Refatorado=20aquivos=20de=20vis?= =?UTF-8?q?=C3=B5es=20no=20m=C3=B3dulo=20l10n=5Fbr=5Fdelivery?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/account_invoice_view.xml | 26 +++++++++++----------- l10n_br_delivery/delivery_view.xml | 22 +++++++++--------- l10n_br_delivery/l10n_br_delivery_view.xml | 23 +++++++++---------- l10n_br_delivery/stock_view.xml | 23 +++++++++---------- 4 files changed, 46 insertions(+), 48 deletions(-) diff --git a/l10n_br_delivery/account_invoice_view.xml b/l10n_br_delivery/account_invoice_view.xml index 10582881545f..6077475e56bb 100644 --- a/l10n_br_delivery/account_invoice_view.xml +++ b/l10n_br_delivery/account_invoice_view.xml @@ -1,31 +1,31 @@ - - + + l10n_br_delivery.invoice.form account.invoice - + - - - + + + - - - l10n_br_delivery.invoice.form1 + + + l10n_br_delivery.invoice.supplier.form account.invoice - + - - - + + + diff --git a/l10n_br_delivery/delivery_view.xml b/l10n_br_delivery/delivery_view.xml index 0ae765373dc9..8bbbe6a78c91 100644 --- a/l10n_br_delivery/delivery_view.xml +++ b/l10n_br_delivery/delivery_view.xml @@ -1,20 +1,20 @@ - + - l10n_br_delivery.carrier.form - delivery.carrier - form - - - - - - + l10n_br_delivery.carrier.form + delivery.carrier + form + + + + + + - + diff --git a/l10n_br_delivery/l10n_br_delivery_view.xml b/l10n_br_delivery/l10n_br_delivery_view.xml index 9ef545b65c46..dedf7befc4f9 100644 --- a/l10n_br_delivery/l10n_br_delivery_view.xml +++ b/l10n_br_delivery/l10n_br_delivery_view.xml @@ -2,7 +2,7 @@ - + l10n_br_delivery.carrier.vehicle.form l10n_br_delivery.carrier.vehicle @@ -34,24 +34,23 @@ tree - - - + + + - Veículo - ir.actions.act_window - l10n_br_delivery.carrier.vehicle - tree,form - form - + Veículo + ir.actions.act_window + l10n_br_delivery.carrier.vehicle + tree,form + form + - - + diff --git a/l10n_br_delivery/stock_view.xml b/l10n_br_delivery/stock_view.xml index 3bfc3d5eaaeb..2ccb598eb48d 100644 --- a/l10n_br_delivery/stock_view.xml +++ b/l10n_br_delivery/stock_view.xml @@ -1,20 +1,19 @@ - + l10n_br_delivery.stock.picking.out.form - stock.picking.out - - 32 - - - - - - + stock.picking.out + + 32 + + + + + + - - + From 8e45a53f3035d72c6a0d9c31f529b171cd56995f Mon Sep 17 00:00:00 2001 From: mileo Date: Mon, 20 Jan 2014 10:46:40 -0200 Subject: [PATCH 053/223] =?UTF-8?q?[MIG]=20Migra=C3=A7=C3=A3o=20do=20desco?= =?UTF-8?q?nto=20e=20frete=20na=20branch=20develop,=20arquivos=20do=20l10n?= =?UTF-8?q?=5Fbr=5Fdelivery?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/__init__.py | 1 + l10n_br_delivery/__openerp__.py | 1 + l10n_br_delivery/res_company.py | 29 +++++++ l10n_br_delivery/res_company_view.xml | 20 +++++ l10n_br_delivery/sale.py | 112 +++++++++++++++++++++++++- l10n_br_delivery/sale_view.xml | 17 +++- l10n_br_delivery/stock.py | 45 ++++++++++- 7 files changed, 220 insertions(+), 5 deletions(-) create mode 100644 l10n_br_delivery/res_company.py create mode 100644 l10n_br_delivery/res_company_view.xml diff --git a/l10n_br_delivery/__init__.py b/l10n_br_delivery/__init__.py index 41c7601a3f91..1cc7ad8f1a8b 100644 --- a/l10n_br_delivery/__init__.py +++ b/l10n_br_delivery/__init__.py @@ -17,6 +17,7 @@ #along with this program. If not, see . # ############################################################################### +import res_company import sale import l10n_br_delivery import delivery diff --git a/l10n_br_delivery/__openerp__.py b/l10n_br_delivery/__openerp__.py index ad1ce855318a..e28ba6424f4e 100644 --- a/l10n_br_delivery/__openerp__.py +++ b/l10n_br_delivery/__openerp__.py @@ -30,6 +30,7 @@ 'delivery', ], 'data': [ + 'res_company_view.xml', 'account_invoice_view.xml', 'delivery_view.xml', 'sale_view.xml', diff --git a/l10n_br_delivery/res_company.py b/l10n_br_delivery/res_company.py new file mode 100644 index 000000000000..00d3f174e00b --- /dev/null +++ b/l10n_br_delivery/res_company.py @@ -0,0 +1,29 @@ +# -*- encoding: utf-8 -*- +############################################################################### +# # +# Copyright (C) 2013 Luis Felipe Miléo - luisfelipe@mileo.co # +# # +#This program is free software: you can redistribute it and/or modify # +#it under the terms of the GNU Affero General Public License as published by # +#the Free Software Foundation, either version 3 of the License, or # +#(at your option) any later version. # +# # +#This program is distributed in the hope that it will be useful, # +#but WITHOUT ANY WARRANTY; without even the implied warranty of # +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +#GNU Affero General Public License for more details. # +# # +#You should have received a copy of the GNU Affero General Public License # +#along with this program. If not, see . # +############################################################################### + +from openerp.osv import orm, fields + + +class res_company(orm.Model): + _inherit = 'res.company' + _columns = { + 'account_freight_id': fields.many2one('account.account', 'Freight Sale Tax Account'), + 'account_insurance_id': fields.many2one('account.account', 'Insurance Sale Tax Account'), + 'account_other_costs': fields.many2one('account.account', 'Other Costs Sale Tax Account'), + } \ No newline at end of file diff --git a/l10n_br_delivery/res_company_view.xml b/l10n_br_delivery/res_company_view.xml new file mode 100644 index 000000000000..f51161d71965 --- /dev/null +++ b/l10n_br_delivery/res_company_view.xml @@ -0,0 +1,20 @@ + + + + + + l10n_br_account.company + res.company + + + + + + + + + + + + + \ No newline at end of file diff --git a/l10n_br_delivery/sale.py b/l10n_br_delivery/sale.py index 019a61cfd3b6..e57dcbfc0106 100644 --- a/l10n_br_delivery/sale.py +++ b/l10n_br_delivery/sale.py @@ -17,8 +17,12 @@ #along with this program. If not, see . # ############################################################################### -from openerp.osv import orm +from openerp.osv import orm, osv +import time +from openerp.tools.translate import _ +def calc_price_ratio(price_gross, amount_calc, amount_total): + return price_gross * amount_calc / amount_total class SaleOrder(orm.Model): _inherit = 'sale.order' @@ -44,6 +48,35 @@ def _prepare_invoice(self, cr, uid, order, lines, context=None): result['incoterm'] = order.incoterm.id return result + def action_invoice_create(self, cr, uid, ids, grouped=False, states=None, date_invoice = False, context=None): + invoice_id = super(sale_order, self).action_invoice_create(cr, uid, ids, grouped, states, date_invoice, context) + + user = self.pool.get('res.users').browse(cr, uid, uid, context=context) + company = self.pool.get('res.company').browse( + cr, uid, user.company_id.id, context=context) + + inv = self.pool.get("account.invoice").browse(cr,uid,invoice_id) + vals = [ + ('Frete', company.account_freight_id, inv.amount_freight), + ('Seguro', company.account_insurance_id, inv.amount_insurance), + ('Outros Custos',company.account_other_costs, inv.amount_costs) + ] + + ait_obj = self.pool.get('account.invoice.tax') + for tax in vals: + if tax[2] > 0: + ait_obj.create(cr, uid, + { + 'invoice_id': invoice_id, + 'name': tax[0], + 'account_id': tax[1].id, + 'amount': tax[2], + 'base': tax[2], + 'manual': 1, + 'company_id': company.id, + }, context=context) + return invoice_id + def _prepare_order_picking(self, cr, uid, order, context=None): result = super(SaleOrder, self)._prepare_order_picking( cr, uid, order, context) @@ -53,3 +86,80 @@ def _prepare_order_picking(self, cr, uid, order, context=None): # Esse campo já deveria ser copiado pelo módulo nativo delivery result['incoterm'] = order.incoterm and order.incoterm.id or False return result + def delivery_set(self, cr, uid, ids, context=None): + #Copia do modulo delivery + #Exceto pelo final que adiciona ao campo total do frete. + grid_obj = self.pool.get('delivery.grid') + carrier_obj = self.pool.get('delivery.carrier') + + for order in self.browse(cr, uid, ids, context=context): + grid_id = carrier_obj.grid_get(cr, uid, [order.carrier_id.id], + order.partner_shipping_id.id) + + if not grid_id: + raise osv.except_osv(_('No Grid Available!'), + _('No grid matching for this carrier!')) + + if not order.state in ('draft'): + raise osv.except_osv(_('Order not in Draft State!'), + _('The order state have to be draft to add delivery lines.')) + + grid = grid_obj.browse(cr, uid, grid_id, context=context) + + amount_freight = grid_obj.get_price(cr, uid, grid.id, order, + time.strftime('%Y-%m-%d'), context) + self.onchange_amount_freight(cr, uid, ids, amount_freight) + return self.write(cr, uid, ids, {'amount_freight': amount_freight}) + + def onchange_amount_freight(self, cr, uid, ids, amount_freight=False): + result = {} + if (amount_freight is False) or not ids: + return {'value': {'amount_freight': 0.00}} + + line_obj = self.pool.get('sale.order.line') + for order in self.browse(cr, uid, ids, context=None): + for line in order.order_line: + line_obj.write(cr, uid, [line.id], {'freight_value': + calc_price_ratio(line.price_gross, amount_freight, + order.amount_gross)}, context=None) + return result + + def onchange_amount_insurance(self, cr, uid, ids, amount_insurance=False): + result = {} + if (amount_insurance is False) or not ids: + return {'value': {'amount_insurance': 0.00}} + + line_obj = self.pool.get('sale.order.line') + for order in self.browse(cr, uid, ids, context=None): + for line in order.order_line: + line_obj.write(cr, uid, [line.id], {'insurance_value': + calc_price_ratio(line.price_gross, amount_insurance, + order.amount_gross)}, context=None) + return result + + def onchange_amount_costs(self, cr, uid, ids, amount_costs=False): + result = {} + if (amount_costs is False) or not ids: + return {'value': {'amount_costs': 0.00}} + + line_obj = self.pool.get('sale.order.line') + for order in self.browse(cr, uid, ids, context=None): + for line in order.order_line: + line_obj.write(cr, uid, [line.id], {'other_costs_value': + calc_price_ratio(line.price_gross, amount_costs, + order.amount_gross)}, context=None) + return result + + +class sale_order_line(orm.Model): + _inherit = 'sale.order.line' + + def _prepare_order_line_invoice_line(self, cr, uid, line, + account_id=False, context=None): + result = super(sale_order_line, self)._prepare_order_line_invoice_line( + cr, uid, line, account_id, context) + + result['insurance_value'] = line.insurance_value + result['other_costs_value'] = line.other_costs_value + result['freight_value'] = line.freight_value + return result diff --git a/l10n_br_delivery/sale_view.xml b/l10n_br_delivery/sale_view.xml index e13c0ef47c9f..ea93945b270e 100644 --- a/l10n_br_delivery/sale_view.xml +++ b/l10n_br_delivery/sale_view.xml @@ -1,8 +1,19 @@ - - + + l10n_br_delivery.order.form + sale.order + + 46 + + + + + + + + + - diff --git a/l10n_br_delivery/stock.py b/l10n_br_delivery/stock.py index fd4a96d79e52..9a60b9b9b07d 100644 --- a/l10n_br_delivery/stock.py +++ b/l10n_br_delivery/stock.py @@ -31,8 +31,51 @@ class StockPicking(orm.Model): "implies its a series of sales terms which are used in the " "commercial transaction.")} + def _prepare_shipping_invoice_line(self, cr, uid, picking, invoice, context=None): + #TODO: Calcular o valor correto em caso de alteração da quantidade + return None + + def _prepare_invoice_line(self, cr, uid, group, picking, move_line, + invoice_id, invoice_vals, context=None): + result = super(stock_picking, self)._prepare_invoice_line( + cr, uid, group, picking, move_line, invoice_id, invoice_vals, + context) + #TODO: Calcular o valor correto em caso de alteração da quantidade + result['insurance_value'] = move_line.sale_line_id.insurance_value + result['other_costs_value'] = move_line.sale_line_id.other_costs_value + result['freight_value'] = move_line.sale_line_id.freight_value + return result + + + def _invoice_hook(self, cr, uid, picking, invoice_id): - """Call after the creation of the invoice.""" + """Call after the creation of the invoice.""" context = {} + + user = self.pool.get('res.users').browse(cr, uid, uid, context=context) + company = self.pool.get('res.company').browse( + cr, uid, user.company_id.id, context=context) + inv = self.pool.get("account.invoice").browse(cr,uid,invoice_id) + vals = [ + ('Frete', company.account_freight_id, inv.amount_freight), + ('Seguro', company.account_insurance_id, inv.amount_insurance), + ('Outros Custos',company.account_other_costs, inv.amount_costs) + ] + + ait_obj = self.pool.get('account.invoice.tax') + for tax in vals: + if tax[2] > 0: + ait_obj.create(cr, uid, + { + 'invoice_id': invoice_id, + 'name': tax[0], + 'account_id': tax[1].id, + 'amount': tax[2], + 'base': tax[2], + 'manual': 1, + 'company_id': company.id, + }, context=context) + + self.pool.get('account.invoice').write( cr, uid, invoice_id, { 'partner_shipping_id': picking.partner_id.id, From 74a310f9939476e776846eaf7702d5e004a98c02 Mon Sep 17 00:00:00 2001 From: mileo Date: Mon, 20 Jan 2014 14:27:57 -0200 Subject: [PATCH 054/223] Revert "[MIG] Frete e desconto l10n_br_account" This reverts commit 664cc98e8b65adfb11f5975bad6a67d1f47d806d. --- l10n_br_delivery/sale_view.xml | 5 ++--- l10n_br_delivery/stock.py | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/l10n_br_delivery/sale_view.xml b/l10n_br_delivery/sale_view.xml index ea93945b270e..b467c6e86fad 100644 --- a/l10n_br_delivery/sale_view.xml +++ b/l10n_br_delivery/sale_view.xml @@ -1,7 +1,7 @@ - - + + l10n_br_delivery.order.form sale.order @@ -15,5 +15,4 @@ - diff --git a/l10n_br_delivery/stock.py b/l10n_br_delivery/stock.py index 9a60b9b9b07d..d0a19d617fd2 100644 --- a/l10n_br_delivery/stock.py +++ b/l10n_br_delivery/stock.py @@ -49,7 +49,8 @@ def _prepare_invoice_line(self, cr, uid, group, picking, move_line, def _invoice_hook(self, cr, uid, picking, invoice_id): - """Call after the creation of the invoice.""" context = {} + """Call after the creation of the invoice.""" + context = {} user = self.pool.get('res.users').browse(cr, uid, uid, context=context) company = self.pool.get('res.company').browse( From 260adece55bd5c088af0d3b05e25fc279c4e1b69 Mon Sep 17 00:00:00 2001 From: mileo Date: Mon, 20 Jan 2014 15:25:14 -0200 Subject: [PATCH 055/223] [FIX][REF] PEP8 class name, linha removida incorretamente --- l10n_br_delivery/sale.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/l10n_br_delivery/sale.py b/l10n_br_delivery/sale.py index e57dcbfc0106..333ef92d992e 100644 --- a/l10n_br_delivery/sale.py +++ b/l10n_br_delivery/sale.py @@ -17,8 +17,8 @@ #along with this program. If not, see . # ############################################################################### +import time from openerp.osv import orm, osv -import time from openerp.tools.translate import _ def calc_price_ratio(price_gross, amount_calc, amount_total): @@ -151,12 +151,12 @@ def onchange_amount_costs(self, cr, uid, ids, amount_costs=False): return result -class sale_order_line(orm.Model): +class SaleOrderLine(orm.Model): _inherit = 'sale.order.line' def _prepare_order_line_invoice_line(self, cr, uid, line, account_id=False, context=None): - result = super(sale_order_line, self)._prepare_order_line_invoice_line( + result = super(SaleOrderLine, self)._prepare_order_line_invoice_line( cr, uid, line, account_id, context) result['insurance_value'] = line.insurance_value From dcf2a0f3e506b4ae78050ad4d0b6b1264811e0c7 Mon Sep 17 00:00:00 2001 From: mileo Date: Mon, 20 Jan 2014 15:31:23 -0200 Subject: [PATCH 056/223] [FIX] Class name --- l10n_br_delivery/stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_delivery/stock.py b/l10n_br_delivery/stock.py index d0a19d617fd2..c3077118ee92 100644 --- a/l10n_br_delivery/stock.py +++ b/l10n_br_delivery/stock.py @@ -37,7 +37,7 @@ def _prepare_shipping_invoice_line(self, cr, uid, picking, invoice, context=None def _prepare_invoice_line(self, cr, uid, group, picking, move_line, invoice_id, invoice_vals, context=None): - result = super(stock_picking, self)._prepare_invoice_line( + result = super(StockPicking, self)._prepare_invoice_line( cr, uid, group, picking, move_line, invoice_id, invoice_vals, context) #TODO: Calcular o valor correto em caso de alteração da quantidade From 4d6ce166a3dfd4b90efa50c09bb479ff0b5d7fe8 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Sat, 25 Jan 2014 16:51:52 -0200 Subject: [PATCH 057/223] =?UTF-8?q?[FIX]=20Alguns=20refactoring=20para=20c?= =?UTF-8?q?oncertar=20a=20gera=C3=A7=C3=A3o=20da=20fatura=20quando=20n?= =?UTF-8?q?=C3=A3o=20h=C3=A1=20um=20pedido=20de=20venda=20relacionado=20no?= =?UTF-8?q?=20m=C3=B3dulo=20l10n=5Fbr=5Fdelivery=20e=20refatorado=20alguns?= =?UTF-8?q?=20m=C3=A9todos=20no=20l10n=5Fbr=5Faccount=5Fproduct?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/__openerp__.py | 3 +- l10n_br_delivery/sale.py | 8 +++-- l10n_br_delivery/stock.py | 53 +++++++++++++++++---------------- 3 files changed, 33 insertions(+), 31 deletions(-) diff --git a/l10n_br_delivery/__openerp__.py b/l10n_br_delivery/__openerp__.py index e28ba6424f4e..91c8f20791c6 100644 --- a/l10n_br_delivery/__openerp__.py +++ b/l10n_br_delivery/__openerp__.py @@ -25,8 +25,7 @@ 'website': 'http://openerpbrasil.org', 'version': '7.0', 'depends': [ - 'l10n_br_stock', - 'l10n_br_sale', + 'l10n_br_sale_stock', 'delivery', ], 'data': [ diff --git a/l10n_br_delivery/sale.py b/l10n_br_delivery/sale.py index 333ef92d992e..21e71666657e 100644 --- a/l10n_br_delivery/sale.py +++ b/l10n_br_delivery/sale.py @@ -21,9 +21,11 @@ from openerp.osv import orm, osv from openerp.tools.translate import _ + def calc_price_ratio(price_gross, amount_calc, amount_total): return price_gross * amount_calc / amount_total + class SaleOrder(orm.Model): _inherit = 'sale.order' @@ -50,11 +52,11 @@ def _prepare_invoice(self, cr, uid, order, lines, context=None): def action_invoice_create(self, cr, uid, ids, grouped=False, states=None, date_invoice = False, context=None): invoice_id = super(sale_order, self).action_invoice_create(cr, uid, ids, grouped, states, date_invoice, context) - + user = self.pool.get('res.users').browse(cr, uid, uid, context=context) company = self.pool.get('res.company').browse( cr, uid, user.company_id.id, context=context) - + inv = self.pool.get("account.invoice").browse(cr,uid,invoice_id) vals = [ ('Frete', company.account_freight_id, inv.amount_freight), @@ -115,7 +117,7 @@ def onchange_amount_freight(self, cr, uid, ids, amount_freight=False): result = {} if (amount_freight is False) or not ids: return {'value': {'amount_freight': 0.00}} - + line_obj = self.pool.get('sale.order.line') for order in self.browse(cr, uid, ids, context=None): for line in order.order_line: diff --git a/l10n_br_delivery/stock.py b/l10n_br_delivery/stock.py index c3077118ee92..f40aa94f383c 100644 --- a/l10n_br_delivery/stock.py +++ b/l10n_br_delivery/stock.py @@ -31,9 +31,10 @@ class StockPicking(orm.Model): "implies its a series of sales terms which are used in the " "commercial transaction.")} - def _prepare_shipping_invoice_line(self, cr, uid, picking, invoice, context=None): + def _prepare_shipping_invoice_line(self, cr, uid, picking, + invoice, context=None): #TODO: Calcular o valor correto em caso de alteração da quantidade - return None + return False def _prepare_invoice_line(self, cr, uid, group, picking, move_line, invoice_id, invoice_vals, context=None): @@ -41,42 +42,42 @@ def _prepare_invoice_line(self, cr, uid, group, picking, move_line, cr, uid, group, picking, move_line, invoice_id, invoice_vals, context) #TODO: Calcular o valor correto em caso de alteração da quantidade - result['insurance_value'] = move_line.sale_line_id.insurance_value - result['other_costs_value'] = move_line.sale_line_id.other_costs_value - result['freight_value'] = move_line.sale_line_id.freight_value + if move_line.sale_line_id: + result['insurance_value'] = move_line.sale_line_id.insurance_value + result['other_costs_value'] = move_line.sale_line_id.other_costs_value + result['freight_value'] = move_line.sale_line_id.freight_value return result - - def _invoice_hook(self, cr, uid, picking, invoice_id): - """Call after the creation of the invoice.""" - context = {} + """Call after the creation of the invoice.""" + context = {} user = self.pool.get('res.users').browse(cr, uid, uid, context=context) company = self.pool.get('res.company').browse( cr, uid, user.company_id.id, context=context) - inv = self.pool.get("account.invoice").browse(cr,uid,invoice_id) - vals = [ + inv = self.pool.get("account.invoice").browse( + cr, uid, invoice_id, context=context) + costs = [ ('Frete', company.account_freight_id, inv.amount_freight), ('Seguro', company.account_insurance_id, inv.amount_insurance), - ('Outros Custos',company.account_other_costs, inv.amount_costs) - ] + ('Outros Custos', company.account_other_costs, inv.amount_costs) + ] ait_obj = self.pool.get('account.invoice.tax') - for tax in vals: - if tax[2] > 0: - ait_obj.create(cr, uid, - { - 'invoice_id': invoice_id, - 'name': tax[0], - 'account_id': tax[1].id, - 'amount': tax[2], - 'base': tax[2], - 'manual': 1, - 'company_id': company.id, - }, context=context) + for cost in costs: + if cost[2] > 0: + values = { + 'invoice_id': invoice_id, + 'name': cost[0], + 'account_id': cost[1].id, + 'amount': cost[2], + 'base': cost[2], + 'manual': True, + 'company_id': company.id, + } + + ait_obj.create(cr, uid, values, context=context) - self.pool.get('account.invoice').write( cr, uid, invoice_id, { 'partner_shipping_id': picking.partner_id.id, From 9d255566a3b24c71cd15f359146d2043dec0a251 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Sun, 26 Jan 2014 23:51:35 -0200 Subject: [PATCH 058/223] [FIX] corrigido nome da classe errado --- l10n_br_delivery/sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_delivery/sale.py b/l10n_br_delivery/sale.py index 21e71666657e..30d8a9678f00 100644 --- a/l10n_br_delivery/sale.py +++ b/l10n_br_delivery/sale.py @@ -51,7 +51,7 @@ def _prepare_invoice(self, cr, uid, order, lines, context=None): return result def action_invoice_create(self, cr, uid, ids, grouped=False, states=None, date_invoice = False, context=None): - invoice_id = super(sale_order, self).action_invoice_create(cr, uid, ids, grouped, states, date_invoice, context) + invoice_id = super(SaleOrder, self).action_invoice_create(cr, uid, ids, grouped, states, date_invoice, context) user = self.pool.get('res.users').browse(cr, uid, uid, context=context) company = self.pool.get('res.company').browse( From 02668be06350cff96d4bfdf7526cb1eb0c29576c Mon Sep 17 00:00:00 2001 From: Danimar Ribeiro Date: Tue, 11 Mar 2014 22:38:57 -0300 Subject: [PATCH 059/223] =?UTF-8?q?Corrigido=20erros=20de=20digita=C3=A7?= =?UTF-8?q?=C3=A3o=20e=20adicionado=20tradu=C3=A7=C3=B5es=20aos=20m=C3=B3d?= =?UTF-8?q?ulos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/i18n/pt_BR.po | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/l10n_br_delivery/i18n/pt_BR.po b/l10n_br_delivery/i18n/pt_BR.po index e69de29bb2d1..83844794e99f 100644 --- a/l10n_br_delivery/i18n/pt_BR.po +++ b/l10n_br_delivery/i18n/pt_BR.po @@ -0,0 +1,9 @@ +#. module: base +#: model:ir.module.module,shortdesc:base.module_l10n_br_delivery +msgid "Brazilian Localization Delivery" +msgstr "Localização Brasileira - Módulo de Entrega" + +#. module: base +#: model:ir.module.module,description:base.module_l10n_br_delivery +msgid "Extend delivery module for Brazilian Localization" +msgstr "Localização Brasileira - Implementa funcionalidades do módulo de entrega" From 9bde54872d2e5bf25af76497f05adbb60c85fb66 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Sat, 15 Mar 2014 01:48:18 -0300 Subject: [PATCH 060/223] =?UTF-8?q?Inicio=20da=20extra=C3=A7=C3=A3o=20dos?= =?UTF-8?q?=20campos=20e=20m=C3=A9todos=20do=20m=C3=B3dulo=20l10n=5Fbr=5Fs?= =?UTF-8?q?ale=20para=20o=20novo=20m=C3=B3dulo=20l10n=5Fbr=5Fsale=5Fproduc?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/sale.py | 14 +++++++++----- l10n_br_delivery/sale_view.xml | 32 +++++++++++++++++--------------- 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/l10n_br_delivery/sale.py b/l10n_br_delivery/sale.py index 30d8a9678f00..9845a566ba0d 100644 --- a/l10n_br_delivery/sale.py +++ b/l10n_br_delivery/sale.py @@ -50,19 +50,22 @@ def _prepare_invoice(self, cr, uid, order, lines, context=None): result['incoterm'] = order.incoterm.id return result - def action_invoice_create(self, cr, uid, ids, grouped=False, states=None, date_invoice = False, context=None): - invoice_id = super(SaleOrder, self).action_invoice_create(cr, uid, ids, grouped, states, date_invoice, context) + def action_invoice_create(self, cr, uid, ids, grouped=False, states=None, + date_invoice=False, context=None): + invoice_id = super(SaleOrder, self).action_invoice_create( + cr, uid, ids, grouped, states, date_invoice, context) user = self.pool.get('res.users').browse(cr, uid, uid, context=context) company = self.pool.get('res.company').browse( cr, uid, user.company_id.id, context=context) - inv = self.pool.get("account.invoice").browse(cr,uid,invoice_id) + inv = self.pool.get("account.invoice").browse( + cr, uid, invoice_id, context=context) vals = [ ('Frete', company.account_freight_id, inv.amount_freight), ('Seguro', company.account_insurance_id, inv.amount_insurance), - ('Outros Custos',company.account_other_costs, inv.amount_costs) - ] + ('Outros Custos', company.account_other_costs, inv.amount_costs) + ] ait_obj = self.pool.get('account.invoice.tax') for tax in vals: @@ -88,6 +91,7 @@ def _prepare_order_picking(self, cr, uid, order, context=None): # Esse campo já deveria ser copiado pelo módulo nativo delivery result['incoterm'] = order.incoterm and order.incoterm.id or False return result + def delivery_set(self, cr, uid, ids, context=None): #Copia do modulo delivery #Exceto pelo final que adiciona ao campo total do frete. diff --git a/l10n_br_delivery/sale_view.xml b/l10n_br_delivery/sale_view.xml index b467c6e86fad..1222d7729903 100644 --- a/l10n_br_delivery/sale_view.xml +++ b/l10n_br_delivery/sale_view.xml @@ -1,18 +1,20 @@ - - - l10n_br_delivery.order.form - sale.order - - 46 - - - - - - - - - + + + + l10n_br_delivery.order.form + sale.order + + 46 + + + + + + + + + + From dc0a85e2ecf8c470d008c7c1e700c09c9470d61a Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Sat, 15 Mar 2014 01:53:46 -0300 Subject: [PATCH 061/223] =?UTF-8?q?Inicio=20da=20extra=C3=A7=C3=A3o=20dos?= =?UTF-8?q?=20campos=20e=20m=C3=A9todos=20do=20m=C3=B3dulo=20l10n=5Fbr=5Fd?= =?UTF-8?q?elivery=20para=20o=20novo=20m=C3=B3dulo=20l10n=5Fbr=5Fsale=5Fpr?= =?UTF-8?q?oduct?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/sale.py | 14 -------------- l10n_br_delivery/sale_view.xml | 14 -------------- 2 files changed, 28 deletions(-) diff --git a/l10n_br_delivery/sale.py b/l10n_br_delivery/sale.py index 9845a566ba0d..dcd5eb6d03d8 100644 --- a/l10n_br_delivery/sale.py +++ b/l10n_br_delivery/sale.py @@ -155,17 +155,3 @@ def onchange_amount_costs(self, cr, uid, ids, amount_costs=False): calc_price_ratio(line.price_gross, amount_costs, order.amount_gross)}, context=None) return result - - -class SaleOrderLine(orm.Model): - _inherit = 'sale.order.line' - - def _prepare_order_line_invoice_line(self, cr, uid, line, - account_id=False, context=None): - result = super(SaleOrderLine, self)._prepare_order_line_invoice_line( - cr, uid, line, account_id, context) - - result['insurance_value'] = line.insurance_value - result['other_costs_value'] = line.other_costs_value - result['freight_value'] = line.freight_value - return result diff --git a/l10n_br_delivery/sale_view.xml b/l10n_br_delivery/sale_view.xml index 1222d7729903..1698db6dc8a4 100644 --- a/l10n_br_delivery/sale_view.xml +++ b/l10n_br_delivery/sale_view.xml @@ -2,19 +2,5 @@ - - l10n_br_delivery.order.form - sale.order - - 46 - - - - - - - - - From 62549c52711bb1543c9d05d034a44cef23909f2b Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Sat, 15 Mar 2014 02:03:20 -0300 Subject: [PATCH 062/223] =?UTF-8?q?Extraido=20m=C3=A9todos=20do=20m=C3=B3d?= =?UTF-8?q?ulo=20l10n=5Fbr=5Fdelivery=20para=20o=20novo=20m=C3=B3dulo=20l1?= =?UTF-8?q?0n=5Fbr=5Fsale=5Fproduct?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/sale.py | 77 ---------------------------------- l10n_br_delivery/sale_view.xml | 6 --- 2 files changed, 83 deletions(-) delete mode 100644 l10n_br_delivery/sale_view.xml diff --git a/l10n_br_delivery/sale.py b/l10n_br_delivery/sale.py index dcd5eb6d03d8..f63b673ed370 100644 --- a/l10n_br_delivery/sale.py +++ b/l10n_br_delivery/sale.py @@ -22,10 +22,6 @@ from openerp.tools.translate import _ -def calc_price_ratio(price_gross, amount_calc, amount_total): - return price_gross * amount_calc / amount_total - - class SaleOrder(orm.Model): _inherit = 'sale.order' @@ -46,42 +42,8 @@ def _prepare_invoice(self, cr, uid, order, lines, context=None): if order.carrier_id: result['carrier_id'] = order.carrier_id.id - if order.incoterm: - result['incoterm'] = order.incoterm.id return result - def action_invoice_create(self, cr, uid, ids, grouped=False, states=None, - date_invoice=False, context=None): - invoice_id = super(SaleOrder, self).action_invoice_create( - cr, uid, ids, grouped, states, date_invoice, context) - - user = self.pool.get('res.users').browse(cr, uid, uid, context=context) - company = self.pool.get('res.company').browse( - cr, uid, user.company_id.id, context=context) - - inv = self.pool.get("account.invoice").browse( - cr, uid, invoice_id, context=context) - vals = [ - ('Frete', company.account_freight_id, inv.amount_freight), - ('Seguro', company.account_insurance_id, inv.amount_insurance), - ('Outros Custos', company.account_other_costs, inv.amount_costs) - ] - - ait_obj = self.pool.get('account.invoice.tax') - for tax in vals: - if tax[2] > 0: - ait_obj.create(cr, uid, - { - 'invoice_id': invoice_id, - 'name': tax[0], - 'account_id': tax[1].id, - 'amount': tax[2], - 'base': tax[2], - 'manual': 1, - 'company_id': company.id, - }, context=context) - return invoice_id - def _prepare_order_picking(self, cr, uid, order, context=None): result = super(SaleOrder, self)._prepare_order_picking( cr, uid, order, context) @@ -116,42 +78,3 @@ def delivery_set(self, cr, uid, ids, context=None): time.strftime('%Y-%m-%d'), context) self.onchange_amount_freight(cr, uid, ids, amount_freight) return self.write(cr, uid, ids, {'amount_freight': amount_freight}) - - def onchange_amount_freight(self, cr, uid, ids, amount_freight=False): - result = {} - if (amount_freight is False) or not ids: - return {'value': {'amount_freight': 0.00}} - - line_obj = self.pool.get('sale.order.line') - for order in self.browse(cr, uid, ids, context=None): - for line in order.order_line: - line_obj.write(cr, uid, [line.id], {'freight_value': - calc_price_ratio(line.price_gross, amount_freight, - order.amount_gross)}, context=None) - return result - - def onchange_amount_insurance(self, cr, uid, ids, amount_insurance=False): - result = {} - if (amount_insurance is False) or not ids: - return {'value': {'amount_insurance': 0.00}} - - line_obj = self.pool.get('sale.order.line') - for order in self.browse(cr, uid, ids, context=None): - for line in order.order_line: - line_obj.write(cr, uid, [line.id], {'insurance_value': - calc_price_ratio(line.price_gross, amount_insurance, - order.amount_gross)}, context=None) - return result - - def onchange_amount_costs(self, cr, uid, ids, amount_costs=False): - result = {} - if (amount_costs is False) or not ids: - return {'value': {'amount_costs': 0.00}} - - line_obj = self.pool.get('sale.order.line') - for order in self.browse(cr, uid, ids, context=None): - for line in order.order_line: - line_obj.write(cr, uid, [line.id], {'other_costs_value': - calc_price_ratio(line.price_gross, amount_costs, - order.amount_gross)}, context=None) - return result diff --git a/l10n_br_delivery/sale_view.xml b/l10n_br_delivery/sale_view.xml deleted file mode 100644 index 1698db6dc8a4..000000000000 --- a/l10n_br_delivery/sale_view.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - From 00f210c121247f71d56526b50e9e1cbd1c3b19d7 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Sat, 15 Mar 2014 02:04:40 -0300 Subject: [PATCH 063/223] =?UTF-8?q?Movido=20objetos=20herdados=20da=20empr?= =?UTF-8?q?esa=20do=20m=C3=B3dulo=20l10n=5Fbr=5Fdelivery=20para=20o=20novo?= =?UTF-8?q?=20m=C3=B3dulo=20l10n=5Fbr=5Fsale=5Fproduct?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/res_company.py | 29 --------------------------- l10n_br_delivery/res_company_view.xml | 20 ------------------ 2 files changed, 49 deletions(-) delete mode 100644 l10n_br_delivery/res_company.py delete mode 100644 l10n_br_delivery/res_company_view.xml diff --git a/l10n_br_delivery/res_company.py b/l10n_br_delivery/res_company.py deleted file mode 100644 index 00d3f174e00b..000000000000 --- a/l10n_br_delivery/res_company.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################### -# # -# Copyright (C) 2013 Luis Felipe Miléo - luisfelipe@mileo.co # -# # -#This program is free software: you can redistribute it and/or modify # -#it under the terms of the GNU Affero General Public License as published by # -#the Free Software Foundation, either version 3 of the License, or # -#(at your option) any later version. # -# # -#This program is distributed in the hope that it will be useful, # -#but WITHOUT ANY WARRANTY; without even the implied warranty of # -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -#GNU Affero General Public License for more details. # -# # -#You should have received a copy of the GNU Affero General Public License # -#along with this program. If not, see . # -############################################################################### - -from openerp.osv import orm, fields - - -class res_company(orm.Model): - _inherit = 'res.company' - _columns = { - 'account_freight_id': fields.many2one('account.account', 'Freight Sale Tax Account'), - 'account_insurance_id': fields.many2one('account.account', 'Insurance Sale Tax Account'), - 'account_other_costs': fields.many2one('account.account', 'Other Costs Sale Tax Account'), - } \ No newline at end of file diff --git a/l10n_br_delivery/res_company_view.xml b/l10n_br_delivery/res_company_view.xml deleted file mode 100644 index f51161d71965..000000000000 --- a/l10n_br_delivery/res_company_view.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - l10n_br_account.company - res.company - - - - - - - - - - - - - \ No newline at end of file From e9f504dfa158ab1031b4e13e519e07892bcbdf13 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Sat, 15 Mar 2014 02:11:02 -0300 Subject: [PATCH 064/223] =?UTF-8?q?Conclu=C3=ADdo=20a=20cria=C3=A7=C3=A3o?= =?UTF-8?q?=20do=20m=C3=B3dulo=20l10n=5Fbr=5Fsale=5Fproduct?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/__init__.py | 1 - l10n_br_delivery/__openerp__.py | 2 -- 2 files changed, 3 deletions(-) diff --git a/l10n_br_delivery/__init__.py b/l10n_br_delivery/__init__.py index 1cc7ad8f1a8b..41c7601a3f91 100644 --- a/l10n_br_delivery/__init__.py +++ b/l10n_br_delivery/__init__.py @@ -17,7 +17,6 @@ #along with this program. If not, see . # ############################################################################### -import res_company import sale import l10n_br_delivery import delivery diff --git a/l10n_br_delivery/__openerp__.py b/l10n_br_delivery/__openerp__.py index 91c8f20791c6..33297b2e8994 100644 --- a/l10n_br_delivery/__openerp__.py +++ b/l10n_br_delivery/__openerp__.py @@ -29,10 +29,8 @@ 'delivery', ], 'data': [ - 'res_company_view.xml', 'account_invoice_view.xml', 'delivery_view.xml', - 'sale_view.xml', 'stock_view.xml', 'l10n_br_delivery_view.xml', 'security/ir.model.access.csv', From 4790bfa8b905fd547d9cfb3807c1ef591a5285d6 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 22 Oct 2014 17:37:58 -0200 Subject: [PATCH 065/223] =?UTF-8?q?Adicionados=20arquivos=20README.md=20pa?= =?UTF-8?q?ra=20descri=C3=A7=C3=A3o=20dos=20m=C3=B3dulos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_delivery/README.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 l10n_br_delivery/README.md diff --git a/l10n_br_delivery/README.md b/l10n_br_delivery/README.md new file mode 100644 index 000000000000..3389c68c229f --- /dev/null +++ b/l10n_br_delivery/README.md @@ -0,0 +1,2 @@ +Módulo de Entrega +================= From b828e95f29a99fb04d012d68de950e5ccf303b0f Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 22 Oct 2014 18:38:38 -0200 Subject: [PATCH 066/223] [MIGRATION] initial commit to new branch 8.0 before migration --- l10n_br_delivery/README.md | 2 - l10n_br_delivery/__init__.py | 24 ---- l10n_br_delivery/__openerp__.py | 42 ------- l10n_br_delivery/account_invoice.py | 72 ----------- l10n_br_delivery/account_invoice_view.xml | 34 ----- l10n_br_delivery/delivery.py | 29 ----- l10n_br_delivery/delivery_view.xml | 20 --- l10n_br_delivery/i18n/pt_BR.po | 9 -- l10n_br_delivery/l10n_br_delivery.py | 85 ------------- l10n_br_delivery/l10n_br_delivery_view.xml | 56 --------- l10n_br_delivery/sale.py | 80 ------------ l10n_br_delivery/security/ir.model.access.csv | 12 -- l10n_br_delivery/stock.py | 116 ------------------ l10n_br_delivery/stock_view.xml | 19 --- 14 files changed, 600 deletions(-) delete mode 100644 l10n_br_delivery/README.md delete mode 100644 l10n_br_delivery/__init__.py delete mode 100644 l10n_br_delivery/__openerp__.py delete mode 100644 l10n_br_delivery/account_invoice.py delete mode 100644 l10n_br_delivery/account_invoice_view.xml delete mode 100644 l10n_br_delivery/delivery.py delete mode 100644 l10n_br_delivery/delivery_view.xml delete mode 100644 l10n_br_delivery/i18n/pt_BR.po delete mode 100644 l10n_br_delivery/l10n_br_delivery.py delete mode 100644 l10n_br_delivery/l10n_br_delivery_view.xml delete mode 100644 l10n_br_delivery/sale.py delete mode 100644 l10n_br_delivery/security/ir.model.access.csv delete mode 100644 l10n_br_delivery/stock.py delete mode 100644 l10n_br_delivery/stock_view.xml diff --git a/l10n_br_delivery/README.md b/l10n_br_delivery/README.md deleted file mode 100644 index 3389c68c229f..000000000000 --- a/l10n_br_delivery/README.md +++ /dev/null @@ -1,2 +0,0 @@ -Módulo de Entrega -================= diff --git a/l10n_br_delivery/__init__.py b/l10n_br_delivery/__init__.py deleted file mode 100644 index 41c7601a3f91..000000000000 --- a/l10n_br_delivery/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################### -# # -# Copyright (C) 2009 Renato Lima - Akretion # -# # -#This program is free software: you can redistribute it and/or modify # -#it under the terms of the GNU Affero General Public License as published by # -#the Free Software Foundation, either version 3 of the License, or # -#(at your option) any later version. # -# # -#This program is distributed in the hope that it will be useful, # -#but WITHOUT ANY WARRANTY; without even the implied warranty of # -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -#GNU Affero General Public License for more details. # -# # -#You should have received a copy of the GNU Affero General Public License # -#along with this program. If not, see . # -############################################################################### - -import sale -import l10n_br_delivery -import delivery -import account_invoice -import stock diff --git a/l10n_br_delivery/__openerp__.py b/l10n_br_delivery/__openerp__.py deleted file mode 100644 index 33297b2e8994..000000000000 --- a/l10n_br_delivery/__openerp__.py +++ /dev/null @@ -1,42 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################### -# # -# Copyright (C) 2010 Renato Lima - Akretion # -# # -#This program is free software: you can redistribute it and/or modify # -#it under the terms of the GNU Affero General Public License as published by # -#the Free Software Foundation, either version 3 of the License, or # -#(at your option) any later version. # -# # -#This program is distributed in the hope that it will be useful, # -#but WITHOUT ANY WARRANTY; without even the implied warranty of # -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -#GNU Affero General Public License for more details. # -# # -#You should have received a copy of the GNU Affero General Public License # -#along with this program. If not, see . # -############################################################################### - -{ - 'name': 'Brazilian Localization Delivery', - 'description': 'Extend delivery module for Brazilian Localization', - 'license': 'AGPL-3', - 'author': 'Akretion, OpenERP Brasil', - 'website': 'http://openerpbrasil.org', - 'version': '7.0', - 'depends': [ - 'l10n_br_sale_stock', - 'delivery', - ], - 'data': [ - 'account_invoice_view.xml', - 'delivery_view.xml', - 'stock_view.xml', - 'l10n_br_delivery_view.xml', - 'security/ir.model.access.csv', - ], - 'demo': [], - 'category': 'Localisation', - 'active': True, - 'installable': True -} diff --git a/l10n_br_delivery/account_invoice.py b/l10n_br_delivery/account_invoice.py deleted file mode 100644 index 7aa04fcdbeab..000000000000 --- a/l10n_br_delivery/account_invoice.py +++ /dev/null @@ -1,72 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################### -# # -# Copyright (C) 2010 Renato Lima - Akretion # -# # -#This program is free software: you can redistribute it and/or modify # -#it under the terms of the GNU Affero General Public License as published by # -#the Free Software Foundation, either version 3 of the License, or # -#(at your option) any later version. # -# # -#This program is distributed in the hope that it will be useful, # -#but WITHOUT ANY WARRANTY; without even the implied warranty of # -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -#GNU Affero General Public License for more details. # -# # -#You should have received a copy of the GNU Affero General Public License # -#along with this program. If not, see . # -############################################################################### - -from openerp.osv import orm, fields -from openerp.tools.translate import _ - - -class AccountInvoice(orm.Model): - _inherit = 'account.invoice' - _columns = { - 'carrier_id': fields.many2one( - 'delivery.carrier', 'Transportadora', readonly=True, - states={'draft': [('readonly', False)]}), - 'vehicle_id': fields.many2one( - 'l10n_br_delivery.carrier.vehicle', u'Veículo', readonly=True, - states={'draft': [('readonly', False)]}), - 'incoterm': fields.many2one( - 'stock.incoterms', 'Tipo do Frete', readonly=True, - states={'draft': [('readonly', False)]}, - help="Incoterm which stands for 'International Commercial terms' " - "implies its a series of sales terms which are used in the " - "commercial transaction."), - } - - def nfe_check(self, cr, uid, ids, context=None): - result = super(AccountInvoice, self).nfe_check(cr, uid, ids, context) - strErro = u'' - - for inv in self.browse(cr, uid, ids, context=context): - # Carrier - if inv.carrier_id: - - if not inv.carrier_id.partner_id.legal_name: - strErro = u'Transportadora - Razão Social\n' - - if not inv.carrier_id.partner_id.cnpj_cpf: - strErro = 'Transportadora - CNPJ/CPF\n' - - # Carrier Vehicle - if inv.vehicle_id: - - if not inv.vehicle_id.plate: - strErro = u'Transportadora / Veículo - Placa\n' - - if not inv.vehicle_id.state_id.code: - strErro = u'Transportadora / Veículo - UF da Placa\n' - - if not inv.vehicle_id.rntc_code: - strErro = u'Transportadora / Veículo - RNTC\n' - - if strErro: - raise orm.except_orm( - _('Error!'), - _(u"Validação da Nota fiscal:\n '%s'") % (strErro)) - - return result diff --git a/l10n_br_delivery/account_invoice_view.xml b/l10n_br_delivery/account_invoice_view.xml deleted file mode 100644 index 6077475e56bb..000000000000 --- a/l10n_br_delivery/account_invoice_view.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - l10n_br_delivery.invoice.form - account.invoice - - - - - - - - - - - - - l10n_br_delivery.invoice.supplier.form - account.invoice - - - - - - - - - - - - - diff --git a/l10n_br_delivery/delivery.py b/l10n_br_delivery/delivery.py deleted file mode 100644 index 9049e660817d..000000000000 --- a/l10n_br_delivery/delivery.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################### -# # -# Copyright (C) 2010 Renato Lima - Akretion # -# # -#This program is free software: you can redistribute it and/or modify # -#it under the terms of the GNU Affero General Public License as published by # -#the Free Software Foundation, either version 3 of the License, or # -#(at your option) any later version. # -# # -#This program is distributed in the hope that it will be useful, # -#but WITHOUT ANY WARRANTY; without even the implied warranty of # -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -#GNU Affero General Public License for more details. # -# # -#You should have received a copy of the GNU Affero General Public License # -#along with this program. If not, see . # -############################################################################### - -from openerp.osv import orm, fields - - -class DeliveryCarrier(orm.Model): - _inherit = 'delivery.carrier' - _columns = { - 'antt_code': fields.char('Codigo ANTT', size=32), - 'vehicle_ids': fields.one2many( - 'l10n_br_delivery.carrier.vehicle', 'carrier_id', u'Veículos'), - } diff --git a/l10n_br_delivery/delivery_view.xml b/l10n_br_delivery/delivery_view.xml deleted file mode 100644 index 8bbbe6a78c91..000000000000 --- a/l10n_br_delivery/delivery_view.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - l10n_br_delivery.carrier.form - delivery.carrier - form - - - - - - - - - - - diff --git a/l10n_br_delivery/i18n/pt_BR.po b/l10n_br_delivery/i18n/pt_BR.po deleted file mode 100644 index 83844794e99f..000000000000 --- a/l10n_br_delivery/i18n/pt_BR.po +++ /dev/null @@ -1,9 +0,0 @@ -#. module: base -#: model:ir.module.module,shortdesc:base.module_l10n_br_delivery -msgid "Brazilian Localization Delivery" -msgstr "Localização Brasileira - Módulo de Entrega" - -#. module: base -#: model:ir.module.module,description:base.module_l10n_br_delivery -msgid "Extend delivery module for Brazilian Localization" -msgstr "Localização Brasileira - Implementa funcionalidades do módulo de entrega" diff --git a/l10n_br_delivery/l10n_br_delivery.py b/l10n_br_delivery/l10n_br_delivery.py deleted file mode 100644 index 0511ad9bbce4..000000000000 --- a/l10n_br_delivery/l10n_br_delivery.py +++ /dev/null @@ -1,85 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################### -# # -# Copyright (C) 2010 Renato Lima - Akretion # -# # -#This program is free software: you can redistribute it and/or modify # -#it under the terms of the GNU Affero General Public License as published by # -#the Free Software Foundation, either version 3 of the License, or # -#(at your option) any later version. # -# # -#This program is distributed in the hope that it will be useful, # -#but WITHOUT ANY WARRANTY; without even the implied warranty of # -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -#GNU Affero General Public License for more details. # -# # -#You should have received a copy of the GNU Affero General Public License # -#along with this program. If not, see . # -############################################################################### - -from openerp.osv import orm, fields - - -class L10n_brDeliveryCarrierVehicle(orm.Model): - _name = 'l10n_br_delivery.carrier.vehicle' - _description = 'Veiculos das transportadoras' - _columns = { - 'name': fields.char('Nome', required=True, size=32), - 'description': fields.char('Descrição', size=132), - 'plate': fields.char('Placa', size=7), - 'driver': fields.char('Condudor', size=64), - 'rntc_code': fields.char('Codigo ANTT', size=32), - 'country_id': fields.many2one('res.country', 'País'), - 'state_id': fields.many2one( - 'res.country.state', 'Estado', - domain="[('country_id', '=', country_id)]"), - 'l10n_br_city_id': fields.many2one('l10n_br_base.city', 'Municipio', - domain="[('state_id','=',state_id)]"), - 'active': fields.boolean('Ativo'), - 'manufacture_year': fields.char('Ano de Fabricação', size=4), - 'model_year': fields.char('Ano do Modelo', size=4), - 'type': fields.selection([('bau', 'Caminhão Baú')], 'Ano do Modelo'), - 'carrier_id': fields.many2one( - 'delivery.carrier', 'Carrier', select=True, - required=True, ondelete='cascade'), - } - - -class L10n_brDeliveryShipment(orm.Model): - _name = 'l10n_br_delivery.shipment' - _columns = { - 'code': fields.char('Nome', size=32), - 'description': fields.char('Descrição', size=132), - 'carrier_id': fields.many2one( - 'delivery.carrier', 'Carrier', select=True, required=True), - 'vehicle_id': fields.many2one( - 'l10n_br_delivery.carrier.vehicle', 'Vehicle', select=True, - required=True), - 'volume': fields.float('Volume'), - 'carrier_tracking_ref': fields.char('Carrier Tracking Ref', size=32), - 'number_of_packages': fields.integer('Number of Packages'), - } - - def _cal_weight(self, cr, uid, ids, name, args, context=None): - result = {} - - for picking in self.browse(cr, uid, ids, context): - total_weight = total_weight_net = 0.00 - - for move in picking.move_lines: - total_weight += move.weight - total_weight_net += move.weight_net - - result[picking.id] = { - 'weight': total_weight, - 'weight_net': total_weight_net, - } - - return result - - def _get_picking_line(self, cr, uid, ids, context=None): - result = {} - for line in self.pool.get('stock.move').browse( - cr, uid, ids, context=context): - result[line.picking_id.id] = True - return list(result.keys()) diff --git a/l10n_br_delivery/l10n_br_delivery_view.xml b/l10n_br_delivery/l10n_br_delivery_view.xml deleted file mode 100644 index dedf7befc4f9..000000000000 --- a/l10n_br_delivery/l10n_br_delivery_view.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - l10n_br_delivery.carrier.vehicle.form - l10n_br_delivery.carrier.vehicle - form - -
- - - - - - - - - - - - - - - - - -
- - - l10n_br_delivery.carrier.vehicle.tree - l10n_br_delivery.carrier.vehicle - tree - - - - - - - - - - - Veículo - ir.actions.act_window - l10n_br_delivery.carrier.vehicle - tree,form - form - - - - - -
-
diff --git a/l10n_br_delivery/sale.py b/l10n_br_delivery/sale.py deleted file mode 100644 index f63b673ed370..000000000000 --- a/l10n_br_delivery/sale.py +++ /dev/null @@ -1,80 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################### -# # -# Copyright (C) 2009 Renato Lima - Akretion # -# # -#This program is free software: you can redistribute it and/or modify # -#it under the terms of the GNU Affero General Public License as published by # -#the Free Software Foundation, either version 3 of the License, or # -#(at your option) any later version. # -# # -#This program is distributed in the hope that it will be useful, # -#but WITHOUT ANY WARRANTY; without even the implied warranty of # -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -#GNU Affero General Public License for more details. # -# # -#You should have received a copy of the GNU Affero General Public License # -#along with this program. If not, see . # -############################################################################### - -import time -from openerp.osv import orm, osv -from openerp.tools.translate import _ - - -class SaleOrder(orm.Model): - _inherit = 'sale.order' - - def _prepare_invoice(self, cr, uid, order, lines, context=None): - """Prepare the dict of values to create the new invoice for a - sale order. This method may be overridden to implement custom - invoice generation (making sure to call super() to establish - a clean extension chain). - - :param browse_record order: sale.order record to invoice - :param list(int) line: list of invoice line IDs that must be - attached to the invoice - :return: dict of value to create() the invoice - """ - result = super(SaleOrder, self)._prepare_invoice( - cr, uid, order, lines, context) - - if order.carrier_id: - result['carrier_id'] = order.carrier_id.id - - return result - - def _prepare_order_picking(self, cr, uid, order, context=None): - result = super(SaleOrder, self)._prepare_order_picking( - cr, uid, order, context) - - # FIXME - Confirmado bug do OpenERP - # https://bugs.launchpad.net/bugs/1161138 - # Esse campo já deveria ser copiado pelo módulo nativo delivery - result['incoterm'] = order.incoterm and order.incoterm.id or False - return result - - def delivery_set(self, cr, uid, ids, context=None): - #Copia do modulo delivery - #Exceto pelo final que adiciona ao campo total do frete. - grid_obj = self.pool.get('delivery.grid') - carrier_obj = self.pool.get('delivery.carrier') - - for order in self.browse(cr, uid, ids, context=context): - grid_id = carrier_obj.grid_get(cr, uid, [order.carrier_id.id], - order.partner_shipping_id.id) - - if not grid_id: - raise osv.except_osv(_('No Grid Available!'), - _('No grid matching for this carrier!')) - - if not order.state in ('draft'): - raise osv.except_osv(_('Order not in Draft State!'), - _('The order state have to be draft to add delivery lines.')) - - grid = grid_obj.browse(cr, uid, grid_id, context=context) - - amount_freight = grid_obj.get_price(cr, uid, grid.id, order, - time.strftime('%Y-%m-%d'), context) - self.onchange_amount_freight(cr, uid, ids, amount_freight) - return self.write(cr, uid, ids, {'amount_freight': amount_freight}) diff --git a/l10n_br_delivery/security/ir.model.access.csv b/l10n_br_delivery/security/ir.model.access.csv deleted file mode 100644 index 5ea057c1e8f4..000000000000 --- a/l10n_br_delivery/security/ir.model.access.csv +++ /dev/null @@ -1,12 +0,0 @@ -"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" -"access_l10n_br_delivery_carrier_vehicle_sale","l10n_br_delivery_carrier_vehicle","model_l10n_br_delivery_carrier_vehicle","base.group_sale_salesman",1,0,0,0 -"access_l10n_br_delivery_carrier_vehicle_sale_manager","l10n_br_delivery_carrier_vehicle","model_l10n_br_delivery_carrier_vehicle","base.group_sale_manager",1,0,0,0 -"access_l10n_br_delivery_carrier_vehicle_partner_manager","l10n_br_delivery_carrier_vehicle","model_l10n_br_delivery_carrier_vehicle","base.group_partner_manager",1,0,0,0 -"access_l10n_br_delivery_carrier_vehicle_stock_user","l10n_br_delivery_carrier_vehicle","model_l10n_br_delivery_carrier_vehicle","stock.group_stock_user",1,0,0,0 -"access_l10n_br_delivery_carrier_vehicle_stock_manager","l10n_br_delivery_carrier_vehicle","model_l10n_br_delivery_carrier_vehicle","stock.group_stock_manager",1,1,1,1 -"access_l10n_br_delivery_shipment_sale","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","base.group_sale_salesman",1,0,0,0 -"access_l10n_br_delivery_shipment_sale_manager","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","base.group_sale_manager",1,0,0,0 -"access_l10n_br_delivery_shipment_partner_manager","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","base.group_partner_manager",1,0,0,0 -"access_l10n_br_delivery_shipment_stock_user","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","stock.group_stock_user",1,0,0,0 -"access_l10n_br_delivery_shipment_stock_manager","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","stock.group_stock_manager",1,1,1,1 - diff --git a/l10n_br_delivery/stock.py b/l10n_br_delivery/stock.py deleted file mode 100644 index f40aa94f383c..000000000000 --- a/l10n_br_delivery/stock.py +++ /dev/null @@ -1,116 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################### -# # -# Copyright (C) 2009 Renato Lima - Akretion # -# # -#This program is free software: you can redistribute it and/or modify # -#it under the terms of the GNU Affero General Public License as published by # -#the Free Software Foundation, either version 3 of the License, or # -#(at your option) any later version. # -# # -#This program is distributed in the hope that it will be useful, # -#but WITHOUT ANY WARRANTY; without even the implied warranty of # -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -#GNU Affero General Public License for more details. # -# # -#You should have received a copy of the GNU Affero General Public License # -#along with this program. If not, see . # -############################################################################### - -from openerp.osv import orm, fields - - -class StockPicking(orm.Model): - _inherit = 'stock.picking' - _columns = { - 'vehicle_id': fields.many2one( - 'l10n_br_delivery.carrier.vehicle', u'Veículo'), - 'incoterm': fields.many2one( - 'stock.incoterms', 'Tipo do Frete', - help="Incoterm which stands for 'International Commercial terms" - "implies its a series of sales terms which are used in the " - "commercial transaction.")} - - def _prepare_shipping_invoice_line(self, cr, uid, picking, - invoice, context=None): - #TODO: Calcular o valor correto em caso de alteração da quantidade - return False - - def _prepare_invoice_line(self, cr, uid, group, picking, move_line, - invoice_id, invoice_vals, context=None): - result = super(StockPicking, self)._prepare_invoice_line( - cr, uid, group, picking, move_line, invoice_id, invoice_vals, - context) - #TODO: Calcular o valor correto em caso de alteração da quantidade - if move_line.sale_line_id: - result['insurance_value'] = move_line.sale_line_id.insurance_value - result['other_costs_value'] = move_line.sale_line_id.other_costs_value - result['freight_value'] = move_line.sale_line_id.freight_value - return result - - def _invoice_hook(self, cr, uid, picking, invoice_id): - """Call after the creation of the invoice.""" - context = {} - - user = self.pool.get('res.users').browse(cr, uid, uid, context=context) - company = self.pool.get('res.company').browse( - cr, uid, user.company_id.id, context=context) - inv = self.pool.get("account.invoice").browse( - cr, uid, invoice_id, context=context) - costs = [ - ('Frete', company.account_freight_id, inv.amount_freight), - ('Seguro', company.account_insurance_id, inv.amount_insurance), - ('Outros Custos', company.account_other_costs, inv.amount_costs) - ] - - ait_obj = self.pool.get('account.invoice.tax') - for cost in costs: - if cost[2] > 0: - values = { - 'invoice_id': invoice_id, - 'name': cost[0], - 'account_id': cost[1].id, - 'amount': cost[2], - 'base': cost[2], - 'manual': True, - 'company_id': company.id, - } - - ait_obj.create(cr, uid, values, context=context) - - self.pool.get('account.invoice').write( - cr, uid, invoice_id, { - 'partner_shipping_id': picking.partner_id.id, - 'carrier_id': picking.carrier_id and picking.carrier_id.id, - 'vehicle_id': picking.vehicle_id and picking.vehicle_id.id, - 'incoterm': picking.incoterm.id, - 'weight': picking.weight, - 'weight_net': picking.weight_net, - 'number_of_packages': picking.number_of_packages}) - - return super(StockPicking, self)._invoice_hook( - cr, uid, picking, invoice_id) - - -class StockPickingIn(orm.Model): - _inherit = 'stock.picking.in' - _columns = { - 'vehicle_id': fields.many2one( - 'l10n_br_delivery.carrier.vehicle', u'Veículo'), - 'incoterm': fields.many2one( - 'stock.incoterms', 'Tipo do Frete', - help="Incoterm which stands for 'International Commercial terms" - "implies its a series of sales terms which are used in the " - "commercial transaction.")} - - -class StockPickingOut(orm.Model): - _inherit = 'stock.picking.out' - _columns = { - 'vehicle_id': fields.many2one( - 'l10n_br_delivery.carrier.vehicle', u'Veículo'), - 'incoterm': fields.many2one( - 'stock.incoterms', 'Tipo do Frete', - help="Incoterm which stands for 'International Commercial terms" - "implies its a series of sales terms which are used in the " - "commercial transaction.")} diff --git a/l10n_br_delivery/stock_view.xml b/l10n_br_delivery/stock_view.xml deleted file mode 100644 index 2ccb598eb48d..000000000000 --- a/l10n_br_delivery/stock_view.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - l10n_br_delivery.stock.picking.out.form - stock.picking.out - - 32 - - - - - - - - - - From 520e9077aa3bea4a64809e3a1fe1cddbe7aaeb87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Tue, 13 Oct 2015 16:58:08 +0200 Subject: [PATCH 067/223] [MOV] move addons out of __unported__ (they remain not installable) --- l10n_br_delivery/README.md | 2 + l10n_br_delivery/__init__.py | 24 ++++ l10n_br_delivery/__openerp__.py | 42 +++++++ l10n_br_delivery/account_invoice.py | 72 +++++++++++ l10n_br_delivery/account_invoice_view.xml | 34 +++++ l10n_br_delivery/delivery.py | 29 +++++ l10n_br_delivery/delivery_view.xml | 20 +++ l10n_br_delivery/i18n/pt_BR.po | 9 ++ l10n_br_delivery/l10n_br_delivery.py | 85 +++++++++++++ l10n_br_delivery/l10n_br_delivery_view.xml | 56 +++++++++ l10n_br_delivery/sale.py | 80 ++++++++++++ l10n_br_delivery/security/ir.model.access.csv | 12 ++ l10n_br_delivery/stock.py | 116 ++++++++++++++++++ l10n_br_delivery/stock_view.xml | 19 +++ 14 files changed, 600 insertions(+) create mode 100644 l10n_br_delivery/README.md create mode 100644 l10n_br_delivery/__init__.py create mode 100644 l10n_br_delivery/__openerp__.py create mode 100644 l10n_br_delivery/account_invoice.py create mode 100644 l10n_br_delivery/account_invoice_view.xml create mode 100644 l10n_br_delivery/delivery.py create mode 100644 l10n_br_delivery/delivery_view.xml create mode 100644 l10n_br_delivery/i18n/pt_BR.po create mode 100644 l10n_br_delivery/l10n_br_delivery.py create mode 100644 l10n_br_delivery/l10n_br_delivery_view.xml create mode 100644 l10n_br_delivery/sale.py create mode 100644 l10n_br_delivery/security/ir.model.access.csv create mode 100644 l10n_br_delivery/stock.py create mode 100644 l10n_br_delivery/stock_view.xml diff --git a/l10n_br_delivery/README.md b/l10n_br_delivery/README.md new file mode 100644 index 000000000000..3389c68c229f --- /dev/null +++ b/l10n_br_delivery/README.md @@ -0,0 +1,2 @@ +Módulo de Entrega +================= diff --git a/l10n_br_delivery/__init__.py b/l10n_br_delivery/__init__.py new file mode 100644 index 000000000000..41c7601a3f91 --- /dev/null +++ b/l10n_br_delivery/__init__.py @@ -0,0 +1,24 @@ +# -*- encoding: utf-8 -*- +############################################################################### +# # +# Copyright (C) 2009 Renato Lima - Akretion # +# # +#This program is free software: you can redistribute it and/or modify # +#it under the terms of the GNU Affero General Public License as published by # +#the Free Software Foundation, either version 3 of the License, or # +#(at your option) any later version. # +# # +#This program is distributed in the hope that it will be useful, # +#but WITHOUT ANY WARRANTY; without even the implied warranty of # +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +#GNU Affero General Public License for more details. # +# # +#You should have received a copy of the GNU Affero General Public License # +#along with this program. If not, see . # +############################################################################### + +import sale +import l10n_br_delivery +import delivery +import account_invoice +import stock diff --git a/l10n_br_delivery/__openerp__.py b/l10n_br_delivery/__openerp__.py new file mode 100644 index 000000000000..540e029596ec --- /dev/null +++ b/l10n_br_delivery/__openerp__.py @@ -0,0 +1,42 @@ +# -*- encoding: utf-8 -*- +############################################################################### +# # +# Copyright (C) 2010 Renato Lima - Akretion # +# # +#This program is free software: you can redistribute it and/or modify # +#it under the terms of the GNU Affero General Public License as published by # +#the Free Software Foundation, either version 3 of the License, or # +#(at your option) any later version. # +# # +#This program is distributed in the hope that it will be useful, # +#but WITHOUT ANY WARRANTY; without even the implied warranty of # +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +#GNU Affero General Public License for more details. # +# # +#You should have received a copy of the GNU Affero General Public License # +#along with this program. If not, see . # +############################################################################### + +{ + 'name': 'Brazilian Localization Delivery', + 'description': 'Extend delivery module for Brazilian Localization', + 'license': 'AGPL-3', + 'author': 'Akretion, OpenERP Brasil', + 'website': 'http://openerpbrasil.org', + 'version': '7.0', + 'depends': [ + 'l10n_br_sale_stock', + 'delivery', + ], + 'data': [ + 'account_invoice_view.xml', + 'delivery_view.xml', + 'stock_view.xml', + 'l10n_br_delivery_view.xml', + 'security/ir.model.access.csv', + ], + 'demo': [], + 'category': 'Localisation', + 'active': False, + 'installable': False, +} diff --git a/l10n_br_delivery/account_invoice.py b/l10n_br_delivery/account_invoice.py new file mode 100644 index 000000000000..7aa04fcdbeab --- /dev/null +++ b/l10n_br_delivery/account_invoice.py @@ -0,0 +1,72 @@ +# -*- encoding: utf-8 -*- +############################################################################### +# # +# Copyright (C) 2010 Renato Lima - Akretion # +# # +#This program is free software: you can redistribute it and/or modify # +#it under the terms of the GNU Affero General Public License as published by # +#the Free Software Foundation, either version 3 of the License, or # +#(at your option) any later version. # +# # +#This program is distributed in the hope that it will be useful, # +#but WITHOUT ANY WARRANTY; without even the implied warranty of # +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +#GNU Affero General Public License for more details. # +# # +#You should have received a copy of the GNU Affero General Public License # +#along with this program. If not, see . # +############################################################################### + +from openerp.osv import orm, fields +from openerp.tools.translate import _ + + +class AccountInvoice(orm.Model): + _inherit = 'account.invoice' + _columns = { + 'carrier_id': fields.many2one( + 'delivery.carrier', 'Transportadora', readonly=True, + states={'draft': [('readonly', False)]}), + 'vehicle_id': fields.many2one( + 'l10n_br_delivery.carrier.vehicle', u'Veículo', readonly=True, + states={'draft': [('readonly', False)]}), + 'incoterm': fields.many2one( + 'stock.incoterms', 'Tipo do Frete', readonly=True, + states={'draft': [('readonly', False)]}, + help="Incoterm which stands for 'International Commercial terms' " + "implies its a series of sales terms which are used in the " + "commercial transaction."), + } + + def nfe_check(self, cr, uid, ids, context=None): + result = super(AccountInvoice, self).nfe_check(cr, uid, ids, context) + strErro = u'' + + for inv in self.browse(cr, uid, ids, context=context): + # Carrier + if inv.carrier_id: + + if not inv.carrier_id.partner_id.legal_name: + strErro = u'Transportadora - Razão Social\n' + + if not inv.carrier_id.partner_id.cnpj_cpf: + strErro = 'Transportadora - CNPJ/CPF\n' + + # Carrier Vehicle + if inv.vehicle_id: + + if not inv.vehicle_id.plate: + strErro = u'Transportadora / Veículo - Placa\n' + + if not inv.vehicle_id.state_id.code: + strErro = u'Transportadora / Veículo - UF da Placa\n' + + if not inv.vehicle_id.rntc_code: + strErro = u'Transportadora / Veículo - RNTC\n' + + if strErro: + raise orm.except_orm( + _('Error!'), + _(u"Validação da Nota fiscal:\n '%s'") % (strErro)) + + return result diff --git a/l10n_br_delivery/account_invoice_view.xml b/l10n_br_delivery/account_invoice_view.xml new file mode 100644 index 000000000000..6077475e56bb --- /dev/null +++ b/l10n_br_delivery/account_invoice_view.xml @@ -0,0 +1,34 @@ + + + + + + l10n_br_delivery.invoice.form + account.invoice + + + + + + + + + + + + + l10n_br_delivery.invoice.supplier.form + account.invoice + + + + + + + + + + + + + diff --git a/l10n_br_delivery/delivery.py b/l10n_br_delivery/delivery.py new file mode 100644 index 000000000000..9049e660817d --- /dev/null +++ b/l10n_br_delivery/delivery.py @@ -0,0 +1,29 @@ +# -*- encoding: utf-8 -*- +############################################################################### +# # +# Copyright (C) 2010 Renato Lima - Akretion # +# # +#This program is free software: you can redistribute it and/or modify # +#it under the terms of the GNU Affero General Public License as published by # +#the Free Software Foundation, either version 3 of the License, or # +#(at your option) any later version. # +# # +#This program is distributed in the hope that it will be useful, # +#but WITHOUT ANY WARRANTY; without even the implied warranty of # +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +#GNU Affero General Public License for more details. # +# # +#You should have received a copy of the GNU Affero General Public License # +#along with this program. If not, see . # +############################################################################### + +from openerp.osv import orm, fields + + +class DeliveryCarrier(orm.Model): + _inherit = 'delivery.carrier' + _columns = { + 'antt_code': fields.char('Codigo ANTT', size=32), + 'vehicle_ids': fields.one2many( + 'l10n_br_delivery.carrier.vehicle', 'carrier_id', u'Veículos'), + } diff --git a/l10n_br_delivery/delivery_view.xml b/l10n_br_delivery/delivery_view.xml new file mode 100644 index 000000000000..8bbbe6a78c91 --- /dev/null +++ b/l10n_br_delivery/delivery_view.xml @@ -0,0 +1,20 @@ + + + + + + + l10n_br_delivery.carrier.form + delivery.carrier + form + + + + + + + + + + + diff --git a/l10n_br_delivery/i18n/pt_BR.po b/l10n_br_delivery/i18n/pt_BR.po new file mode 100644 index 000000000000..83844794e99f --- /dev/null +++ b/l10n_br_delivery/i18n/pt_BR.po @@ -0,0 +1,9 @@ +#. module: base +#: model:ir.module.module,shortdesc:base.module_l10n_br_delivery +msgid "Brazilian Localization Delivery" +msgstr "Localização Brasileira - Módulo de Entrega" + +#. module: base +#: model:ir.module.module,description:base.module_l10n_br_delivery +msgid "Extend delivery module for Brazilian Localization" +msgstr "Localização Brasileira - Implementa funcionalidades do módulo de entrega" diff --git a/l10n_br_delivery/l10n_br_delivery.py b/l10n_br_delivery/l10n_br_delivery.py new file mode 100644 index 000000000000..0511ad9bbce4 --- /dev/null +++ b/l10n_br_delivery/l10n_br_delivery.py @@ -0,0 +1,85 @@ +# -*- encoding: utf-8 -*- +############################################################################### +# # +# Copyright (C) 2010 Renato Lima - Akretion # +# # +#This program is free software: you can redistribute it and/or modify # +#it under the terms of the GNU Affero General Public License as published by # +#the Free Software Foundation, either version 3 of the License, or # +#(at your option) any later version. # +# # +#This program is distributed in the hope that it will be useful, # +#but WITHOUT ANY WARRANTY; without even the implied warranty of # +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +#GNU Affero General Public License for more details. # +# # +#You should have received a copy of the GNU Affero General Public License # +#along with this program. If not, see . # +############################################################################### + +from openerp.osv import orm, fields + + +class L10n_brDeliveryCarrierVehicle(orm.Model): + _name = 'l10n_br_delivery.carrier.vehicle' + _description = 'Veiculos das transportadoras' + _columns = { + 'name': fields.char('Nome', required=True, size=32), + 'description': fields.char('Descrição', size=132), + 'plate': fields.char('Placa', size=7), + 'driver': fields.char('Condudor', size=64), + 'rntc_code': fields.char('Codigo ANTT', size=32), + 'country_id': fields.many2one('res.country', 'País'), + 'state_id': fields.many2one( + 'res.country.state', 'Estado', + domain="[('country_id', '=', country_id)]"), + 'l10n_br_city_id': fields.many2one('l10n_br_base.city', 'Municipio', + domain="[('state_id','=',state_id)]"), + 'active': fields.boolean('Ativo'), + 'manufacture_year': fields.char('Ano de Fabricação', size=4), + 'model_year': fields.char('Ano do Modelo', size=4), + 'type': fields.selection([('bau', 'Caminhão Baú')], 'Ano do Modelo'), + 'carrier_id': fields.many2one( + 'delivery.carrier', 'Carrier', select=True, + required=True, ondelete='cascade'), + } + + +class L10n_brDeliveryShipment(orm.Model): + _name = 'l10n_br_delivery.shipment' + _columns = { + 'code': fields.char('Nome', size=32), + 'description': fields.char('Descrição', size=132), + 'carrier_id': fields.many2one( + 'delivery.carrier', 'Carrier', select=True, required=True), + 'vehicle_id': fields.many2one( + 'l10n_br_delivery.carrier.vehicle', 'Vehicle', select=True, + required=True), + 'volume': fields.float('Volume'), + 'carrier_tracking_ref': fields.char('Carrier Tracking Ref', size=32), + 'number_of_packages': fields.integer('Number of Packages'), + } + + def _cal_weight(self, cr, uid, ids, name, args, context=None): + result = {} + + for picking in self.browse(cr, uid, ids, context): + total_weight = total_weight_net = 0.00 + + for move in picking.move_lines: + total_weight += move.weight + total_weight_net += move.weight_net + + result[picking.id] = { + 'weight': total_weight, + 'weight_net': total_weight_net, + } + + return result + + def _get_picking_line(self, cr, uid, ids, context=None): + result = {} + for line in self.pool.get('stock.move').browse( + cr, uid, ids, context=context): + result[line.picking_id.id] = True + return list(result.keys()) diff --git a/l10n_br_delivery/l10n_br_delivery_view.xml b/l10n_br_delivery/l10n_br_delivery_view.xml new file mode 100644 index 000000000000..dedf7befc4f9 --- /dev/null +++ b/l10n_br_delivery/l10n_br_delivery_view.xml @@ -0,0 +1,56 @@ + + + + + + + l10n_br_delivery.carrier.vehicle.form + l10n_br_delivery.carrier.vehicle + form + +
+ + + + + + + + + + + + + + + + + +
+ + + l10n_br_delivery.carrier.vehicle.tree + l10n_br_delivery.carrier.vehicle + tree + + + + + + + + + + + Veículo + ir.actions.act_window + l10n_br_delivery.carrier.vehicle + tree,form + form + + + + + +
+
diff --git a/l10n_br_delivery/sale.py b/l10n_br_delivery/sale.py new file mode 100644 index 000000000000..f63b673ed370 --- /dev/null +++ b/l10n_br_delivery/sale.py @@ -0,0 +1,80 @@ +# -*- encoding: utf-8 -*- +############################################################################### +# # +# Copyright (C) 2009 Renato Lima - Akretion # +# # +#This program is free software: you can redistribute it and/or modify # +#it under the terms of the GNU Affero General Public License as published by # +#the Free Software Foundation, either version 3 of the License, or # +#(at your option) any later version. # +# # +#This program is distributed in the hope that it will be useful, # +#but WITHOUT ANY WARRANTY; without even the implied warranty of # +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +#GNU Affero General Public License for more details. # +# # +#You should have received a copy of the GNU Affero General Public License # +#along with this program. If not, see . # +############################################################################### + +import time +from openerp.osv import orm, osv +from openerp.tools.translate import _ + + +class SaleOrder(orm.Model): + _inherit = 'sale.order' + + def _prepare_invoice(self, cr, uid, order, lines, context=None): + """Prepare the dict of values to create the new invoice for a + sale order. This method may be overridden to implement custom + invoice generation (making sure to call super() to establish + a clean extension chain). + + :param browse_record order: sale.order record to invoice + :param list(int) line: list of invoice line IDs that must be + attached to the invoice + :return: dict of value to create() the invoice + """ + result = super(SaleOrder, self)._prepare_invoice( + cr, uid, order, lines, context) + + if order.carrier_id: + result['carrier_id'] = order.carrier_id.id + + return result + + def _prepare_order_picking(self, cr, uid, order, context=None): + result = super(SaleOrder, self)._prepare_order_picking( + cr, uid, order, context) + + # FIXME - Confirmado bug do OpenERP + # https://bugs.launchpad.net/bugs/1161138 + # Esse campo já deveria ser copiado pelo módulo nativo delivery + result['incoterm'] = order.incoterm and order.incoterm.id or False + return result + + def delivery_set(self, cr, uid, ids, context=None): + #Copia do modulo delivery + #Exceto pelo final que adiciona ao campo total do frete. + grid_obj = self.pool.get('delivery.grid') + carrier_obj = self.pool.get('delivery.carrier') + + for order in self.browse(cr, uid, ids, context=context): + grid_id = carrier_obj.grid_get(cr, uid, [order.carrier_id.id], + order.partner_shipping_id.id) + + if not grid_id: + raise osv.except_osv(_('No Grid Available!'), + _('No grid matching for this carrier!')) + + if not order.state in ('draft'): + raise osv.except_osv(_('Order not in Draft State!'), + _('The order state have to be draft to add delivery lines.')) + + grid = grid_obj.browse(cr, uid, grid_id, context=context) + + amount_freight = grid_obj.get_price(cr, uid, grid.id, order, + time.strftime('%Y-%m-%d'), context) + self.onchange_amount_freight(cr, uid, ids, amount_freight) + return self.write(cr, uid, ids, {'amount_freight': amount_freight}) diff --git a/l10n_br_delivery/security/ir.model.access.csv b/l10n_br_delivery/security/ir.model.access.csv new file mode 100644 index 000000000000..5ea057c1e8f4 --- /dev/null +++ b/l10n_br_delivery/security/ir.model.access.csv @@ -0,0 +1,12 @@ +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +"access_l10n_br_delivery_carrier_vehicle_sale","l10n_br_delivery_carrier_vehicle","model_l10n_br_delivery_carrier_vehicle","base.group_sale_salesman",1,0,0,0 +"access_l10n_br_delivery_carrier_vehicle_sale_manager","l10n_br_delivery_carrier_vehicle","model_l10n_br_delivery_carrier_vehicle","base.group_sale_manager",1,0,0,0 +"access_l10n_br_delivery_carrier_vehicle_partner_manager","l10n_br_delivery_carrier_vehicle","model_l10n_br_delivery_carrier_vehicle","base.group_partner_manager",1,0,0,0 +"access_l10n_br_delivery_carrier_vehicle_stock_user","l10n_br_delivery_carrier_vehicle","model_l10n_br_delivery_carrier_vehicle","stock.group_stock_user",1,0,0,0 +"access_l10n_br_delivery_carrier_vehicle_stock_manager","l10n_br_delivery_carrier_vehicle","model_l10n_br_delivery_carrier_vehicle","stock.group_stock_manager",1,1,1,1 +"access_l10n_br_delivery_shipment_sale","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","base.group_sale_salesman",1,0,0,0 +"access_l10n_br_delivery_shipment_sale_manager","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","base.group_sale_manager",1,0,0,0 +"access_l10n_br_delivery_shipment_partner_manager","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","base.group_partner_manager",1,0,0,0 +"access_l10n_br_delivery_shipment_stock_user","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","stock.group_stock_user",1,0,0,0 +"access_l10n_br_delivery_shipment_stock_manager","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","stock.group_stock_manager",1,1,1,1 + diff --git a/l10n_br_delivery/stock.py b/l10n_br_delivery/stock.py new file mode 100644 index 000000000000..f40aa94f383c --- /dev/null +++ b/l10n_br_delivery/stock.py @@ -0,0 +1,116 @@ +# -*- encoding: utf-8 -*- +############################################################################### +# # +# Copyright (C) 2009 Renato Lima - Akretion # +# # +#This program is free software: you can redistribute it and/or modify # +#it under the terms of the GNU Affero General Public License as published by # +#the Free Software Foundation, either version 3 of the License, or # +#(at your option) any later version. # +# # +#This program is distributed in the hope that it will be useful, # +#but WITHOUT ANY WARRANTY; without even the implied warranty of # +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +#GNU Affero General Public License for more details. # +# # +#You should have received a copy of the GNU Affero General Public License # +#along with this program. If not, see . # +############################################################################### + +from openerp.osv import orm, fields + + +class StockPicking(orm.Model): + _inherit = 'stock.picking' + _columns = { + 'vehicle_id': fields.many2one( + 'l10n_br_delivery.carrier.vehicle', u'Veículo'), + 'incoterm': fields.many2one( + 'stock.incoterms', 'Tipo do Frete', + help="Incoterm which stands for 'International Commercial terms" + "implies its a series of sales terms which are used in the " + "commercial transaction.")} + + def _prepare_shipping_invoice_line(self, cr, uid, picking, + invoice, context=None): + #TODO: Calcular o valor correto em caso de alteração da quantidade + return False + + def _prepare_invoice_line(self, cr, uid, group, picking, move_line, + invoice_id, invoice_vals, context=None): + result = super(StockPicking, self)._prepare_invoice_line( + cr, uid, group, picking, move_line, invoice_id, invoice_vals, + context) + #TODO: Calcular o valor correto em caso de alteração da quantidade + if move_line.sale_line_id: + result['insurance_value'] = move_line.sale_line_id.insurance_value + result['other_costs_value'] = move_line.sale_line_id.other_costs_value + result['freight_value'] = move_line.sale_line_id.freight_value + return result + + def _invoice_hook(self, cr, uid, picking, invoice_id): + """Call after the creation of the invoice.""" + context = {} + + user = self.pool.get('res.users').browse(cr, uid, uid, context=context) + company = self.pool.get('res.company').browse( + cr, uid, user.company_id.id, context=context) + inv = self.pool.get("account.invoice").browse( + cr, uid, invoice_id, context=context) + costs = [ + ('Frete', company.account_freight_id, inv.amount_freight), + ('Seguro', company.account_insurance_id, inv.amount_insurance), + ('Outros Custos', company.account_other_costs, inv.amount_costs) + ] + + ait_obj = self.pool.get('account.invoice.tax') + for cost in costs: + if cost[2] > 0: + values = { + 'invoice_id': invoice_id, + 'name': cost[0], + 'account_id': cost[1].id, + 'amount': cost[2], + 'base': cost[2], + 'manual': True, + 'company_id': company.id, + } + + ait_obj.create(cr, uid, values, context=context) + + self.pool.get('account.invoice').write( + cr, uid, invoice_id, { + 'partner_shipping_id': picking.partner_id.id, + 'carrier_id': picking.carrier_id and picking.carrier_id.id, + 'vehicle_id': picking.vehicle_id and picking.vehicle_id.id, + 'incoterm': picking.incoterm.id, + 'weight': picking.weight, + 'weight_net': picking.weight_net, + 'number_of_packages': picking.number_of_packages}) + + return super(StockPicking, self)._invoice_hook( + cr, uid, picking, invoice_id) + + +class StockPickingIn(orm.Model): + _inherit = 'stock.picking.in' + _columns = { + 'vehicle_id': fields.many2one( + 'l10n_br_delivery.carrier.vehicle', u'Veículo'), + 'incoterm': fields.many2one( + 'stock.incoterms', 'Tipo do Frete', + help="Incoterm which stands for 'International Commercial terms" + "implies its a series of sales terms which are used in the " + "commercial transaction.")} + + +class StockPickingOut(orm.Model): + _inherit = 'stock.picking.out' + _columns = { + 'vehicle_id': fields.many2one( + 'l10n_br_delivery.carrier.vehicle', u'Veículo'), + 'incoterm': fields.many2one( + 'stock.incoterms', 'Tipo do Frete', + help="Incoterm which stands for 'International Commercial terms" + "implies its a series of sales terms which are used in the " + "commercial transaction.")} diff --git a/l10n_br_delivery/stock_view.xml b/l10n_br_delivery/stock_view.xml new file mode 100644 index 000000000000..2ccb598eb48d --- /dev/null +++ b/l10n_br_delivery/stock_view.xml @@ -0,0 +1,19 @@ + + + + + + l10n_br_delivery.stock.picking.out.form + stock.picking.out + + 32 + + + + + + + + + + From f59854649ab88992262d4fbbd9f001c78d5bb3c6 Mon Sep 17 00:00:00 2001 From: Luis Felipe Mileo Date: Sun, 15 Nov 2015 00:12:07 -0200 Subject: [PATCH 068/223] [FIX] CamelCase Classes --- l10n_br_delivery/l10n_br_delivery.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/l10n_br_delivery/l10n_br_delivery.py b/l10n_br_delivery/l10n_br_delivery.py index 0511ad9bbce4..0a6a1df5445d 100644 --- a/l10n_br_delivery/l10n_br_delivery.py +++ b/l10n_br_delivery/l10n_br_delivery.py @@ -20,7 +20,7 @@ from openerp.osv import orm, fields -class L10n_brDeliveryCarrierVehicle(orm.Model): +class L10nBrDeliveryCarrierVehicle(orm.Model): _name = 'l10n_br_delivery.carrier.vehicle' _description = 'Veiculos das transportadoras' _columns = { @@ -45,7 +45,7 @@ class L10n_brDeliveryCarrierVehicle(orm.Model): } -class L10n_brDeliveryShipment(orm.Model): +class L10nBrDeliveryShipment(orm.Model): _name = 'l10n_br_delivery.shipment' _columns = { 'code': fields.char('Nome', size=32), From 8a70de07e4c095bbf381487cd93137b01d46240c Mon Sep 17 00:00:00 2001 From: Luis Felipe Mileo Date: Sun, 15 Nov 2015 00:30:12 -0200 Subject: [PATCH 069/223] [REF] Removing active tag from __openerp__.py --- l10n_br_delivery/__openerp__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/l10n_br_delivery/__openerp__.py b/l10n_br_delivery/__openerp__.py index 540e029596ec..bbe4220d2927 100644 --- a/l10n_br_delivery/__openerp__.py +++ b/l10n_br_delivery/__openerp__.py @@ -37,6 +37,5 @@ ], 'demo': [], 'category': 'Localisation', - 'active': False, 'installable': False, } From 855a1a9b0860c5a64e3ca36ff9ff80b227fb0550 Mon Sep 17 00:00:00 2001 From: Luis Felipe Mileo Date: Sun, 15 Nov 2015 01:28:21 -0200 Subject: [PATCH 070/223] [FIX] PEP8 [REF] -*- coding: utf-8 -*- Squash pep8 --- l10n_br_delivery/__init__.py | 2 +- l10n_br_delivery/__openerp__.py | 3 +-- l10n_br_delivery/account_invoice.py | 2 +- l10n_br_delivery/delivery.py | 2 +- l10n_br_delivery/l10n_br_delivery.py | 2 +- l10n_br_delivery/sale.py | 2 +- l10n_br_delivery/stock.py | 2 +- 7 files changed, 7 insertions(+), 8 deletions(-) diff --git a/l10n_br_delivery/__init__.py b/l10n_br_delivery/__init__.py index 41c7601a3f91..6b8f417d3e51 100644 --- a/l10n_br_delivery/__init__.py +++ b/l10n_br_delivery/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################### # # # Copyright (C) 2009 Renato Lima - Akretion # diff --git a/l10n_br_delivery/__openerp__.py b/l10n_br_delivery/__openerp__.py index bbe4220d2927..2a56b02df6e5 100644 --- a/l10n_br_delivery/__openerp__.py +++ b/l10n_br_delivery/__openerp__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################### # # # Copyright (C) 2010 Renato Lima - Akretion # @@ -19,7 +19,6 @@ { 'name': 'Brazilian Localization Delivery', - 'description': 'Extend delivery module for Brazilian Localization', 'license': 'AGPL-3', 'author': 'Akretion, OpenERP Brasil', 'website': 'http://openerpbrasil.org', diff --git a/l10n_br_delivery/account_invoice.py b/l10n_br_delivery/account_invoice.py index 7aa04fcdbeab..ccb5ed8ee886 100644 --- a/l10n_br_delivery/account_invoice.py +++ b/l10n_br_delivery/account_invoice.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################### # # # Copyright (C) 2010 Renato Lima - Akretion # diff --git a/l10n_br_delivery/delivery.py b/l10n_br_delivery/delivery.py index 9049e660817d..b9bac4a28b3a 100644 --- a/l10n_br_delivery/delivery.py +++ b/l10n_br_delivery/delivery.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################### # # # Copyright (C) 2010 Renato Lima - Akretion # diff --git a/l10n_br_delivery/l10n_br_delivery.py b/l10n_br_delivery/l10n_br_delivery.py index 0a6a1df5445d..05883ebd8937 100644 --- a/l10n_br_delivery/l10n_br_delivery.py +++ b/l10n_br_delivery/l10n_br_delivery.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################### # # # Copyright (C) 2010 Renato Lima - Akretion # diff --git a/l10n_br_delivery/sale.py b/l10n_br_delivery/sale.py index f63b673ed370..fe31544c9c21 100644 --- a/l10n_br_delivery/sale.py +++ b/l10n_br_delivery/sale.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################### # # # Copyright (C) 2009 Renato Lima - Akretion # diff --git a/l10n_br_delivery/stock.py b/l10n_br_delivery/stock.py index f40aa94f383c..856701ee3d73 100644 --- a/l10n_br_delivery/stock.py +++ b/l10n_br_delivery/stock.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################### # # # Copyright (C) 2009 Renato Lima - Akretion # From ae3cf240a7d6030e49bfb5579dcadc30d2397cfa Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Mon, 27 Oct 2014 10:45:40 -0200 Subject: [PATCH 071/223] update metadata info Conflicts: l10n_br_delivery/__openerp__.py --- l10n_br_delivery/__openerp__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/l10n_br_delivery/__openerp__.py b/l10n_br_delivery/__openerp__.py index 2a56b02df6e5..a01ac65c8a93 100644 --- a/l10n_br_delivery/__openerp__.py +++ b/l10n_br_delivery/__openerp__.py @@ -20,9 +20,9 @@ { 'name': 'Brazilian Localization Delivery', 'license': 'AGPL-3', - 'author': 'Akretion, OpenERP Brasil', - 'website': 'http://openerpbrasil.org', - 'version': '7.0', + 'author': 'Akretion, Odoo Brasil', + 'website': 'http://odoo-brasil.org', + 'version': '8.0', 'depends': [ 'l10n_br_sale_stock', 'delivery', @@ -36,5 +36,5 @@ ], 'demo': [], 'category': 'Localisation', - 'installable': False, + 'installable': True, } From f64427c375aea9bc7203ad8c63e283312fbf6923 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Mon, 27 Oct 2014 10:46:53 -0200 Subject: [PATCH 072/223] migrate stock.picking object and view to new API --- l10n_br_delivery/stock.py | 26 +------------------------- l10n_br_delivery/stock_view.xml | 2 +- 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/l10n_br_delivery/stock.py b/l10n_br_delivery/stock.py index 856701ee3d73..c026ab5e4aea 100644 --- a/l10n_br_delivery/stock.py +++ b/l10n_br_delivery/stock.py @@ -89,28 +89,4 @@ def _invoice_hook(self, cr, uid, picking, invoice_id): 'number_of_packages': picking.number_of_packages}) return super(StockPicking, self)._invoice_hook( - cr, uid, picking, invoice_id) - - -class StockPickingIn(orm.Model): - _inherit = 'stock.picking.in' - _columns = { - 'vehicle_id': fields.many2one( - 'l10n_br_delivery.carrier.vehicle', u'Veículo'), - 'incoterm': fields.many2one( - 'stock.incoterms', 'Tipo do Frete', - help="Incoterm which stands for 'International Commercial terms" - "implies its a series of sales terms which are used in the " - "commercial transaction.")} - - -class StockPickingOut(orm.Model): - _inherit = 'stock.picking.out' - _columns = { - 'vehicle_id': fields.many2one( - 'l10n_br_delivery.carrier.vehicle', u'Veículo'), - 'incoterm': fields.many2one( - 'stock.incoterms', 'Tipo do Frete', - help="Incoterm which stands for 'International Commercial terms" - "implies its a series of sales terms which are used in the " - "commercial transaction.")} + cr, uid, picking, invoice_id) \ No newline at end of file diff --git a/l10n_br_delivery/stock_view.xml b/l10n_br_delivery/stock_view.xml index 2ccb598eb48d..3362058fc8f4 100644 --- a/l10n_br_delivery/stock_view.xml +++ b/l10n_br_delivery/stock_view.xml @@ -4,7 +4,7 @@ l10n_br_delivery.stock.picking.out.form - stock.picking.out + stock.picking 32 From 386dc09421da277249bd6b1a317d2af891790afd Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 30 Oct 2014 18:16:20 -0200 Subject: [PATCH 073/223] migrate delivery.carrier to new API --- l10n_br_delivery/delivery.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/l10n_br_delivery/delivery.py b/l10n_br_delivery/delivery.py index b9bac4a28b3a..196bb20474fc 100644 --- a/l10n_br_delivery/delivery.py +++ b/l10n_br_delivery/delivery.py @@ -17,13 +17,12 @@ #along with this program. If not, see . # ############################################################################### -from openerp.osv import orm, fields +from openerp import models, fields -class DeliveryCarrier(orm.Model): +class DeliveryCarrier(models.Model): _inherit = 'delivery.carrier' - _columns = { - 'antt_code': fields.char('Codigo ANTT', size=32), - 'vehicle_ids': fields.one2many( - 'l10n_br_delivery.carrier.vehicle', 'carrier_id', u'Veículos'), - } + + antt_code = fields.Char('Codigo ANTT', size=32) + vehicle_ids = fields.One2many( + 'l10n_br_delivery.carrier.vehicle', 'carrier_id', u'Veículos') \ No newline at end of file From 10c2ccbc9adc1c9ee405e516284dfc631e66c4ff Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 30 Oct 2014 18:19:59 -0200 Subject: [PATCH 074/223] migrate all objects in l10n_br_delivery.py to new API --- l10n_br_delivery/l10n_br_delivery.py | 69 ++++++++++++++-------------- 1 file changed, 34 insertions(+), 35 deletions(-) diff --git a/l10n_br_delivery/l10n_br_delivery.py b/l10n_br_delivery/l10n_br_delivery.py index 05883ebd8937..20aab684ddc1 100644 --- a/l10n_br_delivery/l10n_br_delivery.py +++ b/l10n_br_delivery/l10n_br_delivery.py @@ -17,48 +17,47 @@ #along with this program. If not, see . # ############################################################################### -from openerp.osv import orm, fields +from openerp import models, fields -class L10nBrDeliveryCarrierVehicle(orm.Model): +class L10nBrDeliveryCarrierVehicle(models.Model): _name = 'l10n_br_delivery.carrier.vehicle' _description = 'Veiculos das transportadoras' - _columns = { - 'name': fields.char('Nome', required=True, size=32), - 'description': fields.char('Descrição', size=132), - 'plate': fields.char('Placa', size=7), - 'driver': fields.char('Condudor', size=64), - 'rntc_code': fields.char('Codigo ANTT', size=32), - 'country_id': fields.many2one('res.country', 'País'), - 'state_id': fields.many2one( - 'res.country.state', 'Estado', - domain="[('country_id', '=', country_id)]"), - 'l10n_br_city_id': fields.many2one('l10n_br_base.city', 'Municipio', - domain="[('state_id','=',state_id)]"), - 'active': fields.boolean('Ativo'), - 'manufacture_year': fields.char('Ano de Fabricação', size=4), - 'model_year': fields.char('Ano do Modelo', size=4), - 'type': fields.selection([('bau', 'Caminhão Baú')], 'Ano do Modelo'), - 'carrier_id': fields.many2one( - 'delivery.carrier', 'Carrier', select=True, - required=True, ondelete='cascade'), - } + name = fields.Char('Nome', required=True, size=32) + description = fields.Char(u'Descrição', size=132) + plate = fields.Char('Placa', size=7) + driver = fields.Char('Condudor', size=64) + rntc_code = fields.Char('Codigo ANTT', size=32) + country_id = fields.Many2one('res.country', 'País') + state_id = fields.Many2one( + 'res.country.state', 'Estado', + domain="[('country_id', '=', country_id)]") + l10n_br_city_id = fields.Many2one( + 'l10n_br_base.city', 'Municipio', + domain="[('state_id','=',state_id)]") + active = fields.Boolean('Ativo') + manufacture_year = fields.Char(u'Ano de Fabricação', size=4) + model_year = fields.Char('Ano do Modelo', size=4) + type = fields.Selection([('bau', u'Caminhão Baú')], 'Ano do Modelo') + carrier_id = fields.Many2one( + 'delivery.carrier', 'Carrier', select=True, + required=True, ondelete='cascade') -class L10nBrDeliveryShipment(orm.Model): + +class L10nBrDeliveryShipment(models.Model): _name = 'l10n_br_delivery.shipment' - _columns = { - 'code': fields.char('Nome', size=32), - 'description': fields.char('Descrição', size=132), - 'carrier_id': fields.many2one( - 'delivery.carrier', 'Carrier', select=True, required=True), - 'vehicle_id': fields.many2one( - 'l10n_br_delivery.carrier.vehicle', 'Vehicle', select=True, - required=True), - 'volume': fields.float('Volume'), - 'carrier_tracking_ref': fields.char('Carrier Tracking Ref', size=32), - 'number_of_packages': fields.integer('Number of Packages'), - } + + code = fields.Char('Nome', size=32) + description = fields.Char('Descrição', size=132) + carrier_id = fields.Many2one( + 'delivery.carrier', 'Carrier', select=True, required=True) + vehicle_id = fields.Many2one( + 'l10n_br_delivery.carrier.vehicle', 'Vehicle', + select=True, required=True) + volume = fields.Float('Volume') + carrier_tracking_ref = fields.Char('Carrier Tracking Ref', size=32) + number_of_packages = fields.Integer('Number of Packages') def _cal_weight(self, cr, uid, ids, name, args, context=None): result = {} From 0f9c83bcfb4557a33f40c4fa09edc266e26c89e0 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 30 Oct 2014 18:20:34 -0200 Subject: [PATCH 075/223] migrate all objects in sale.py to new API --- l10n_br_delivery/sale.py | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/l10n_br_delivery/sale.py b/l10n_br_delivery/sale.py index fe31544c9c21..a2cef0b94e56 100644 --- a/l10n_br_delivery/sale.py +++ b/l10n_br_delivery/sale.py @@ -18,13 +18,15 @@ ############################################################################### import time -from openerp.osv import orm, osv -from openerp.tools.translate import _ +from openerp import models, _ +from openerp.exceptions import except_orm -class SaleOrder(orm.Model): + +class SaleOrder(models.Model): _inherit = 'sale.order' + # TODO migrate to new API def _prepare_invoice(self, cr, uid, order, lines, context=None): """Prepare the dict of values to create the new invoice for a sale order. This method may be overridden to implement custom @@ -44,16 +46,18 @@ def _prepare_invoice(self, cr, uid, order, lines, context=None): return result - def _prepare_order_picking(self, cr, uid, order, context=None): - result = super(SaleOrder, self)._prepare_order_picking( - cr, uid, order, context) - - # FIXME - Confirmado bug do OpenERP - # https://bugs.launchpad.net/bugs/1161138 - # Esse campo já deveria ser copiado pelo módulo nativo delivery - result['incoterm'] = order.incoterm and order.incoterm.id or False - return result + #TODO Inplement this in object stock.move method _picking_assign + #def _prepare_order_picking(self, cr, uid, order, context=None): + # result = super(SaleOrder, self)._prepare_order_picking( + # cr, uid, order, context) + # + # # FIXME - Confirmado bug do OpenERP + # # https://bugs.launchpad.net/bugs/1161138 + # # Esse campo já deveria ser copiado pelo módulo nativo delivery + # result['incoterm'] = order.incoterm and order.incoterm.id or False + # return result + # TODO migrate to new API def delivery_set(self, cr, uid, ids, context=None): #Copia do modulo delivery #Exceto pelo final que adiciona ao campo total do frete. @@ -65,11 +69,11 @@ def delivery_set(self, cr, uid, ids, context=None): order.partner_shipping_id.id) if not grid_id: - raise osv.except_osv(_('No Grid Available!'), + raise except_orm(_('No Grid Available!'), _('No grid matching for this carrier!')) if not order.state in ('draft'): - raise osv.except_osv(_('Order not in Draft State!'), + raise except_orm(_('Order not in Draft State!'), _('The order state have to be draft to add delivery lines.')) grid = grid_obj.browse(cr, uid, grid_id, context=context) From 456911d6d81ae39b2f29ddb629817f49356648d8 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 30 Oct 2014 18:20:43 -0200 Subject: [PATCH 076/223] migrate all objects in stock.py to new API --- l10n_br_delivery/stock.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/l10n_br_delivery/stock.py b/l10n_br_delivery/stock.py index c026ab5e4aea..f0dc80a7c406 100644 --- a/l10n_br_delivery/stock.py +++ b/l10n_br_delivery/stock.py @@ -17,25 +17,27 @@ #along with this program. If not, see . # ############################################################################### -from openerp.osv import orm, fields +from openerp import models, fields -class StockPicking(orm.Model): +class StockPicking(models.Model): _inherit = 'stock.picking' - _columns = { - 'vehicle_id': fields.many2one( - 'l10n_br_delivery.carrier.vehicle', u'Veículo'), - 'incoterm': fields.many2one( - 'stock.incoterms', 'Tipo do Frete', + + vehicle_id = fields.Many2one( + 'l10n_br_delivery.carrier.vehicle', u'Veículo') + incoterm = fields.Many2one( + 'stock.incoterms', 'Tipo do Frete', help="Incoterm which stands for 'International Commercial terms" "implies its a series of sales terms which are used in the " - "commercial transaction.")} + "commercial transaction.") + #TODO migrate to new API def _prepare_shipping_invoice_line(self, cr, uid, picking, invoice, context=None): #TODO: Calcular o valor correto em caso de alteração da quantidade return False + #TODO migrate to new API def _prepare_invoice_line(self, cr, uid, group, picking, move_line, invoice_id, invoice_vals, context=None): result = super(StockPicking, self)._prepare_invoice_line( @@ -48,6 +50,7 @@ def _prepare_invoice_line(self, cr, uid, group, picking, move_line, result['freight_value'] = move_line.sale_line_id.freight_value return result + #TODO migrate def _invoice_hook(self, cr, uid, picking, invoice_id): """Call after the creation of the invoice.""" context = {} From 9cbb392e26e127de6f2d694eb2e498f7a69bb50d Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 14 Jan 2015 09:27:57 -0200 Subject: [PATCH 077/223] migrate stock objects --- l10n_br_delivery/stock.py | 74 +++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 38 deletions(-) diff --git a/l10n_br_delivery/stock.py b/l10n_br_delivery/stock.py index f0dc80a7c406..7782b70a4e2b 100644 --- a/l10n_br_delivery/stock.py +++ b/l10n_br_delivery/stock.py @@ -37,40 +37,35 @@ def _prepare_shipping_invoice_line(self, cr, uid, picking, #TODO: Calcular o valor correto em caso de alteração da quantidade return False - #TODO migrate to new API - def _prepare_invoice_line(self, cr, uid, group, picking, move_line, - invoice_id, invoice_vals, context=None): - result = super(StockPicking, self)._prepare_invoice_line( - cr, uid, group, picking, move_line, invoice_id, invoice_vals, - context) - #TODO: Calcular o valor correto em caso de alteração da quantidade - if move_line.sale_line_id: - result['insurance_value'] = move_line.sale_line_id.insurance_value - result['other_costs_value'] = move_line.sale_line_id.other_costs_value - result['freight_value'] = move_line.sale_line_id.freight_value - return result - - #TODO migrate - def _invoice_hook(self, cr, uid, picking, invoice_id): - """Call after the creation of the invoice.""" - context = {} - - user = self.pool.get('res.users').browse(cr, uid, uid, context=context) - company = self.pool.get('res.company').browse( - cr, uid, user.company_id.id, context=context) - inv = self.pool.get("account.invoice").browse( - cr, uid, invoice_id, context=context) + @api.model + def _create_invoice_from_picking(self, picking, vals): + + invoice_vals = { + 'partner_shipping_id': picking.partner_id.id, + 'carrier_id': picking.carrier_id and picking.carrier_id.id, + 'vehicle_id': picking.vehicle_id and picking.vehicle_id.id, + 'incoterm': picking.incoterm.id, + 'weight': picking.weight, + 'weight_net': picking.weight_net, + 'number_of_packages': picking.number_of_packages, + } + + vals.update(invoice_vals) + result = super(StockPicking, self)._create_invoice_from_picking( + picking, vals) + + company = self.env['res.company'].browse(self.user.company_id.id) costs = [ ('Frete', company.account_freight_id, inv.amount_freight), ('Seguro', company.account_insurance_id, inv.amount_insurance), ('Outros Custos', company.account_other_costs, inv.amount_costs) ] - ait_obj = self.pool.get('account.invoice.tax') + ait_obj = self.env['account.invoice.tax'] for cost in costs: if cost[2] > 0: - values = { - 'invoice_id': invoice_id, + tax_values = { + 'invoice_id': result.invoice_id, 'name': cost[0], 'account_id': cost[1].id, 'amount': cost[2], @@ -79,17 +74,20 @@ def _invoice_hook(self, cr, uid, picking, invoice_id): 'company_id': company.id, } - ait_obj.create(cr, uid, values, context=context) + ait_obj.create(tax_values) + + +class StockMove(models.Model): + _inherit = 'stock.move' + + @api.model + def _get_invoice_line_vals(self, move, partner, inv_type): + result = super(StockMove, self)._get_invoice_line_vals( + move, partner, inv_type) - self.pool.get('account.invoice').write( - cr, uid, invoice_id, { - 'partner_shipping_id': picking.partner_id.id, - 'carrier_id': picking.carrier_id and picking.carrier_id.id, - 'vehicle_id': picking.vehicle_id and picking.vehicle_id.id, - 'incoterm': picking.incoterm.id, - 'weight': picking.weight, - 'weight_net': picking.weight_net, - 'number_of_packages': picking.number_of_packages}) + if move.sale_line_id: + result['insurance_value'] = move.sale_line_id.insurance_value + result['other_costs_value'] = move.sale_line_id.other_costs_value + result['freight_value'] = move.sale_line_id.freight_value - return super(StockPicking, self)._invoice_hook( - cr, uid, picking, invoice_id) \ No newline at end of file + return result \ No newline at end of file From c9f1444f22664d2d20912189a91a634eb790a6b7 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 14 Jan 2015 09:59:37 -0200 Subject: [PATCH 078/223] [FIX] import --- l10n_br_delivery/stock.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/l10n_br_delivery/stock.py b/l10n_br_delivery/stock.py index 7782b70a4e2b..678fff28beb4 100644 --- a/l10n_br_delivery/stock.py +++ b/l10n_br_delivery/stock.py @@ -17,7 +17,7 @@ #along with this program. If not, see . # ############################################################################### -from openerp import models, fields +from openerp import models, fields, api class StockPicking(models.Model): @@ -90,4 +90,4 @@ def _get_invoice_line_vals(self, move, partner, inv_type): result['other_costs_value'] = move.sale_line_id.other_costs_value result['freight_value'] = move.sale_line_id.freight_value - return result \ No newline at end of file + return result From 42137d7e4520ee0fc3e8d7fec1b62475c176a3a7 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 14 Jan 2015 10:33:40 -0200 Subject: [PATCH 079/223] Added api --- l10n_br_delivery/sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_delivery/sale.py b/l10n_br_delivery/sale.py index a2cef0b94e56..54b5927940a5 100644 --- a/l10n_br_delivery/sale.py +++ b/l10n_br_delivery/sale.py @@ -19,7 +19,7 @@ import time -from openerp import models, _ +from openerp import models, api, _ from openerp.exceptions import except_orm From 1609d591f1d58e52cf9d6a3312a5e81b600c681f Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 14 Jan 2015 13:48:35 -0200 Subject: [PATCH 080/223] fix self.user to self.env.user --- l10n_br_delivery/stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_delivery/stock.py b/l10n_br_delivery/stock.py index 678fff28beb4..761fa2192bbe 100644 --- a/l10n_br_delivery/stock.py +++ b/l10n_br_delivery/stock.py @@ -54,7 +54,7 @@ def _create_invoice_from_picking(self, picking, vals): result = super(StockPicking, self)._create_invoice_from_picking( picking, vals) - company = self.env['res.company'].browse(self.user.company_id.id) + company = self.env['res.company'].browse(self.env.user.company_id.id) costs = [ ('Frete', company.account_freight_id, inv.amount_freight), ('Seguro', company.account_insurance_id, inv.amount_insurance), From 8fb13da1f471fd99f096551de61d9a52fe9ad309 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 14 Jan 2015 14:31:05 -0200 Subject: [PATCH 081/223] fix stock.move and stock.picking objects --- l10n_br_delivery/stock.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/l10n_br_delivery/stock.py b/l10n_br_delivery/stock.py index 761fa2192bbe..fbf9448f4e27 100644 --- a/l10n_br_delivery/stock.py +++ b/l10n_br_delivery/stock.py @@ -51,21 +51,22 @@ def _create_invoice_from_picking(self, picking, vals): } vals.update(invoice_vals) - result = super(StockPicking, self)._create_invoice_from_picking( + invoice_id = super(StockPicking, self)._create_invoice_from_picking( picking, vals) + invoice = self.env['account.invoice'].browse(invoice_id) company = self.env['res.company'].browse(self.env.user.company_id.id) costs = [ - ('Frete', company.account_freight_id, inv.amount_freight), - ('Seguro', company.account_insurance_id, inv.amount_insurance), - ('Outros Custos', company.account_other_costs, inv.amount_costs) + ('Frete', company.account_freight_id, invoice.amount_freight), + ('Seguro', company.account_insurance_id, invoice.amount_insurance), + ('Outros Custos', company.account_other_costs, invoice.amount_costs) ] ait_obj = self.env['account.invoice.tax'] for cost in costs: if cost[2] > 0: tax_values = { - 'invoice_id': result.invoice_id, + 'invoice_id': invoice.id, 'name': cost[0], 'account_id': cost[1].id, 'amount': cost[2], @@ -75,6 +76,7 @@ def _create_invoice_from_picking(self, picking, vals): } ait_obj.create(tax_values) + return invoice_id class StockMove(models.Model): @@ -82,12 +84,13 @@ class StockMove(models.Model): @api.model def _get_invoice_line_vals(self, move, partner, inv_type): + import pudb; pudb.set_trace() result = super(StockMove, self)._get_invoice_line_vals( move, partner, inv_type) - if move.sale_line_id: - result['insurance_value'] = move.sale_line_id.insurance_value - result['other_costs_value'] = move.sale_line_id.other_costs_value - result['freight_value'] = move.sale_line_id.freight_value + if move.procurement_id.sale_line_id: + result['insurance_value'] = move.procurement_id.sale_line_id.insurance_value + result['other_costs_value'] = move.procurement_id.sale_line_id.other_costs_value + result['freight_value'] = move.procurement_id.sale_line_id.freight_value - return result + return result \ No newline at end of file From f446bf942157bd265a33a21f16763a313e8f77b0 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 14 Jan 2015 14:38:22 -0200 Subject: [PATCH 082/223] removed debug --- l10n_br_delivery/stock.py | 1 - 1 file changed, 1 deletion(-) diff --git a/l10n_br_delivery/stock.py b/l10n_br_delivery/stock.py index fbf9448f4e27..382f22247612 100644 --- a/l10n_br_delivery/stock.py +++ b/l10n_br_delivery/stock.py @@ -84,7 +84,6 @@ class StockMove(models.Model): @api.model def _get_invoice_line_vals(self, move, partner, inv_type): - import pudb; pudb.set_trace() result = super(StockMove, self)._get_invoice_line_vals( move, partner, inv_type) From 2457ff7245df05845a5561ef3695efe5de4e0bc4 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 11 Mar 2015 13:08:23 -0300 Subject: [PATCH 083/223] migrate method to new api --- l10n_br_delivery/sale.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/l10n_br_delivery/sale.py b/l10n_br_delivery/sale.py index 54b5927940a5..75be0d3c5661 100644 --- a/l10n_br_delivery/sale.py +++ b/l10n_br_delivery/sale.py @@ -26,8 +26,8 @@ class SaleOrder(models.Model): _inherit = 'sale.order' - # TODO migrate to new API - def _prepare_invoice(self, cr, uid, order, lines, context=None): + @api.model + def _prepare_invoice(self, order, lines): """Prepare the dict of values to create the new invoice for a sale order. This method may be overridden to implement custom invoice generation (making sure to call super() to establish @@ -38,8 +38,7 @@ def _prepare_invoice(self, cr, uid, order, lines, context=None): attached to the invoice :return: dict of value to create() the invoice """ - result = super(SaleOrder, self)._prepare_invoice( - cr, uid, order, lines, context) + result = super(SaleOrder, self)._prepare_invoice(order, lines) if order.carrier_id: result['carrier_id'] = order.carrier_id.id From 28785484fe39e638defef1e0f7bf694a3cbb07ec Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 11 Mar 2015 16:13:16 -0300 Subject: [PATCH 084/223] moved models and views to a folder as new pattern and replace uncoding to coding in py files --- l10n_br_delivery/__init__.py | 6 +---- l10n_br_delivery/__openerp__.py | 8 +++---- l10n_br_delivery/models/__init__.py | 24 +++++++++++++++++++ .../{ => models}/account_invoice.py | 0 l10n_br_delivery/{ => models}/delivery.py | 0 .../{ => models}/l10n_br_delivery.py | 0 l10n_br_delivery/{ => models}/sale.py | 0 l10n_br_delivery/{ => models}/stock.py | 0 .../{ => views}/account_invoice_view.xml | 0 .../{ => views}/delivery_view.xml | 0 .../{ => views}/l10n_br_delivery_view.xml | 0 l10n_br_delivery/{ => views}/stock_view.xml | 0 12 files changed, 29 insertions(+), 9 deletions(-) create mode 100644 l10n_br_delivery/models/__init__.py rename l10n_br_delivery/{ => models}/account_invoice.py (100%) rename l10n_br_delivery/{ => models}/delivery.py (100%) rename l10n_br_delivery/{ => models}/l10n_br_delivery.py (100%) rename l10n_br_delivery/{ => models}/sale.py (100%) rename l10n_br_delivery/{ => models}/stock.py (100%) rename l10n_br_delivery/{ => views}/account_invoice_view.xml (100%) rename l10n_br_delivery/{ => views}/delivery_view.xml (100%) rename l10n_br_delivery/{ => views}/l10n_br_delivery_view.xml (100%) rename l10n_br_delivery/{ => views}/stock_view.xml (100%) diff --git a/l10n_br_delivery/__init__.py b/l10n_br_delivery/__init__.py index 6b8f417d3e51..6d35b431c180 100644 --- a/l10n_br_delivery/__init__.py +++ b/l10n_br_delivery/__init__.py @@ -17,8 +17,4 @@ #along with this program. If not, see . # ############################################################################### -import sale -import l10n_br_delivery -import delivery -import account_invoice -import stock +from . import models diff --git a/l10n_br_delivery/__openerp__.py b/l10n_br_delivery/__openerp__.py index a01ac65c8a93..02ea3816abdf 100644 --- a/l10n_br_delivery/__openerp__.py +++ b/l10n_br_delivery/__openerp__.py @@ -28,10 +28,10 @@ 'delivery', ], 'data': [ - 'account_invoice_view.xml', - 'delivery_view.xml', - 'stock_view.xml', - 'l10n_br_delivery_view.xml', + 'views/account_invoice_view.xml', + 'views/delivery_view.xml', + 'views/stock_view.xml', + 'views/l10n_br_delivery_view.xml', 'security/ir.model.access.csv', ], 'demo': [], diff --git a/l10n_br_delivery/models/__init__.py b/l10n_br_delivery/models/__init__.py new file mode 100644 index 000000000000..0a7b17e22722 --- /dev/null +++ b/l10n_br_delivery/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################### +# # +# Copyright (C) 2015 Renato Lima - Akretion # +# # +#This program is free software: you can redistribute it and/or modify # +#it under the terms of the GNU Affero General Public License as published by # +#the Free Software Foundation, either version 3 of the License, or # +#(at your option) any later version. # +# # +#This program is distributed in the hope that it will be useful, # +#but WITHOUT ANY WARRANTY; without even the implied warranty of # +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +#GNU Affero General Public License for more details. # +# # +#You should have received a copy of the GNU Affero General Public License # +#along with this program. If not, see . # +############################################################################### + +from . import account_invoice +from . import delivery +from . import l10n_br_delivery +from . import sale +from . import stock diff --git a/l10n_br_delivery/account_invoice.py b/l10n_br_delivery/models/account_invoice.py similarity index 100% rename from l10n_br_delivery/account_invoice.py rename to l10n_br_delivery/models/account_invoice.py diff --git a/l10n_br_delivery/delivery.py b/l10n_br_delivery/models/delivery.py similarity index 100% rename from l10n_br_delivery/delivery.py rename to l10n_br_delivery/models/delivery.py diff --git a/l10n_br_delivery/l10n_br_delivery.py b/l10n_br_delivery/models/l10n_br_delivery.py similarity index 100% rename from l10n_br_delivery/l10n_br_delivery.py rename to l10n_br_delivery/models/l10n_br_delivery.py diff --git a/l10n_br_delivery/sale.py b/l10n_br_delivery/models/sale.py similarity index 100% rename from l10n_br_delivery/sale.py rename to l10n_br_delivery/models/sale.py diff --git a/l10n_br_delivery/stock.py b/l10n_br_delivery/models/stock.py similarity index 100% rename from l10n_br_delivery/stock.py rename to l10n_br_delivery/models/stock.py diff --git a/l10n_br_delivery/account_invoice_view.xml b/l10n_br_delivery/views/account_invoice_view.xml similarity index 100% rename from l10n_br_delivery/account_invoice_view.xml rename to l10n_br_delivery/views/account_invoice_view.xml diff --git a/l10n_br_delivery/delivery_view.xml b/l10n_br_delivery/views/delivery_view.xml similarity index 100% rename from l10n_br_delivery/delivery_view.xml rename to l10n_br_delivery/views/delivery_view.xml diff --git a/l10n_br_delivery/l10n_br_delivery_view.xml b/l10n_br_delivery/views/l10n_br_delivery_view.xml similarity index 100% rename from l10n_br_delivery/l10n_br_delivery_view.xml rename to l10n_br_delivery/views/l10n_br_delivery_view.xml diff --git a/l10n_br_delivery/stock_view.xml b/l10n_br_delivery/views/stock_view.xml similarity index 100% rename from l10n_br_delivery/stock_view.xml rename to l10n_br_delivery/views/stock_view.xml From f7e68d26c656c10b2dd7b9ec75f383a661569b55 Mon Sep 17 00:00:00 2001 From: Raphael Valyi Date: Wed, 21 Oct 2015 23:06:45 -0200 Subject: [PATCH 085/223] pep8 hopefully cleared --- l10n_br_delivery/__init__.py | 20 +++++------ l10n_br_delivery/__openerp__.py | 20 +++++------ l10n_br_delivery/models/__init__.py | 20 +++++------ l10n_br_delivery/models/account_invoice.py | 20 +++++------ l10n_br_delivery/models/delivery.py | 22 ++++++------ l10n_br_delivery/models/l10n_br_delivery.py | 30 ++++++++-------- l10n_br_delivery/models/sale.py | 40 +++++++++++---------- l10n_br_delivery/models/stock.py | 40 +++++++++++---------- 8 files changed, 109 insertions(+), 103 deletions(-) diff --git a/l10n_br_delivery/__init__.py b/l10n_br_delivery/__init__.py index 6d35b431c180..f22d4dd0bd6b 100644 --- a/l10n_br_delivery/__init__.py +++ b/l10n_br_delivery/__init__.py @@ -3,18 +3,18 @@ # # # Copyright (C) 2009 Renato Lima - Akretion # # # -#This program is free software: you can redistribute it and/or modify # -#it under the terms of the GNU Affero General Public License as published by # -#the Free Software Foundation, either version 3 of the License, or # -#(at your option) any later version. # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU Affero General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # # # -#This program is distributed in the hope that it will be useful, # -#but WITHOUT ANY WARRANTY; without even the implied warranty of # -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -#GNU Affero General Public License for more details. # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU Affero General Public License for more details. # # # -#You should have received a copy of the GNU Affero General Public License # -#along with this program. If not, see . # +# You should have received a copy of the GNU Affero General Public License # +# along with this program. If not, see . # ############################################################################### from . import models diff --git a/l10n_br_delivery/__openerp__.py b/l10n_br_delivery/__openerp__.py index 02ea3816abdf..8444766d855c 100644 --- a/l10n_br_delivery/__openerp__.py +++ b/l10n_br_delivery/__openerp__.py @@ -3,18 +3,18 @@ # # # Copyright (C) 2010 Renato Lima - Akretion # # # -#This program is free software: you can redistribute it and/or modify # -#it under the terms of the GNU Affero General Public License as published by # -#the Free Software Foundation, either version 3 of the License, or # -#(at your option) any later version. # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU Affero General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # # # -#This program is distributed in the hope that it will be useful, # -#but WITHOUT ANY WARRANTY; without even the implied warranty of # -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -#GNU Affero General Public License for more details. # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU Affero General Public License for more details. # # # -#You should have received a copy of the GNU Affero General Public License # -#along with this program. If not, see . # +# You should have received a copy of the GNU Affero General Public License # +# along with this program. If not, see . # ############################################################################### { diff --git a/l10n_br_delivery/models/__init__.py b/l10n_br_delivery/models/__init__.py index 0a7b17e22722..6314fadafcf9 100644 --- a/l10n_br_delivery/models/__init__.py +++ b/l10n_br_delivery/models/__init__.py @@ -3,18 +3,18 @@ # # # Copyright (C) 2015 Renato Lima - Akretion # # # -#This program is free software: you can redistribute it and/or modify # -#it under the terms of the GNU Affero General Public License as published by # -#the Free Software Foundation, either version 3 of the License, or # -#(at your option) any later version. # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU Affero General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # # # -#This program is distributed in the hope that it will be useful, # -#but WITHOUT ANY WARRANTY; without even the implied warranty of # -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -#GNU Affero General Public License for more details. # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU Affero General Public License for more details. # # # -#You should have received a copy of the GNU Affero General Public License # -#along with this program. If not, see . # +# You should have received a copy of the GNU Affero General Public License # +# along with this program. If not, see . # ############################################################################### from . import account_invoice diff --git a/l10n_br_delivery/models/account_invoice.py b/l10n_br_delivery/models/account_invoice.py index ccb5ed8ee886..cef12745c2ad 100644 --- a/l10n_br_delivery/models/account_invoice.py +++ b/l10n_br_delivery/models/account_invoice.py @@ -3,18 +3,18 @@ # # # Copyright (C) 2010 Renato Lima - Akretion # # # -#This program is free software: you can redistribute it and/or modify # -#it under the terms of the GNU Affero General Public License as published by # -#the Free Software Foundation, either version 3 of the License, or # -#(at your option) any later version. # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU Affero General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # # # -#This program is distributed in the hope that it will be useful, # -#but WITHOUT ANY WARRANTY; without even the implied warranty of # -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -#GNU Affero General Public License for more details. # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU Affero General Public License for more details. # # # -#You should have received a copy of the GNU Affero General Public License # -#along with this program. If not, see . # +# You should have received a copy of the GNU Affero General Public License # +# along with this program. If not, see . # ############################################################################### from openerp.osv import orm, fields diff --git a/l10n_br_delivery/models/delivery.py b/l10n_br_delivery/models/delivery.py index 196bb20474fc..b53a40eb588e 100644 --- a/l10n_br_delivery/models/delivery.py +++ b/l10n_br_delivery/models/delivery.py @@ -3,18 +3,18 @@ # # # Copyright (C) 2010 Renato Lima - Akretion # # # -#This program is free software: you can redistribute it and/or modify # -#it under the terms of the GNU Affero General Public License as published by # -#the Free Software Foundation, either version 3 of the License, or # -#(at your option) any later version. # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU Affero General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # # # -#This program is distributed in the hope that it will be useful, # -#but WITHOUT ANY WARRANTY; without even the implied warranty of # -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -#GNU Affero General Public License for more details. # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU Affero General Public License for more details. # # # -#You should have received a copy of the GNU Affero General Public License # -#along with this program. If not, see . # +# You should have received a copy of the GNU Affero General Public License # +# along with this program. If not, see . # ############################################################################### from openerp import models, fields @@ -25,4 +25,4 @@ class DeliveryCarrier(models.Model): antt_code = fields.Char('Codigo ANTT', size=32) vehicle_ids = fields.One2many( - 'l10n_br_delivery.carrier.vehicle', 'carrier_id', u'Veículos') \ No newline at end of file + 'l10n_br_delivery.carrier.vehicle', 'carrier_id', u'Veículos') diff --git a/l10n_br_delivery/models/l10n_br_delivery.py b/l10n_br_delivery/models/l10n_br_delivery.py index 20aab684ddc1..99262c44aae1 100644 --- a/l10n_br_delivery/models/l10n_br_delivery.py +++ b/l10n_br_delivery/models/l10n_br_delivery.py @@ -3,18 +3,18 @@ # # # Copyright (C) 2010 Renato Lima - Akretion # # # -#This program is free software: you can redistribute it and/or modify # -#it under the terms of the GNU Affero General Public License as published by # -#the Free Software Foundation, either version 3 of the License, or # -#(at your option) any later version. # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU Affero General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # # # -#This program is distributed in the hope that it will be useful, # -#but WITHOUT ANY WARRANTY; without even the implied warranty of # -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -#GNU Affero General Public License for more details. # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU Affero General Public License for more details. # # # -#You should have received a copy of the GNU Affero General Public License # -#along with this program. If not, see . # +# You should have received a copy of the GNU Affero General Public License # +# along with this program. If not, see . # ############################################################################### from openerp import models, fields @@ -77,8 +77,8 @@ def _cal_weight(self, cr, uid, ids, name, args, context=None): return result def _get_picking_line(self, cr, uid, ids, context=None): - result = {} - for line in self.pool.get('stock.move').browse( - cr, uid, ids, context=context): - result[line.picking_id.id] = True - return list(result.keys()) + result = {} + for line in self.pool.get('stock.move').browse(cr, uid, ids, + context=context): + result[line.picking_id.id] = True + return list(result.keys()) diff --git a/l10n_br_delivery/models/sale.py b/l10n_br_delivery/models/sale.py index 75be0d3c5661..5e89c5dcde8a 100644 --- a/l10n_br_delivery/models/sale.py +++ b/l10n_br_delivery/models/sale.py @@ -3,18 +3,18 @@ # # # Copyright (C) 2009 Renato Lima - Akretion # # # -#This program is free software: you can redistribute it and/or modify # -#it under the terms of the GNU Affero General Public License as published by # -#the Free Software Foundation, either version 3 of the License, or # -#(at your option) any later version. # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU Affero General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # # # -#This program is distributed in the hope that it will be useful, # -#but WITHOUT ANY WARRANTY; without even the implied warranty of # -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -#GNU Affero General Public License for more details. # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU Affero General Public License for more details. # # # -#You should have received a copy of the GNU Affero General Public License # -#along with this program. If not, see . # +# You should have received a copy of the GNU Affero General Public License # +# along with this program. If not, see . # ############################################################################### import time @@ -45,8 +45,8 @@ def _prepare_invoice(self, order, lines): return result - #TODO Inplement this in object stock.move method _picking_assign - #def _prepare_order_picking(self, cr, uid, order, context=None): + # TODO Inplement this in object stock.move method _picking_assign + # def _prepare_order_picking(self, cr, uid, order, context=None): # result = super(SaleOrder, self)._prepare_order_picking( # cr, uid, order, context) # @@ -58,26 +58,28 @@ def _prepare_invoice(self, order, lines): # TODO migrate to new API def delivery_set(self, cr, uid, ids, context=None): - #Copia do modulo delivery - #Exceto pelo final que adiciona ao campo total do frete. + # Copia do modulo delivery + # Exceto pelo final que adiciona ao campo total do frete. grid_obj = self.pool.get('delivery.grid') carrier_obj = self.pool.get('delivery.carrier') for order in self.browse(cr, uid, ids, context=context): grid_id = carrier_obj.grid_get(cr, uid, [order.carrier_id.id], - order.partner_shipping_id.id) + order.partner_shipping_id.id) if not grid_id: raise except_orm(_('No Grid Available!'), - _('No grid matching for this carrier!')) + _('No grid matching for this carrier!')) - if not order.state in ('draft'): + if order.state not in ('draft'): raise except_orm(_('Order not in Draft State!'), - _('The order state have to be draft to add delivery lines.')) + _('The order state have to be draft \ + to add delivery lines.')) grid = grid_obj.browse(cr, uid, grid_id, context=context) amount_freight = grid_obj.get_price(cr, uid, grid.id, order, - time.strftime('%Y-%m-%d'), context) + time.strftime('%Y-%m-%d'), + context) self.onchange_amount_freight(cr, uid, ids, amount_freight) return self.write(cr, uid, ids, {'amount_freight': amount_freight}) diff --git a/l10n_br_delivery/models/stock.py b/l10n_br_delivery/models/stock.py index 382f22247612..ed799d496b40 100644 --- a/l10n_br_delivery/models/stock.py +++ b/l10n_br_delivery/models/stock.py @@ -3,18 +3,18 @@ # # # Copyright (C) 2009 Renato Lima - Akretion # # # -#This program is free software: you can redistribute it and/or modify # -#it under the terms of the GNU Affero General Public License as published by # -#the Free Software Foundation, either version 3 of the License, or # -#(at your option) any later version. # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU Affero General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # # # -#This program is distributed in the hope that it will be useful, # -#but WITHOUT ANY WARRANTY; without even the implied warranty of # -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -#GNU Affero General Public License for more details. # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU Affero General Public License for more details. # # # -#You should have received a copy of the GNU Affero General Public License # -#along with this program. If not, see . # +# You should have received a copy of the GNU Affero General Public License # +# along with this program. If not, see . # ############################################################################### from openerp import models, fields, api @@ -31,10 +31,10 @@ class StockPicking(models.Model): "implies its a series of sales terms which are used in the " "commercial transaction.") - #TODO migrate to new API + # TODO migrate to new API def _prepare_shipping_invoice_line(self, cr, uid, picking, - invoice, context=None): - #TODO: Calcular o valor correto em caso de alteração da quantidade + invoice, context=None): + # TODO: Calcular o valor correto em caso de alteração da quantidade return False @api.model @@ -59,7 +59,9 @@ def _create_invoice_from_picking(self, picking, vals): costs = [ ('Frete', company.account_freight_id, invoice.amount_freight), ('Seguro', company.account_insurance_id, invoice.amount_insurance), - ('Outros Custos', company.account_other_costs, invoice.amount_costs) + ('Outros Custos', + company.account_other_costs, + invoice.amount_costs) ] ait_obj = self.env['account.invoice.tax'] @@ -88,8 +90,10 @@ def _get_invoice_line_vals(self, move, partner, inv_type): move, partner, inv_type) if move.procurement_id.sale_line_id: - result['insurance_value'] = move.procurement_id.sale_line_id.insurance_value - result['other_costs_value'] = move.procurement_id.sale_line_id.other_costs_value - result['freight_value'] = move.procurement_id.sale_line_id.freight_value + proc = move.procurement_id + result['insurance_value'] = proc.sale_line_id.insurance_value + result[ + 'other_costs_value'] = proc.sale_line_id.other_costs_value + result['freight_value'] = proc.sale_line_id.freight_value - return result \ No newline at end of file + return result From a1c59c7fd34ac08fce742518b8ee4bffc48440a7 Mon Sep 17 00:00:00 2001 From: Danimar Ribeiro Date: Fri, 9 Oct 2015 14:47:39 -0300 Subject: [PATCH 086/223] =?UTF-8?q?Modificado=20interface=20dos=20transpor?= =?UTF-8?q?tes,=20criado=20onchange=20para=20setar=20os=20campos=20automat?= =?UTF-8?q?icamente=20quando=20existe=20um=20metodo=20cadastrado=20e=20um?= =?UTF-8?q?=20ve=C3=ADculo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Conflicts: l10n_br_delivery/views/account_invoice_view.xml --- l10n_br_delivery/models/account_invoice.py | 35 +++++++++++++------ .../views/account_invoice_view.xml | 16 ++++----- 2 files changed, 31 insertions(+), 20 deletions(-) diff --git a/l10n_br_delivery/models/account_invoice.py b/l10n_br_delivery/models/account_invoice.py index cef12745c2ad..c2a5ecc5790a 100644 --- a/l10n_br_delivery/models/account_invoice.py +++ b/l10n_br_delivery/models/account_invoice.py @@ -17,26 +17,39 @@ # along with this program. If not, see . # ############################################################################### -from openerp.osv import orm, fields +from openerp import api, fields, models from openerp.tools.translate import _ -class AccountInvoice(orm.Model): +class AccountInvoice(models.Model): _inherit = 'account.invoice' - _columns = { - 'carrier_id': fields.many2one( - 'delivery.carrier', 'Transportadora', readonly=True, - states={'draft': [('readonly', False)]}), - 'vehicle_id': fields.many2one( + + carrier_id = fields.Many2one( + 'delivery.carrier', 'Método de transporte', readonly=True, + states={'draft': [('readonly', False)]}) + vehicle_id = fields.Many2one( 'l10n_br_delivery.carrier.vehicle', u'Veículo', readonly=True, - states={'draft': [('readonly', False)]}), - 'incoterm': fields.many2one( + states={'draft': [('readonly', False)]}) + incoterm = fields.Many2one( 'stock.incoterms', 'Tipo do Frete', readonly=True, states={'draft': [('readonly', False)]}, help="Incoterm which stands for 'International Commercial terms' " "implies its a series of sales terms which are used in the " - "commercial transaction."), - } + "commercial transaction.") + + @api.onchange('carrier_id') + def onchange_carrier_id(self): + self.partner_carrier_id = self.carrier_id.partner_id + + @api.onchange('vehicle_id') + def onchange_vehicle_id(self): + self.vehicle_plate = self.vehicle_id.plate + self.vehicle_state_id = self.vehicle_id.state_id + self.vehicle_l10n_br_city_id = self.vehicle_id.l10n_br_city_id + + @api.onchange('incoterm') + def onchange_incoterm(self): + self.freight_responsibility = self.incoterm.freight_responsibility def nfe_check(self, cr, uid, ids, context=None): result = super(AccountInvoice, self).nfe_check(cr, uid, ids, context) diff --git a/l10n_br_delivery/views/account_invoice_view.xml b/l10n_br_delivery/views/account_invoice_view.xml index 6077475e56bb..941a675717f9 100644 --- a/l10n_br_delivery/views/account_invoice_view.xml +++ b/l10n_br_delivery/views/account_invoice_view.xml @@ -7,12 +7,11 @@ account.invoice - - + - - + + @@ -21,12 +20,11 @@ account.invoice - - - + + - - + + From 1bce221c743e4254f33d2cbf8bf1a1051aa5ce55 Mon Sep 17 00:00:00 2001 From: Luis Felipe Mileo Date: Thu, 17 Dec 2015 01:09:10 -0200 Subject: [PATCH 087/223] [MIG] Migration l10n_br_delivery.py and stock.py --- l10n_br_delivery/models/l10n_br_delivery.py | 2 +- l10n_br_delivery/models/stock.py | 77 ++++++++++----------- 2 files changed, 36 insertions(+), 43 deletions(-) diff --git a/l10n_br_delivery/models/l10n_br_delivery.py b/l10n_br_delivery/models/l10n_br_delivery.py index 99262c44aae1..f568fdd17e5f 100644 --- a/l10n_br_delivery/models/l10n_br_delivery.py +++ b/l10n_br_delivery/models/l10n_br_delivery.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- + # -*- coding: utf-8 -*- ############################################################################### # # # Copyright (C) 2010 Renato Lima - Akretion # diff --git a/l10n_br_delivery/models/stock.py b/l10n_br_delivery/models/stock.py index ed799d496b40..16810557a06c 100644 --- a/l10n_br_delivery/models/stock.py +++ b/l10n_br_delivery/models/stock.py @@ -37,63 +37,56 @@ def _prepare_shipping_invoice_line(self, cr, uid, picking, # TODO: Calcular o valor correto em caso de alteração da quantidade return False - @api.model - def _create_invoice_from_picking(self, picking, vals): + def _prepare_invoice_line(self, cr, uid, group, picking, move_line, + invoice_id, invoice_vals, context=None): + result = super(StockPicking, self)._prepare_invoice_line( + cr, uid, group, picking, move_line, invoice_id, invoice_vals, + context) + #TODO: Calcular o valor correto em caso de alteração da quantidade + if move_line.sale_line_id: + result['insurance_value'] = move_line.sale_line_id.insurance_value + result['other_costs_value'] = move_line.sale_line_id.other_costs_value + result['freight_value'] = move_line.sale_line_id.freight_value + return result + + def _get_invoice_vals(self, cr, uid, key, inv_type, journal_id, move, + context=None): + + inv_vals = super(StockPicking, self)._get_invoice_vals( + cr, uid, key, inv_type, journal_id, move, context=context) + + picking = move.picking_id - invoice_vals = { + values = { 'partner_shipping_id': picking.partner_id.id, 'carrier_id': picking.carrier_id and picking.carrier_id.id, 'vehicle_id': picking.vehicle_id and picking.vehicle_id.id, - 'incoterm': picking.incoterm.id, 'weight': picking.weight, 'weight_net': picking.weight_net, 'number_of_packages': picking.number_of_packages, + 'incoterm': picking.sale_id.incoterm.id + if picking.sale_id and picking.sale_id.incoterm.id else False, } - vals.update(invoice_vals) - invoice_id = super(StockPicking, self)._create_invoice_from_picking( - picking, vals) - - invoice = self.env['account.invoice'].browse(invoice_id) - company = self.env['res.company'].browse(self.env.user.company_id.id) - costs = [ - ('Frete', company.account_freight_id, invoice.amount_freight), - ('Seguro', company.account_insurance_id, invoice.amount_insurance), - ('Outros Custos', - company.account_other_costs, - invoice.amount_costs) - ] - - ait_obj = self.env['account.invoice.tax'] - for cost in costs: - if cost[2] > 0: - tax_values = { - 'invoice_id': invoice.id, - 'name': cost[0], - 'account_id': cost[1].id, - 'amount': cost[2], - 'base': cost[2], - 'manual': True, - 'company_id': company.id, - } - - ait_obj.create(tax_values) - return invoice_id + inv_vals.update(values) + return inv_vals class StockMove(models.Model): _inherit = 'stock.move' @api.model - def _get_invoice_line_vals(self, move, partner, inv_type): + def _get_invoice_line_vals(self, cr, uid, move, partner, inv_type, + context=None): result = super(StockMove, self)._get_invoice_line_vals( - move, partner, inv_type) - - if move.procurement_id.sale_line_id: - proc = move.procurement_id - result['insurance_value'] = proc.sale_line_id.insurance_value - result[ - 'other_costs_value'] = proc.sale_line_id.other_costs_value - result['freight_value'] = proc.sale_line_id.freight_value + cr, uid, move, partner, inv_type, context=context) + if move.procurement_id and move.procurement_id.sale_line_id: + sale_line = move.procurement_id.sale_line_id + + result.update({ + 'insurance_value': sale_line.insurance_value, + 'freight_value': sale_line.freight_value, + 'other_costs_value': sale_line.other_costs_value, + }) return result From a93f75a3b11356968e35a3a63df898da64df5f4c Mon Sep 17 00:00:00 2001 From: Luis Felipe Mileo Date: Thu, 17 Dec 2015 02:14:52 -0200 Subject: [PATCH 088/223] [MIG] Migrate to new api delivery_set --- l10n_br_delivery/models/sale.py | 24 +++++++------------ .../views/account_invoice_view.xml | 12 +++++----- 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/l10n_br_delivery/models/sale.py b/l10n_br_delivery/models/sale.py index 5e89c5dcde8a..46f0132f686f 100644 --- a/l10n_br_delivery/models/sale.py +++ b/l10n_br_delivery/models/sale.py @@ -56,17 +56,15 @@ def _prepare_invoice(self, order, lines): # result['incoterm'] = order.incoterm and order.incoterm.id or False # return result - # TODO migrate to new API - def delivery_set(self, cr, uid, ids, context=None): + @api.multi + def delivery_set(self): # Copia do modulo delivery # Exceto pelo final que adiciona ao campo total do frete. - grid_obj = self.pool.get('delivery.grid') - carrier_obj = self.pool.get('delivery.carrier') - - for order in self.browse(cr, uid, ids, context=context): - grid_id = carrier_obj.grid_get(cr, uid, [order.carrier_id.id], - order.partner_shipping_id.id) + carrier_obj = self.env['delivery.carrier'] + for order in self: + carrier = carrier_obj.browse(order.carrier_id.id) + grid_id = carrier.grid_get(contact_id=order.partner_shipping_id.id) if not grid_id: raise except_orm(_('No Grid Available!'), _('No grid matching for this carrier!')) @@ -75,11 +73,7 @@ def delivery_set(self, cr, uid, ids, context=None): raise except_orm(_('Order not in Draft State!'), _('The order state have to be draft \ to add delivery lines.')) + grid = self.env['delivery.grid'].browse(grid_id) - grid = grid_obj.browse(cr, uid, grid_id, context=context) - - amount_freight = grid_obj.get_price(cr, uid, grid.id, order, - time.strftime('%Y-%m-%d'), - context) - self.onchange_amount_freight(cr, uid, ids, amount_freight) - return self.write(cr, uid, ids, {'amount_freight': amount_freight}) + order.amount_freight = grid.get_price( + order, time.strftime('%Y-%m-%d'))[0] diff --git a/l10n_br_delivery/views/account_invoice_view.xml b/l10n_br_delivery/views/account_invoice_view.xml index 941a675717f9..2f4fcbc92e32 100644 --- a/l10n_br_delivery/views/account_invoice_view.xml +++ b/l10n_br_delivery/views/account_invoice_view.xml @@ -7,11 +7,11 @@ account.invoice - + - - - + + + @@ -20,9 +20,9 @@ account.invoice - + - + From 2bd01464cf9b5220ddce720092d7ef4de53e7dd0 Mon Sep 17 00:00:00 2001 From: Luis Felipe Mileo Date: Thu, 17 Dec 2015 08:33:58 -0200 Subject: [PATCH 089/223] [FIX] Args delivery _get_invoice_line_vals --- l10n_br_delivery/models/stock.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/l10n_br_delivery/models/stock.py b/l10n_br_delivery/models/stock.py index 16810557a06c..fd83377442f6 100644 --- a/l10n_br_delivery/models/stock.py +++ b/l10n_br_delivery/models/stock.py @@ -76,10 +76,9 @@ class StockMove(models.Model): _inherit = 'stock.move' @api.model - def _get_invoice_line_vals(self, cr, uid, move, partner, inv_type, - context=None): + def _get_invoice_line_vals(self, move, partner, inv_type): result = super(StockMove, self)._get_invoice_line_vals( - cr, uid, move, partner, inv_type, context=context) + move, partner, inv_type) if move.procurement_id and move.procurement_id.sale_line_id: sale_line = move.procurement_id.sale_line_id From 04469efd750f235e11fc4ab1be37ba8d82185c21 Mon Sep 17 00:00:00 2001 From: Luis Felipe Mileo Date: Sat, 26 Dec 2015 00:55:40 -0200 Subject: [PATCH 090/223] [FIX] delivery UserError --- l10n_br_delivery/models/account_invoice.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/l10n_br_delivery/models/account_invoice.py b/l10n_br_delivery/models/account_invoice.py index c2a5ecc5790a..58567b3e3b91 100644 --- a/l10n_br_delivery/models/account_invoice.py +++ b/l10n_br_delivery/models/account_invoice.py @@ -19,6 +19,7 @@ from openerp import api, fields, models from openerp.tools.translate import _ +from openerp.exceptions import Warning as UserError class AccountInvoice(models.Model): @@ -78,7 +79,7 @@ def nfe_check(self, cr, uid, ids, context=None): strErro = u'Transportadora / Veículo - RNTC\n' if strErro: - raise orm.except_orm( + raise UserError( _('Error!'), _(u"Validação da Nota fiscal:\n '%s'") % (strErro)) From 16863815cda2ea272a228bbf3d9981a00e79c5c4 Mon Sep 17 00:00:00 2001 From: renato Date: Thu, 19 May 2016 02:05:30 -0300 Subject: [PATCH 091/223] pep8 --- l10n_br_delivery/__init__.py | 30 ++++++------ l10n_br_delivery/__openerp__.py | 30 ++++++------ l10n_br_delivery/models/__init__.py | 30 ++++++------ l10n_br_delivery/models/account_invoice.py | 52 ++++++++++----------- l10n_br_delivery/models/delivery.py | 38 ++++++++------- l10n_br_delivery/models/l10n_br_delivery.py | 32 ++++++------- l10n_br_delivery/models/sale.py | 36 +++++++------- l10n_br_delivery/models/stock.py | 32 ++++++------- 8 files changed, 142 insertions(+), 138 deletions(-) diff --git a/l10n_br_delivery/__init__.py b/l10n_br_delivery/__init__.py index f22d4dd0bd6b..9f48b732abe8 100644 --- a/l10n_br_delivery/__init__.py +++ b/l10n_br_delivery/__init__.py @@ -1,20 +1,20 @@ # -*- coding: utf-8 -*- ############################################################################### -# # -# Copyright (C) 2009 Renato Lima - Akretion # -# # -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero General Public License as published by # -# the Free Software Foundation, either version 3 of the License, or # -# (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see . # +# +# Copyright (C) 2009 Renato Lima - Akretion +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . ############################################################################### from . import models diff --git a/l10n_br_delivery/__openerp__.py b/l10n_br_delivery/__openerp__.py index 8444766d855c..af5bdeb37404 100644 --- a/l10n_br_delivery/__openerp__.py +++ b/l10n_br_delivery/__openerp__.py @@ -1,20 +1,20 @@ # -*- coding: utf-8 -*- ############################################################################### -# # -# Copyright (C) 2010 Renato Lima - Akretion # -# # -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero General Public License as published by # -# the Free Software Foundation, either version 3 of the License, or # -# (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see . # +# +# Copyright (C) 2010 Renato Lima - Akretion +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . ############################################################################### { diff --git a/l10n_br_delivery/models/__init__.py b/l10n_br_delivery/models/__init__.py index 6314fadafcf9..570264eed460 100644 --- a/l10n_br_delivery/models/__init__.py +++ b/l10n_br_delivery/models/__init__.py @@ -1,20 +1,20 @@ # -*- coding: utf-8 -*- ############################################################################### -# # -# Copyright (C) 2015 Renato Lima - Akretion # -# # -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero General Public License as published by # -# the Free Software Foundation, either version 3 of the License, or # -# (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see . # +# +# Copyright (C) 2015 Renato Lima - Akretion +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . ############################################################################### from . import account_invoice diff --git a/l10n_br_delivery/models/account_invoice.py b/l10n_br_delivery/models/account_invoice.py index 58567b3e3b91..d41cc8d9cbb8 100644 --- a/l10n_br_delivery/models/account_invoice.py +++ b/l10n_br_delivery/models/account_invoice.py @@ -1,20 +1,20 @@ # -*- coding: utf-8 -*- ############################################################################### -# # -# Copyright (C) 2010 Renato Lima - Akretion # -# # -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero General Public License as published by # -# the Free Software Foundation, either version 3 of the License, or # -# (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see . # +# +# Copyright (C) 2010 Renato Lima - Akretion +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . ############################################################################### from openerp import api, fields, models @@ -24,30 +24,30 @@ class AccountInvoice(models.Model): _inherit = 'account.invoice' - + carrier_id = fields.Many2one( - 'delivery.carrier', 'Método de transporte', readonly=True, - states={'draft': [('readonly', False)]}) + 'delivery.carrier', 'Método de transporte', readonly=True, + states={'draft': [('readonly', False)]}) vehicle_id = fields.Many2one( - 'l10n_br_delivery.carrier.vehicle', u'Veículo', readonly=True, - states={'draft': [('readonly', False)]}) + 'l10n_br_delivery.carrier.vehicle', u'Veículo', readonly=True, + states={'draft': [('readonly', False)]}) incoterm = fields.Many2one( - 'stock.incoterms', 'Tipo do Frete', readonly=True, - states={'draft': [('readonly', False)]}, - help="Incoterm which stands for 'International Commercial terms' " + 'stock.incoterms', 'Tipo do Frete', readonly=True, + states={'draft': [('readonly', False)]}, + help="Incoterm which stands for 'International Commercial terms' " "implies its a series of sales terms which are used in the " "commercial transaction.") - + @api.onchange('carrier_id') def onchange_carrier_id(self): self.partner_carrier_id = self.carrier_id.partner_id - + @api.onchange('vehicle_id') def onchange_vehicle_id(self): self.vehicle_plate = self.vehicle_id.plate self.vehicle_state_id = self.vehicle_id.state_id self.vehicle_l10n_br_city_id = self.vehicle_id.l10n_br_city_id - + @api.onchange('incoterm') def onchange_incoterm(self): self.freight_responsibility = self.incoterm.freight_responsibility diff --git a/l10n_br_delivery/models/delivery.py b/l10n_br_delivery/models/delivery.py index b53a40eb588e..c97dc6f8814a 100644 --- a/l10n_br_delivery/models/delivery.py +++ b/l10n_br_delivery/models/delivery.py @@ -1,20 +1,20 @@ # -*- coding: utf-8 -*- ############################################################################### -# # -# Copyright (C) 2010 Renato Lima - Akretion # -# # -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero General Public License as published by # -# the Free Software Foundation, either version 3 of the License, or # -# (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see . # +# +# Copyright (C) 2010 Renato Lima - Akretion +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . ############################################################################### from openerp import models, fields @@ -23,6 +23,10 @@ class DeliveryCarrier(models.Model): _inherit = 'delivery.carrier' - antt_code = fields.Char('Codigo ANTT', size=32) + antt_code = fields.Char( + 'Codigo ANTT', + size=32) + vehicle_ids = fields.One2many( - 'l10n_br_delivery.carrier.vehicle', 'carrier_id', u'Veículos') + 'l10n_br_delivery.carrier.vehicle', + 'carrier_id', u'Veículos') diff --git a/l10n_br_delivery/models/l10n_br_delivery.py b/l10n_br_delivery/models/l10n_br_delivery.py index f568fdd17e5f..75f2b8806e53 100644 --- a/l10n_br_delivery/models/l10n_br_delivery.py +++ b/l10n_br_delivery/models/l10n_br_delivery.py @@ -1,20 +1,20 @@ - # -*- coding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################### -# # -# Copyright (C) 2010 Renato Lima - Akretion # -# # -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero General Public License as published by # -# the Free Software Foundation, either version 3 of the License, or # -# (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see . # +# +# Copyright (C) 2010 Renato Lima - Akretion +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . ############################################################################### from openerp import models, fields diff --git a/l10n_br_delivery/models/sale.py b/l10n_br_delivery/models/sale.py index 46f0132f686f..ecd3722307c2 100644 --- a/l10n_br_delivery/models/sale.py +++ b/l10n_br_delivery/models/sale.py @@ -1,26 +1,26 @@ # -*- coding: utf-8 -*- ############################################################################### -# # -# Copyright (C) 2009 Renato Lima - Akretion # -# # -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero General Public License as published by # -# the Free Software Foundation, either version 3 of the License, or # -# (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see . # +# +# Copyright (C) 2009 Renato Lima - Akretion +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . ############################################################################### import time from openerp import models, api, _ -from openerp.exceptions import except_orm +from openerp.exceptions import Warning as UserError class SaleOrder(models.Model): @@ -66,11 +66,11 @@ def delivery_set(self): carrier = carrier_obj.browse(order.carrier_id.id) grid_id = carrier.grid_get(contact_id=order.partner_shipping_id.id) if not grid_id: - raise except_orm(_('No Grid Available!'), + raise UserError(_('No Grid Available!'), _('No grid matching for this carrier!')) if order.state not in ('draft'): - raise except_orm(_('Order not in Draft State!'), + raise UserError(_('Order not in Draft State!'), _('The order state have to be draft \ to add delivery lines.')) grid = self.env['delivery.grid'].browse(grid_id) diff --git a/l10n_br_delivery/models/stock.py b/l10n_br_delivery/models/stock.py index fd83377442f6..52b8ab133ee6 100644 --- a/l10n_br_delivery/models/stock.py +++ b/l10n_br_delivery/models/stock.py @@ -1,20 +1,20 @@ # -*- coding: utf-8 -*- ############################################################################### -# # -# Copyright (C) 2009 Renato Lima - Akretion # -# # -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero General Public License as published by # -# the Free Software Foundation, either version 3 of the License, or # -# (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see . # +# +# Copyright (C) 2009 Renato Lima - Akretion +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . ############################################################################### from openerp import models, fields, api @@ -42,7 +42,7 @@ def _prepare_invoice_line(self, cr, uid, group, picking, move_line, result = super(StockPicking, self)._prepare_invoice_line( cr, uid, group, picking, move_line, invoice_id, invoice_vals, context) - #TODO: Calcular o valor correto em caso de alteração da quantidade + # TODO: Calcular o valor correto em caso de alteração da quantidade if move_line.sale_line_id: result['insurance_value'] = move_line.sale_line_id.insurance_value result['other_costs_value'] = move_line.sale_line_id.other_costs_value From fca3b307c7728738ed839bc396a80c87ac52f1de Mon Sep 17 00:00:00 2001 From: renato Date: Thu, 19 May 2016 10:54:50 -0300 Subject: [PATCH 092/223] chaged README file --- l10n_br_delivery/README.md | 2 - l10n_br_delivery/README.rst | 78 +++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+), 2 deletions(-) delete mode 100644 l10n_br_delivery/README.md create mode 100644 l10n_br_delivery/README.rst diff --git a/l10n_br_delivery/README.md b/l10n_br_delivery/README.md deleted file mode 100644 index 3389c68c229f..000000000000 --- a/l10n_br_delivery/README.md +++ /dev/null @@ -1,2 +0,0 @@ -Módulo de Entrega -================= diff --git a/l10n_br_delivery/README.rst b/l10n_br_delivery/README.rst new file mode 100644 index 000000000000..dc14062d3aa9 --- /dev/null +++ b/l10n_br_delivery/README.rst @@ -0,0 +1,78 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +============================== +Módulo de Informações de Frete +============================== + +This module was written to extend the functionality of ... to support ... +and allow you to ... + +Installation +============ + +To install this module, you need to: + +* do this ... + +Configuration +============= + +To configure this module, you need to: + +* go to ... + +Usage +===== + +To use this module, you need to: + +* go to ... + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/{repo_id}/{branch} + + +.. repo_id is available in https://github.com/OCA/maintainer-tools/blob/master/tools/repos_with_ids.txt +.. branch is "8.0" for example + +Known issues / Roadmap +====================== + +TODO + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed feedback `here `_. + + +Credits +======= + +Contributors +------------ + +* Renato Lima + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +To contribute to this module, please visit http://odoo-community.org. From f557db7056f874bfdaf0920be76e6c7a07ff0137 Mon Sep 17 00:00:00 2001 From: renato Date: Thu, 19 May 2016 11:06:33 -0300 Subject: [PATCH 093/223] update author and version --- l10n_br_delivery/__openerp__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/l10n_br_delivery/__openerp__.py b/l10n_br_delivery/__openerp__.py index af5bdeb37404..fe9f80123799 100644 --- a/l10n_br_delivery/__openerp__.py +++ b/l10n_br_delivery/__openerp__.py @@ -20,9 +20,9 @@ { 'name': 'Brazilian Localization Delivery', 'license': 'AGPL-3', - 'author': 'Akretion, Odoo Brasil', + 'author': 'Akretion, Odoo Community Association (OCA)', 'website': 'http://odoo-brasil.org', - 'version': '8.0', + 'version': '8.0.1.0.0', 'depends': [ 'l10n_br_sale_stock', 'delivery', From d8b62086c8bf2063c14a488d36198f895412c9ee Mon Sep 17 00:00:00 2001 From: renato Date: Thu, 19 May 2016 12:02:42 -0300 Subject: [PATCH 094/223] [REF] methods in stock.picking --- l10n_br_delivery/models/account_invoice.py | 4 +-- l10n_br_delivery/models/sale.py | 6 ++--- l10n_br_delivery/models/stock.py | 31 +++++----------------- 3 files changed, 11 insertions(+), 30 deletions(-) diff --git a/l10n_br_delivery/models/account_invoice.py b/l10n_br_delivery/models/account_invoice.py index d41cc8d9cbb8..97c44c307347 100644 --- a/l10n_br_delivery/models/account_invoice.py +++ b/l10n_br_delivery/models/account_invoice.py @@ -35,8 +35,8 @@ class AccountInvoice(models.Model): 'stock.incoterms', 'Tipo do Frete', readonly=True, states={'draft': [('readonly', False)]}, help="Incoterm which stands for 'International Commercial terms' " - "implies its a series of sales terms which are used in the " - "commercial transaction.") + "implies its a series of sales terms which are used in the " + "commercial transaction.") @api.onchange('carrier_id') def onchange_carrier_id(self): diff --git a/l10n_br_delivery/models/sale.py b/l10n_br_delivery/models/sale.py index ecd3722307c2..fb3f3dcbaa80 100644 --- a/l10n_br_delivery/models/sale.py +++ b/l10n_br_delivery/models/sale.py @@ -67,12 +67,12 @@ def delivery_set(self): grid_id = carrier.grid_get(contact_id=order.partner_shipping_id.id) if not grid_id: raise UserError(_('No Grid Available!'), - _('No grid matching for this carrier!')) + _('No grid matching for this carrier!')) if order.state not in ('draft'): raise UserError(_('Order not in Draft State!'), - _('The order state have to be draft \ - to add delivery lines.')) + _('The order state have to be draft \ + to add delivery lines.')) grid = self.env['delivery.grid'].browse(grid_id) order.amount_freight = grid.get_price( diff --git a/l10n_br_delivery/models/stock.py b/l10n_br_delivery/models/stock.py index 52b8ab133ee6..44f7f69c193f 100644 --- a/l10n_br_delivery/models/stock.py +++ b/l10n_br_delivery/models/stock.py @@ -37,28 +37,10 @@ def _prepare_shipping_invoice_line(self, cr, uid, picking, # TODO: Calcular o valor correto em caso de alteração da quantidade return False - def _prepare_invoice_line(self, cr, uid, group, picking, move_line, - invoice_id, invoice_vals, context=None): - result = super(StockPicking, self)._prepare_invoice_line( - cr, uid, group, picking, move_line, invoice_id, invoice_vals, - context) - # TODO: Calcular o valor correto em caso de alteração da quantidade - if move_line.sale_line_id: - result['insurance_value'] = move_line.sale_line_id.insurance_value - result['other_costs_value'] = move_line.sale_line_id.other_costs_value - result['freight_value'] = move_line.sale_line_id.freight_value - return result - - def _get_invoice_vals(self, cr, uid, key, inv_type, journal_id, move, - context=None): - - inv_vals = super(StockPicking, self)._get_invoice_vals( - cr, uid, key, inv_type, journal_id, move, context=context) - - picking = move.picking_id + @api.model + def _create_invoice_from_picking(self, picking, vals): - values = { - 'partner_shipping_id': picking.partner_id.id, + vals.update({ 'carrier_id': picking.carrier_id and picking.carrier_id.id, 'vehicle_id': picking.vehicle_id and picking.vehicle_id.id, 'weight': picking.weight, @@ -66,10 +48,9 @@ def _get_invoice_vals(self, cr, uid, key, inv_type, journal_id, move, 'number_of_packages': picking.number_of_packages, 'incoterm': picking.sale_id.incoterm.id if picking.sale_id and picking.sale_id.incoterm.id else False, - } - - inv_vals.update(values) - return inv_vals + }) + return super(StockPicking, self)._create_invoice_from_picking( + picking, vals) class StockMove(models.Model): From e4dbddde3ad39002b2e673c1a63caf1e5742b208 Mon Sep 17 00:00:00 2001 From: Luis Felipe Mileo Date: Tue, 19 Jul 2016 11:45:03 -0300 Subject: [PATCH 095/223] [REF] Replace tabs with spaces find . -name '*.xml' ! -type d -exec bash -c 'expand -t 4 "$0" > /tmp/e && mv /tmp/e "$0"' {} \; --- .../views/account_invoice_view.xml | 52 ++++----- l10n_br_delivery/views/delivery_view.xml | 30 +++--- .../views/l10n_br_delivery_view.xml | 102 +++++++++--------- l10n_br_delivery/views/stock_view.xml | 28 ++--- 4 files changed, 106 insertions(+), 106 deletions(-) diff --git a/l10n_br_delivery/views/account_invoice_view.xml b/l10n_br_delivery/views/account_invoice_view.xml index 2f4fcbc92e32..42895cd7ba12 100644 --- a/l10n_br_delivery/views/account_invoice_view.xml +++ b/l10n_br_delivery/views/account_invoice_view.xml @@ -1,32 +1,32 @@ - + - - l10n_br_delivery.invoice.form - account.invoice - - - - - - - - - + + l10n_br_delivery.invoice.form + account.invoice + + + + + + + + + - - l10n_br_delivery.invoice.supplier.form - account.invoice - - - - - - - - - + + l10n_br_delivery.invoice.supplier.form + account.invoice + + + + + + + + + - + diff --git a/l10n_br_delivery/views/delivery_view.xml b/l10n_br_delivery/views/delivery_view.xml index 8bbbe6a78c91..f51d1148e64f 100644 --- a/l10n_br_delivery/views/delivery_view.xml +++ b/l10n_br_delivery/views/delivery_view.xml @@ -1,20 +1,20 @@ - + - - - l10n_br_delivery.carrier.form - delivery.carrier - form - - - - - - - - + + + l10n_br_delivery.carrier.form + delivery.carrier + form + + + + + + + + - + diff --git a/l10n_br_delivery/views/l10n_br_delivery_view.xml b/l10n_br_delivery/views/l10n_br_delivery_view.xml index dedf7befc4f9..143f97346508 100644 --- a/l10n_br_delivery/views/l10n_br_delivery_view.xml +++ b/l10n_br_delivery/views/l10n_br_delivery_view.xml @@ -1,56 +1,56 @@ - + - - - l10n_br_delivery.carrier.vehicle.form - l10n_br_delivery.carrier.vehicle - form - -
- - - - - - - - - - - - - - - - - -
- - - l10n_br_delivery.carrier.vehicle.tree - l10n_br_delivery.carrier.vehicle - tree - - - - - - - - - - - Veículo - ir.actions.act_window - l10n_br_delivery.carrier.vehicle - tree,form - form - - - - + + + l10n_br_delivery.carrier.vehicle.form + l10n_br_delivery.carrier.vehicle + form + +
+ + + + + + + + + + + + + + + + + +
+ + + l10n_br_delivery.carrier.vehicle.tree + l10n_br_delivery.carrier.vehicle + tree + + + + + + + + + + + Veículo + ir.actions.act_window + l10n_br_delivery.carrier.vehicle + tree,form + form + + + + -
+
diff --git a/l10n_br_delivery/views/stock_view.xml b/l10n_br_delivery/views/stock_view.xml index 3362058fc8f4..9cf0a744beba 100644 --- a/l10n_br_delivery/views/stock_view.xml +++ b/l10n_br_delivery/views/stock_view.xml @@ -1,19 +1,19 @@ - + - - l10n_br_delivery.stock.picking.out.form - stock.picking - - 32 - - - - - - - + + l10n_br_delivery.stock.picking.out.form + stock.picking + + 32 + + + + + + + - + From 5bd612d8c3fab269ee2a5ad2dfee7bbc05455c63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Mon, 15 Aug 2016 17:29:15 -0300 Subject: [PATCH 096/223] lighter new style OCA license headers --- l10n_br_delivery/__init__.py | 17 +---------------- l10n_br_delivery/__openerp__.py | 17 +---------------- l10n_br_delivery/models/__init__.py | 17 +---------------- l10n_br_delivery/models/account_invoice.py | 17 +---------------- l10n_br_delivery/models/delivery.py | 17 +---------------- l10n_br_delivery/models/l10n_br_delivery.py | 17 +---------------- l10n_br_delivery/models/sale.py | 17 +---------------- l10n_br_delivery/models/stock.py | 17 +---------------- 8 files changed, 8 insertions(+), 128 deletions(-) diff --git a/l10n_br_delivery/__init__.py b/l10n_br_delivery/__init__.py index 9f48b732abe8..495967c50d41 100644 --- a/l10n_br_delivery/__init__.py +++ b/l10n_br_delivery/__init__.py @@ -1,20 +1,5 @@ # -*- coding: utf-8 -*- -############################################################################### -# # Copyright (C) 2009 Renato Lima - Akretion -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -############################################################################### +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from . import models diff --git a/l10n_br_delivery/__openerp__.py b/l10n_br_delivery/__openerp__.py index fe9f80123799..6d2011da999e 100644 --- a/l10n_br_delivery/__openerp__.py +++ b/l10n_br_delivery/__openerp__.py @@ -1,21 +1,6 @@ # -*- coding: utf-8 -*- -############################################################################### -# # Copyright (C) 2010 Renato Lima - Akretion -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -############################################################################### +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html { 'name': 'Brazilian Localization Delivery', diff --git a/l10n_br_delivery/models/__init__.py b/l10n_br_delivery/models/__init__.py index 570264eed460..84c6e53eb310 100644 --- a/l10n_br_delivery/models/__init__.py +++ b/l10n_br_delivery/models/__init__.py @@ -1,21 +1,6 @@ # -*- coding: utf-8 -*- -############################################################################### -# # Copyright (C) 2015 Renato Lima - Akretion -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -############################################################################### +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from . import account_invoice from . import delivery diff --git a/l10n_br_delivery/models/account_invoice.py b/l10n_br_delivery/models/account_invoice.py index 97c44c307347..527446ec1831 100644 --- a/l10n_br_delivery/models/account_invoice.py +++ b/l10n_br_delivery/models/account_invoice.py @@ -1,21 +1,6 @@ # -*- coding: utf-8 -*- -############################################################################### -# # Copyright (C) 2010 Renato Lima - Akretion -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -############################################################################### +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp import api, fields, models from openerp.tools.translate import _ diff --git a/l10n_br_delivery/models/delivery.py b/l10n_br_delivery/models/delivery.py index c97dc6f8814a..71bf552c10e3 100644 --- a/l10n_br_delivery/models/delivery.py +++ b/l10n_br_delivery/models/delivery.py @@ -1,21 +1,6 @@ # -*- coding: utf-8 -*- -############################################################################### -# # Copyright (C) 2010 Renato Lima - Akretion -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -############################################################################### +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp import models, fields diff --git a/l10n_br_delivery/models/l10n_br_delivery.py b/l10n_br_delivery/models/l10n_br_delivery.py index 75f2b8806e53..42b584889150 100644 --- a/l10n_br_delivery/models/l10n_br_delivery.py +++ b/l10n_br_delivery/models/l10n_br_delivery.py @@ -1,21 +1,6 @@ # -*- coding: utf-8 -*- -############################################################################### -# # Copyright (C) 2010 Renato Lima - Akretion -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -############################################################################### +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp import models, fields diff --git a/l10n_br_delivery/models/sale.py b/l10n_br_delivery/models/sale.py index fb3f3dcbaa80..b7bfd369d28a 100644 --- a/l10n_br_delivery/models/sale.py +++ b/l10n_br_delivery/models/sale.py @@ -1,21 +1,6 @@ # -*- coding: utf-8 -*- -############################################################################### -# # Copyright (C) 2009 Renato Lima - Akretion -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -############################################################################### +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html import time diff --git a/l10n_br_delivery/models/stock.py b/l10n_br_delivery/models/stock.py index 44f7f69c193f..cac07e36969b 100644 --- a/l10n_br_delivery/models/stock.py +++ b/l10n_br_delivery/models/stock.py @@ -1,21 +1,6 @@ # -*- coding: utf-8 -*- -############################################################################### -# # Copyright (C) 2009 Renato Lima - Akretion -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -############################################################################### +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp import models, fields, api From 6fcf8418d702c9dc40f506ac4714894094acca80 Mon Sep 17 00:00:00 2001 From: renato Date: Thu, 25 Aug 2016 03:56:29 -0300 Subject: [PATCH 097/223] [REF] change view in l10n_br_delivery --- .../views/account_invoice_view.xml | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/l10n_br_delivery/views/account_invoice_view.xml b/l10n_br_delivery/views/account_invoice_view.xml index 42895cd7ba12..7b28834be942 100644 --- a/l10n_br_delivery/views/account_invoice_view.xml +++ b/l10n_br_delivery/views/account_invoice_view.xml @@ -5,28 +5,15 @@ l10n_br_delivery.invoice.form account.invoice - + - + - + - - l10n_br_delivery.invoice.supplier.form - account.invoice - - - - - - - - - - From e57018a2e285b345ef2b22c92a6c71b851a7e400 Mon Sep 17 00:00:00 2001 From: renato Date: Fri, 2 Dec 2016 01:33:20 -0200 Subject: [PATCH 098/223] [MIG] Make modules uninstallable --- l10n_br_delivery/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_delivery/__openerp__.py b/l10n_br_delivery/__openerp__.py index 6d2011da999e..8dfd49dfc868 100644 --- a/l10n_br_delivery/__openerp__.py +++ b/l10n_br_delivery/__openerp__.py @@ -21,5 +21,5 @@ ], 'demo': [], 'category': 'Localisation', - 'installable': True, + 'installable': False, } From 264bbe4dee47a76e4f35a5c829205126890c11e0 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Tue, 6 Dec 2016 04:26:45 -0200 Subject: [PATCH 099/223] [MIG] Rename manifest files --- l10n_br_delivery/{__openerp__.py => __manifest__.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename l10n_br_delivery/{__openerp__.py => __manifest__.py} (100%) diff --git a/l10n_br_delivery/__openerp__.py b/l10n_br_delivery/__manifest__.py similarity index 100% rename from l10n_br_delivery/__openerp__.py rename to l10n_br_delivery/__manifest__.py From 7846baeb93380d59d3f56c466e1d34ca514572f0 Mon Sep 17 00:00:00 2001 From: Gabriel Cardoso de Faria Date: Tue, 10 Nov 2020 11:37:18 -0300 Subject: [PATCH 100/223] [ADD] Freight apportionment --- l10n_br_delivery/__manifest__.py | 1 + l10n_br_delivery/models/__init__.py | 1 + l10n_br_delivery/models/document.py | 35 +++++++++++++++++++++++++++++ l10n_br_delivery/models/sale.py | 28 ++++++++++++++++++++++- 4 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 l10n_br_delivery/models/document.py diff --git a/l10n_br_delivery/__manifest__.py b/l10n_br_delivery/__manifest__.py index 8dfd49dfc868..8c4d9124b44d 100644 --- a/l10n_br_delivery/__manifest__.py +++ b/l10n_br_delivery/__manifest__.py @@ -9,6 +9,7 @@ 'website': 'http://odoo-brasil.org', 'version': '8.0.1.0.0', 'depends': [ + 'l10n_br_fiscal', 'l10n_br_sale_stock', 'delivery', ], diff --git a/l10n_br_delivery/models/__init__.py b/l10n_br_delivery/models/__init__.py index 84c6e53eb310..6bffb2e0ffc6 100644 --- a/l10n_br_delivery/models/__init__.py +++ b/l10n_br_delivery/models/__init__.py @@ -7,3 +7,4 @@ from . import l10n_br_delivery from . import sale from . import stock +from . import document diff --git a/l10n_br_delivery/models/document.py b/l10n_br_delivery/models/document.py new file mode 100644 index 000000000000..cae87eb7fc32 --- /dev/null +++ b/l10n_br_delivery/models/document.py @@ -0,0 +1,35 @@ +# Copyright (C) 2020 - Gabriel Cardoso de Faria +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from odoo import api, fields, models + + +class Document(models.Model): + _inherit = 'l10n_br_fiscal.document' + + amount_freight_value = fields.Monetary( + inverse='_inverse_amount_freight_value' + ) + + @api.multi + def _inverse_amount_freight_value(self): + for record in self.filtered(lambda doc: doc.line_ids): + amount_freight_value = record.amount_freight_value + if all(record.line_ids.mapped('freight_value')): + amount_freight_old = sum( + record.line_ids.mapped('freight_value')) + for line in record.line_ids[:-1]: + line.freight_value = amount_freight_value * ( + line.freight_value / amount_freight_old) + record.line_ids[-1].freight_value = \ + amount_freight_value - sum( + line.freight_value for line in record.line_ids[:-1]) + else: + for line in record.line_ids[:-1]: + line.freight_value = amount_freight_value * ( + line.amount_total / record.amount_total) + record.line_ids[-1].freight_value = \ + amount_freight_value - sum( + line.freight_value for line in record.line_ids[:-1]) + for line in record.line_ids: + line._onchange_fiscal_taxes() diff --git a/l10n_br_delivery/models/sale.py b/l10n_br_delivery/models/sale.py index b7bfd369d28a..f250937bb1c3 100644 --- a/l10n_br_delivery/models/sale.py +++ b/l10n_br_delivery/models/sale.py @@ -4,13 +4,17 @@ import time -from openerp import models, api, _ +from odoo import models, api, fields, _ from openerp.exceptions import Warning as UserError class SaleOrder(models.Model): _inherit = 'sale.order' + amount_freight = fields.Float( + inverse='_inverse_amount_freight', + ) + @api.model def _prepare_invoice(self, order, lines): """Prepare the dict of values to create the new invoice for a @@ -62,3 +66,25 @@ def delivery_set(self): order.amount_freight = grid.get_price( order, time.strftime('%Y-%m-%d'))[0] + + @api.multi + def _inverse_amount_freight(self): + for record in self.filtered(lambda so: so.order_line): + amount_freight = record.amount_freight + if all(record.order_line.mapped('freight_value')): + amount_freight_old = sum( + record.order_line.mapped('freight_value')) + for line in record.order_line[:-1]: + line.freight_value = amount_freight * ( + line.freight_value / amount_freight_old) + record.order_line[-1].freight_value = amount_freight - sum( + line.freight_value for line in record.order_line[:-1]) + else: + amount_total = sum(record.order_line.mapped('price_total')) + for line in record.order_line[:-1]: + line.freight_value = amount_freight * ( + line.price_total / amount_total) + record.order_line[-1].freight_value = amount_freight - sum( + line.freight_value for line in record.order_line[:-1]) + for line in record.order_line: + line._onchange_fiscal_taxes() From e03369f9608e38afff53032d3993f4648fa5d5c3 Mon Sep 17 00:00:00 2001 From: Diego Paradeda Date: Tue, 10 Nov 2020 12:23:38 -0300 Subject: [PATCH 101/223] [REF] Remove no longer used files and set v8 -> v12 --- l10n_br_delivery/__manifest__.py | 18 ++-- l10n_br_delivery/i18n/pt_BR.po | 9 -- l10n_br_delivery/models/__init__.py | 11 +-- l10n_br_delivery/models/account_invoice.py | 71 --------------- l10n_br_delivery/models/delivery.py | 17 ---- l10n_br_delivery/models/l10n_br_delivery.py | 69 -------------- l10n_br_delivery/models/sale.py | 90 ------------------- l10n_br_delivery/models/stock.py | 57 ------------ l10n_br_delivery/security/ir.model.access.csv | 12 --- .../views/account_invoice_view.xml | 19 ---- l10n_br_delivery/views/delivery_view.xml | 20 ----- .../views/l10n_br_delivery_view.xml | 56 ------------ l10n_br_delivery/views/stock_view.xml | 19 ---- 13 files changed, 10 insertions(+), 458 deletions(-) delete mode 100644 l10n_br_delivery/i18n/pt_BR.po delete mode 100644 l10n_br_delivery/models/account_invoice.py delete mode 100644 l10n_br_delivery/models/delivery.py delete mode 100644 l10n_br_delivery/models/l10n_br_delivery.py delete mode 100644 l10n_br_delivery/models/sale.py delete mode 100644 l10n_br_delivery/models/stock.py delete mode 100644 l10n_br_delivery/security/ir.model.access.csv delete mode 100644 l10n_br_delivery/views/account_invoice_view.xml delete mode 100644 l10n_br_delivery/views/delivery_view.xml delete mode 100644 l10n_br_delivery/views/l10n_br_delivery_view.xml delete mode 100644 l10n_br_delivery/views/stock_view.xml diff --git a/l10n_br_delivery/__manifest__.py b/l10n_br_delivery/__manifest__.py index 8c4d9124b44d..d8fe53db0075 100644 --- a/l10n_br_delivery/__manifest__.py +++ b/l10n_br_delivery/__manifest__.py @@ -3,24 +3,22 @@ # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html { - 'name': 'Brazilian Localization Delivery', + 'name': 'L10n Br Delivery', + 'summary': """ + This module changes the delivery model strategy to match brazilian + standards.""", 'license': 'AGPL-3', - 'author': 'Akretion, Odoo Community Association (OCA)', - 'website': 'http://odoo-brasil.org', - 'version': '8.0.1.0.0', + 'author': 'KMEE INFORMATICA LTDA,Odoo Community Association (OCA)', + 'website': 'kmee.com.br', + 'version': '"12.0.2.1.0', 'depends': [ 'l10n_br_fiscal', 'l10n_br_sale_stock', 'delivery', ], 'data': [ - 'views/account_invoice_view.xml', - 'views/delivery_view.xml', - 'views/stock_view.xml', - 'views/l10n_br_delivery_view.xml', - 'security/ir.model.access.csv', ], 'demo': [], 'category': 'Localisation', - 'installable': False, + 'installable': True, } diff --git a/l10n_br_delivery/i18n/pt_BR.po b/l10n_br_delivery/i18n/pt_BR.po deleted file mode 100644 index 83844794e99f..000000000000 --- a/l10n_br_delivery/i18n/pt_BR.po +++ /dev/null @@ -1,9 +0,0 @@ -#. module: base -#: model:ir.module.module,shortdesc:base.module_l10n_br_delivery -msgid "Brazilian Localization Delivery" -msgstr "Localização Brasileira - Módulo de Entrega" - -#. module: base -#: model:ir.module.module,description:base.module_l10n_br_delivery -msgid "Extend delivery module for Brazilian Localization" -msgstr "Localização Brasileira - Implementa funcionalidades do módulo de entrega" diff --git a/l10n_br_delivery/models/__init__.py b/l10n_br_delivery/models/__init__.py index 6bffb2e0ffc6..c17376150892 100644 --- a/l10n_br_delivery/models/__init__.py +++ b/l10n_br_delivery/models/__init__.py @@ -1,10 +1,3 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2015 Renato Lima - Akretion -# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html - -from . import account_invoice -from . import delivery -from . import l10n_br_delivery -from . import sale -from . import stock +from . import sale_order +from . import stock_picking from . import document diff --git a/l10n_br_delivery/models/account_invoice.py b/l10n_br_delivery/models/account_invoice.py deleted file mode 100644 index 527446ec1831..000000000000 --- a/l10n_br_delivery/models/account_invoice.py +++ /dev/null @@ -1,71 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2010 Renato Lima - Akretion -# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html - -from openerp import api, fields, models -from openerp.tools.translate import _ -from openerp.exceptions import Warning as UserError - - -class AccountInvoice(models.Model): - _inherit = 'account.invoice' - - carrier_id = fields.Many2one( - 'delivery.carrier', 'Método de transporte', readonly=True, - states={'draft': [('readonly', False)]}) - vehicle_id = fields.Many2one( - 'l10n_br_delivery.carrier.vehicle', u'Veículo', readonly=True, - states={'draft': [('readonly', False)]}) - incoterm = fields.Many2one( - 'stock.incoterms', 'Tipo do Frete', readonly=True, - states={'draft': [('readonly', False)]}, - help="Incoterm which stands for 'International Commercial terms' " - "implies its a series of sales terms which are used in the " - "commercial transaction.") - - @api.onchange('carrier_id') - def onchange_carrier_id(self): - self.partner_carrier_id = self.carrier_id.partner_id - - @api.onchange('vehicle_id') - def onchange_vehicle_id(self): - self.vehicle_plate = self.vehicle_id.plate - self.vehicle_state_id = self.vehicle_id.state_id - self.vehicle_l10n_br_city_id = self.vehicle_id.l10n_br_city_id - - @api.onchange('incoterm') - def onchange_incoterm(self): - self.freight_responsibility = self.incoterm.freight_responsibility - - def nfe_check(self, cr, uid, ids, context=None): - result = super(AccountInvoice, self).nfe_check(cr, uid, ids, context) - strErro = u'' - - for inv in self.browse(cr, uid, ids, context=context): - # Carrier - if inv.carrier_id: - - if not inv.carrier_id.partner_id.legal_name: - strErro = u'Transportadora - Razão Social\n' - - if not inv.carrier_id.partner_id.cnpj_cpf: - strErro = 'Transportadora - CNPJ/CPF\n' - - # Carrier Vehicle - if inv.vehicle_id: - - if not inv.vehicle_id.plate: - strErro = u'Transportadora / Veículo - Placa\n' - - if not inv.vehicle_id.state_id.code: - strErro = u'Transportadora / Veículo - UF da Placa\n' - - if not inv.vehicle_id.rntc_code: - strErro = u'Transportadora / Veículo - RNTC\n' - - if strErro: - raise UserError( - _('Error!'), - _(u"Validação da Nota fiscal:\n '%s'") % (strErro)) - - return result diff --git a/l10n_br_delivery/models/delivery.py b/l10n_br_delivery/models/delivery.py deleted file mode 100644 index 71bf552c10e3..000000000000 --- a/l10n_br_delivery/models/delivery.py +++ /dev/null @@ -1,17 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2010 Renato Lima - Akretion -# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html - -from openerp import models, fields - - -class DeliveryCarrier(models.Model): - _inherit = 'delivery.carrier' - - antt_code = fields.Char( - 'Codigo ANTT', - size=32) - - vehicle_ids = fields.One2many( - 'l10n_br_delivery.carrier.vehicle', - 'carrier_id', u'Veículos') diff --git a/l10n_br_delivery/models/l10n_br_delivery.py b/l10n_br_delivery/models/l10n_br_delivery.py deleted file mode 100644 index 42b584889150..000000000000 --- a/l10n_br_delivery/models/l10n_br_delivery.py +++ /dev/null @@ -1,69 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2010 Renato Lima - Akretion -# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html - -from openerp import models, fields - - -class L10nBrDeliveryCarrierVehicle(models.Model): - _name = 'l10n_br_delivery.carrier.vehicle' - _description = 'Veiculos das transportadoras' - - name = fields.Char('Nome', required=True, size=32) - description = fields.Char(u'Descrição', size=132) - plate = fields.Char('Placa', size=7) - driver = fields.Char('Condudor', size=64) - rntc_code = fields.Char('Codigo ANTT', size=32) - country_id = fields.Many2one('res.country', 'País') - state_id = fields.Many2one( - 'res.country.state', 'Estado', - domain="[('country_id', '=', country_id)]") - l10n_br_city_id = fields.Many2one( - 'l10n_br_base.city', 'Municipio', - domain="[('state_id','=',state_id)]") - active = fields.Boolean('Ativo') - manufacture_year = fields.Char(u'Ano de Fabricação', size=4) - model_year = fields.Char('Ano do Modelo', size=4) - type = fields.Selection([('bau', u'Caminhão Baú')], 'Ano do Modelo') - carrier_id = fields.Many2one( - 'delivery.carrier', 'Carrier', select=True, - required=True, ondelete='cascade') - - -class L10nBrDeliveryShipment(models.Model): - _name = 'l10n_br_delivery.shipment' - - code = fields.Char('Nome', size=32) - description = fields.Char('Descrição', size=132) - carrier_id = fields.Many2one( - 'delivery.carrier', 'Carrier', select=True, required=True) - vehicle_id = fields.Many2one( - 'l10n_br_delivery.carrier.vehicle', 'Vehicle', - select=True, required=True) - volume = fields.Float('Volume') - carrier_tracking_ref = fields.Char('Carrier Tracking Ref', size=32) - number_of_packages = fields.Integer('Number of Packages') - - def _cal_weight(self, cr, uid, ids, name, args, context=None): - result = {} - - for picking in self.browse(cr, uid, ids, context): - total_weight = total_weight_net = 0.00 - - for move in picking.move_lines: - total_weight += move.weight - total_weight_net += move.weight_net - - result[picking.id] = { - 'weight': total_weight, - 'weight_net': total_weight_net, - } - - return result - - def _get_picking_line(self, cr, uid, ids, context=None): - result = {} - for line in self.pool.get('stock.move').browse(cr, uid, ids, - context=context): - result[line.picking_id.id] = True - return list(result.keys()) diff --git a/l10n_br_delivery/models/sale.py b/l10n_br_delivery/models/sale.py deleted file mode 100644 index f250937bb1c3..000000000000 --- a/l10n_br_delivery/models/sale.py +++ /dev/null @@ -1,90 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2009 Renato Lima - Akretion -# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html - -import time - -from odoo import models, api, fields, _ -from openerp.exceptions import Warning as UserError - - -class SaleOrder(models.Model): - _inherit = 'sale.order' - - amount_freight = fields.Float( - inverse='_inverse_amount_freight', - ) - - @api.model - def _prepare_invoice(self, order, lines): - """Prepare the dict of values to create the new invoice for a - sale order. This method may be overridden to implement custom - invoice generation (making sure to call super() to establish - a clean extension chain). - - :param browse_record order: sale.order record to invoice - :param list(int) line: list of invoice line IDs that must be - attached to the invoice - :return: dict of value to create() the invoice - """ - result = super(SaleOrder, self)._prepare_invoice(order, lines) - - if order.carrier_id: - result['carrier_id'] = order.carrier_id.id - - return result - - # TODO Inplement this in object stock.move method _picking_assign - # def _prepare_order_picking(self, cr, uid, order, context=None): - # result = super(SaleOrder, self)._prepare_order_picking( - # cr, uid, order, context) - # - # # FIXME - Confirmado bug do OpenERP - # # https://bugs.launchpad.net/bugs/1161138 - # # Esse campo já deveria ser copiado pelo módulo nativo delivery - # result['incoterm'] = order.incoterm and order.incoterm.id or False - # return result - - @api.multi - def delivery_set(self): - # Copia do modulo delivery - # Exceto pelo final que adiciona ao campo total do frete. - - carrier_obj = self.env['delivery.carrier'] - for order in self: - carrier = carrier_obj.browse(order.carrier_id.id) - grid_id = carrier.grid_get(contact_id=order.partner_shipping_id.id) - if not grid_id: - raise UserError(_('No Grid Available!'), - _('No grid matching for this carrier!')) - - if order.state not in ('draft'): - raise UserError(_('Order not in Draft State!'), - _('The order state have to be draft \ - to add delivery lines.')) - grid = self.env['delivery.grid'].browse(grid_id) - - order.amount_freight = grid.get_price( - order, time.strftime('%Y-%m-%d'))[0] - - @api.multi - def _inverse_amount_freight(self): - for record in self.filtered(lambda so: so.order_line): - amount_freight = record.amount_freight - if all(record.order_line.mapped('freight_value')): - amount_freight_old = sum( - record.order_line.mapped('freight_value')) - for line in record.order_line[:-1]: - line.freight_value = amount_freight * ( - line.freight_value / amount_freight_old) - record.order_line[-1].freight_value = amount_freight - sum( - line.freight_value for line in record.order_line[:-1]) - else: - amount_total = sum(record.order_line.mapped('price_total')) - for line in record.order_line[:-1]: - line.freight_value = amount_freight * ( - line.price_total / amount_total) - record.order_line[-1].freight_value = amount_freight - sum( - line.freight_value for line in record.order_line[:-1]) - for line in record.order_line: - line._onchange_fiscal_taxes() diff --git a/l10n_br_delivery/models/stock.py b/l10n_br_delivery/models/stock.py deleted file mode 100644 index cac07e36969b..000000000000 --- a/l10n_br_delivery/models/stock.py +++ /dev/null @@ -1,57 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2009 Renato Lima - Akretion -# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html - -from openerp import models, fields, api - - -class StockPicking(models.Model): - _inherit = 'stock.picking' - - vehicle_id = fields.Many2one( - 'l10n_br_delivery.carrier.vehicle', u'Veículo') - incoterm = fields.Many2one( - 'stock.incoterms', 'Tipo do Frete', - help="Incoterm which stands for 'International Commercial terms" - "implies its a series of sales terms which are used in the " - "commercial transaction.") - - # TODO migrate to new API - def _prepare_shipping_invoice_line(self, cr, uid, picking, - invoice, context=None): - # TODO: Calcular o valor correto em caso de alteração da quantidade - return False - - @api.model - def _create_invoice_from_picking(self, picking, vals): - - vals.update({ - 'carrier_id': picking.carrier_id and picking.carrier_id.id, - 'vehicle_id': picking.vehicle_id and picking.vehicle_id.id, - 'weight': picking.weight, - 'weight_net': picking.weight_net, - 'number_of_packages': picking.number_of_packages, - 'incoterm': picking.sale_id.incoterm.id - if picking.sale_id and picking.sale_id.incoterm.id else False, - }) - return super(StockPicking, self)._create_invoice_from_picking( - picking, vals) - - -class StockMove(models.Model): - _inherit = 'stock.move' - - @api.model - def _get_invoice_line_vals(self, move, partner, inv_type): - result = super(StockMove, self)._get_invoice_line_vals( - move, partner, inv_type) - if move.procurement_id and move.procurement_id.sale_line_id: - sale_line = move.procurement_id.sale_line_id - - result.update({ - 'insurance_value': sale_line.insurance_value, - 'freight_value': sale_line.freight_value, - 'other_costs_value': sale_line.other_costs_value, - }) - - return result diff --git a/l10n_br_delivery/security/ir.model.access.csv b/l10n_br_delivery/security/ir.model.access.csv deleted file mode 100644 index 5ea057c1e8f4..000000000000 --- a/l10n_br_delivery/security/ir.model.access.csv +++ /dev/null @@ -1,12 +0,0 @@ -"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" -"access_l10n_br_delivery_carrier_vehicle_sale","l10n_br_delivery_carrier_vehicle","model_l10n_br_delivery_carrier_vehicle","base.group_sale_salesman",1,0,0,0 -"access_l10n_br_delivery_carrier_vehicle_sale_manager","l10n_br_delivery_carrier_vehicle","model_l10n_br_delivery_carrier_vehicle","base.group_sale_manager",1,0,0,0 -"access_l10n_br_delivery_carrier_vehicle_partner_manager","l10n_br_delivery_carrier_vehicle","model_l10n_br_delivery_carrier_vehicle","base.group_partner_manager",1,0,0,0 -"access_l10n_br_delivery_carrier_vehicle_stock_user","l10n_br_delivery_carrier_vehicle","model_l10n_br_delivery_carrier_vehicle","stock.group_stock_user",1,0,0,0 -"access_l10n_br_delivery_carrier_vehicle_stock_manager","l10n_br_delivery_carrier_vehicle","model_l10n_br_delivery_carrier_vehicle","stock.group_stock_manager",1,1,1,1 -"access_l10n_br_delivery_shipment_sale","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","base.group_sale_salesman",1,0,0,0 -"access_l10n_br_delivery_shipment_sale_manager","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","base.group_sale_manager",1,0,0,0 -"access_l10n_br_delivery_shipment_partner_manager","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","base.group_partner_manager",1,0,0,0 -"access_l10n_br_delivery_shipment_stock_user","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","stock.group_stock_user",1,0,0,0 -"access_l10n_br_delivery_shipment_stock_manager","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","stock.group_stock_manager",1,1,1,1 - diff --git a/l10n_br_delivery/views/account_invoice_view.xml b/l10n_br_delivery/views/account_invoice_view.xml deleted file mode 100644 index 7b28834be942..000000000000 --- a/l10n_br_delivery/views/account_invoice_view.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - l10n_br_delivery.invoice.form - account.invoice - - - - - - - - - - - - diff --git a/l10n_br_delivery/views/delivery_view.xml b/l10n_br_delivery/views/delivery_view.xml deleted file mode 100644 index f51d1148e64f..000000000000 --- a/l10n_br_delivery/views/delivery_view.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - l10n_br_delivery.carrier.form - delivery.carrier - form - - - - - - - - - - - diff --git a/l10n_br_delivery/views/l10n_br_delivery_view.xml b/l10n_br_delivery/views/l10n_br_delivery_view.xml deleted file mode 100644 index 143f97346508..000000000000 --- a/l10n_br_delivery/views/l10n_br_delivery_view.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - l10n_br_delivery.carrier.vehicle.form - l10n_br_delivery.carrier.vehicle - form - -
- - - - - - - - - - - - - - - - - -
- - - l10n_br_delivery.carrier.vehicle.tree - l10n_br_delivery.carrier.vehicle - tree - - - - - - - - - - - Veículo - ir.actions.act_window - l10n_br_delivery.carrier.vehicle - tree,form - form - - - - - -
-
diff --git a/l10n_br_delivery/views/stock_view.xml b/l10n_br_delivery/views/stock_view.xml deleted file mode 100644 index 9cf0a744beba..000000000000 --- a/l10n_br_delivery/views/stock_view.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - l10n_br_delivery.stock.picking.out.form - stock.picking - - 32 - - - - - - - - - - From 8da26395d8e7fdd322ea01740f8d8c13c3076296 Mon Sep 17 00:00:00 2001 From: Diego Paradeda Date: Tue, 10 Nov 2020 12:25:47 -0300 Subject: [PATCH 102/223] [ADD] Disable add delivery line from sale.order and stock.picking --- l10n_br_delivery/models/sale_order.py | 61 ++++++++++++++++++++++++ l10n_br_delivery/models/stock_picking.py | 16 +++++++ 2 files changed, 77 insertions(+) create mode 100644 l10n_br_delivery/models/sale_order.py create mode 100644 l10n_br_delivery/models/stock_picking.py diff --git a/l10n_br_delivery/models/sale_order.py b/l10n_br_delivery/models/sale_order.py new file mode 100644 index 000000000000..652d30e8b633 --- /dev/null +++ b/l10n_br_delivery/models/sale_order.py @@ -0,0 +1,61 @@ +# Copyright 2020 KMEE INFORMATICA LTDA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models, _ + +from parts.odoo.odoo.exceptions import UserError + + +class SaleOrder(models.Model): + _inherit = 'sale.order' + + amount_freight = fields.Float( + inverse='_inverse_amount_freight', + ) + + # def get_delivery_price(self): + # super(SaleOrder, self).get_delivery_price() + # + + @api.multi + def set_delivery_line(self): + # Remove delivery products from the sales order + self._remove_delivery_line() + + for order in self: + if order.state not in ('draft', 'sent'): + raise UserError(_( + 'You can add delivery price only on unconfirmed ' + 'quotations.')) + elif not order.carrier_id: + raise UserError(_('No carrier set for this order.')) + elif not order.delivery_rating_success: + raise UserError(_( + 'Please use "Check price" in order to compute a shipping ' + 'price for this quotation.')) + else: + price_unit = order.carrier_id.rate_shipment(order)['price'] + order.amount_freight = price_unit + return True + + @api.multi + def _inverse_amount_freight(self): + for record in self.filtered(lambda so: so.order_line): + amount_freight = record.amount_freight + if all(record.order_line.mapped('freight_value')): + amount_freight_old = sum( + record.order_line.mapped('freight_value')) + for line in record.order_line[:-1]: + line.freight_value = amount_freight * ( + line.freight_value / amount_freight_old) + record.order_line[-1].freight_value = amount_freight - sum( + line.freight_value for line in record.order_line[:-1]) + else: + amount_total = sum(record.order_line.mapped('price_total')) + for line in record.order_line[:-1]: + line.freight_value = amount_freight * ( + line.price_total / amount_total) + record.order_line[-1].freight_value = amount_freight - sum( + line.freight_value for line in record.order_line[:-1]) + for line in record.order_line: + line._onchange_fiscal_taxes() diff --git a/l10n_br_delivery/models/stock_picking.py b/l10n_br_delivery/models/stock_picking.py new file mode 100644 index 000000000000..95bc7bfcef77 --- /dev/null +++ b/l10n_br_delivery/models/stock_picking.py @@ -0,0 +1,16 @@ +# Copyright 2020 KMEE INFORMATICA LTDA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models, _ + + +class StockPicking(models.Model): + + _inherit = 'stock.picking' + + @api.multi + def _add_delivery_cost_to_so(self): + # disable this function since, if called, adds a delivery line to + # order -> strategy no longer used, view amount_freight + return + From 8bc6f351de659863da8fd36d2e44e6d96762be58 Mon Sep 17 00:00:00 2001 From: Gabriel Cardoso de Faria Date: Tue, 10 Nov 2020 15:31:09 -0300 Subject: [PATCH 103/223] [FIX] Runtime error --- l10n_br_delivery/models/sale_order.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/l10n_br_delivery/models/sale_order.py b/l10n_br_delivery/models/sale_order.py index 652d30e8b633..382948d9f73d 100644 --- a/l10n_br_delivery/models/sale_order.py +++ b/l10n_br_delivery/models/sale_order.py @@ -55,7 +55,11 @@ def _inverse_amount_freight(self): for line in record.order_line[:-1]: line.freight_value = amount_freight * ( line.price_total / amount_total) + todo = record.env.all.todo.copy() record.order_line[-1].freight_value = amount_freight - sum( line.freight_value for line in record.order_line[:-1]) + record.env.all.todo = todo for line in record.order_line: + todo = record.env.all.todo.copy() line._onchange_fiscal_taxes() + record.env.all.todo = todo From 96c7f32f4f6f7f201b6fb0f554d6273738e97808 Mon Sep 17 00:00:00 2001 From: Diego Paradeda Date: Fri, 4 Dec 2020 11:02:21 -0300 Subject: [PATCH 104/223] [FIX] Version and headers --- l10n_br_delivery/__init__.py | 4 ---- l10n_br_delivery/__manifest__.py | 5 ++--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/l10n_br_delivery/__init__.py b/l10n_br_delivery/__init__.py index 495967c50d41..0650744f6bc6 100644 --- a/l10n_br_delivery/__init__.py +++ b/l10n_br_delivery/__init__.py @@ -1,5 +1 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2009 Renato Lima - Akretion -# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html - from . import models diff --git a/l10n_br_delivery/__manifest__.py b/l10n_br_delivery/__manifest__.py index d8fe53db0075..2fabc233a5c9 100644 --- a/l10n_br_delivery/__manifest__.py +++ b/l10n_br_delivery/__manifest__.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2010 Renato Lima - Akretion +# Copyright (C) 2020 KMEE INFORMATICA LTDA # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html { @@ -10,7 +9,7 @@ 'license': 'AGPL-3', 'author': 'KMEE INFORMATICA LTDA,Odoo Community Association (OCA)', 'website': 'kmee.com.br', - 'version': '"12.0.2.1.0', + 'version': '12.0.1.1.0', 'depends': [ 'l10n_br_fiscal', 'l10n_br_sale_stock', From aceb6082ed7505da4d53ced9869877fb2fe01d19 Mon Sep 17 00:00:00 2001 From: Diego Paradeda Date: Fri, 4 Dec 2020 11:04:38 -0300 Subject: [PATCH 105/223] [FIX] Flake 8 --- l10n_br_delivery/models/sale_order.py | 2 +- l10n_br_delivery/models/stock_picking.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/l10n_br_delivery/models/sale_order.py b/l10n_br_delivery/models/sale_order.py index 382948d9f73d..053c1dbdca00 100644 --- a/l10n_br_delivery/models/sale_order.py +++ b/l10n_br_delivery/models/sale_order.py @@ -3,7 +3,7 @@ from odoo import api, fields, models, _ -from parts.odoo.odoo.exceptions import UserError +from odoo.exceptions import UserError class SaleOrder(models.Model): diff --git a/l10n_br_delivery/models/stock_picking.py b/l10n_br_delivery/models/stock_picking.py index 95bc7bfcef77..99c549d30119 100644 --- a/l10n_br_delivery/models/stock_picking.py +++ b/l10n_br_delivery/models/stock_picking.py @@ -1,7 +1,7 @@ # Copyright 2020 KMEE INFORMATICA LTDA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import api, fields, models, _ +from odoo import api, models class StockPicking(models.Model): @@ -13,4 +13,3 @@ def _add_delivery_cost_to_so(self): # disable this function since, if called, adds a delivery line to # order -> strategy no longer used, view amount_freight return - From 717685524c8a0f3e5b26ff9c45a287c28852dc01 Mon Sep 17 00:00:00 2001 From: Gabriel Cardoso de Faria Date: Tue, 8 Dec 2020 10:27:09 -0300 Subject: [PATCH 106/223] [REM] Commented code --- l10n_br_delivery/models/sale_order.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/l10n_br_delivery/models/sale_order.py b/l10n_br_delivery/models/sale_order.py index 053c1dbdca00..c43d347da2f0 100644 --- a/l10n_br_delivery/models/sale_order.py +++ b/l10n_br_delivery/models/sale_order.py @@ -13,9 +13,6 @@ class SaleOrder(models.Model): inverse='_inverse_amount_freight', ) - # def get_delivery_price(self): - # super(SaleOrder, self).get_delivery_price() - # @api.multi def set_delivery_line(self): From aafef238d19d3440299150f5cde1b9f7d97ab0ce Mon Sep 17 00:00:00 2001 From: Gabriel Cardoso de Faria Date: Tue, 8 Dec 2020 10:28:42 -0300 Subject: [PATCH 107/223] [ADD] Inverse function for other costs --- l10n_br_delivery/models/document.py | 29 +++++++++++++++++++++++++++ l10n_br_delivery/models/sale_order.py | 29 +++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/l10n_br_delivery/models/document.py b/l10n_br_delivery/models/document.py index cae87eb7fc32..f7ad6ebb6b95 100644 --- a/l10n_br_delivery/models/document.py +++ b/l10n_br_delivery/models/document.py @@ -11,6 +11,10 @@ class Document(models.Model): inverse='_inverse_amount_freight_value' ) + amount_other_costs_value = fields.Monetary( + inverse='_inverse_amount_other_costs_value' + ) + @api.multi def _inverse_amount_freight_value(self): for record in self.filtered(lambda doc: doc.line_ids): @@ -33,3 +37,28 @@ def _inverse_amount_freight_value(self): line.freight_value for line in record.line_ids[:-1]) for line in record.line_ids: line._onchange_fiscal_taxes() + + @api.multi + def _inverse_amount_other_costs_value(self): + for record in self.filtered(lambda doc: doc.line_ids): + amount_other_costs_value = record.amount_other_costs_value + if all(record.line_ids.mapped('other_costs_value')): + amount_freight_old = sum( + record.line_ids.mapped('other_costs_value')) + for line in record.line_ids[:-1]: + line.other_costs_value = amount_other_costs_value * ( + line.other_costs_value / amount_freight_old) + record.line_ids[-1].other_costs_value = \ + amount_other_costs_value - sum( + line.other_costs_value + for line in record.line_ids[:-1]) + else: + for line in record.line_ids[:-1]: + line.other_costs_value = amount_other_costs_value * ( + line.amount_total / record.amount_total) + record.line_ids[-1].other_costs_value = \ + amount_other_costs_value - sum( + line.other_costs_value + for line in record.line_ids[:-1]) + for line in record.line_ids: + line._onchange_fiscal_taxes() diff --git a/l10n_br_delivery/models/sale_order.py b/l10n_br_delivery/models/sale_order.py index c43d347da2f0..f70ca7b24814 100644 --- a/l10n_br_delivery/models/sale_order.py +++ b/l10n_br_delivery/models/sale_order.py @@ -13,6 +13,9 @@ class SaleOrder(models.Model): inverse='_inverse_amount_freight', ) + amount_costs = fields.Float( + inverse='_inverse_amount_costs', + ) @api.multi def set_delivery_line(self): @@ -60,3 +63,29 @@ def _inverse_amount_freight(self): todo = record.env.all.todo.copy() line._onchange_fiscal_taxes() record.env.all.todo = todo + + @api.multi + def _inverse_amount_costs(self): + for record in self.filtered(lambda so: so.order_line): + amount_costs = record.amount_costs + if all(record.order_line.mapped('other_costs_value')): + amount_costs_old = sum( + record.order_line.mapped('other_costs_value')) + for line in record.order_line[:-1]: + line.other_costs_value = amount_costs * ( + line.other_costs_value / amount_costs_old) + record.order_line[-1].other_costs_value = amount_costs - sum( + line.other_costs_value for line in record.order_line[:-1]) + else: + amount_total = sum(record.order_line.mapped('price_total')) + for line in record.order_line[:-1]: + line.other_costs_value = amount_costs * ( + line.price_total / amount_total) + todo = record.env.all.todo.copy() + record.order_line[-1].other_costs_value = amount_costs - sum( + line.other_costs_value for line in record.order_line[:-1]) + record.env.all.todo = todo + for line in record.order_line: + todo = record.env.all.todo.copy() + line._onchange_fiscal_taxes() + record.env.all.todo = todo From a4a1fbbe027dc547f2142a2dcc6c0c65b900f371 Mon Sep 17 00:00:00 2001 From: Gabriel Cardoso de Faria Date: Tue, 8 Dec 2020 10:29:22 -0300 Subject: [PATCH 108/223] [ADD] Inverse function for insurance value --- l10n_br_delivery/models/document.py | 29 +++++++++++++++++++++++ l10n_br_delivery/models/sale_order.py | 34 +++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) diff --git a/l10n_br_delivery/models/document.py b/l10n_br_delivery/models/document.py index f7ad6ebb6b95..21dc6df6fe71 100644 --- a/l10n_br_delivery/models/document.py +++ b/l10n_br_delivery/models/document.py @@ -15,6 +15,10 @@ class Document(models.Model): inverse='_inverse_amount_other_costs_value' ) + amount_insurance_value = fields.Monetary( + inverse='_inverse_amount_insurance_value' + ) + @api.multi def _inverse_amount_freight_value(self): for record in self.filtered(lambda doc: doc.line_ids): @@ -62,3 +66,28 @@ def _inverse_amount_other_costs_value(self): for line in record.line_ids[:-1]) for line in record.line_ids: line._onchange_fiscal_taxes() + + @api.multi + def _inverse_amount_insurance_value(self): + for record in self.filtered(lambda doc: doc.line_ids): + amount_insurance_value = record.amount_insurance_value + if all(record.line_ids.mapped('insurance_value')): + amount_freight_old = sum( + record.line_ids.mapped('insurance_value')) + for line in record.line_ids[:-1]: + line.insurance_value = amount_insurance_value * ( + line.insurance_value / amount_freight_old) + record.line_ids[-1].insurance_value = \ + amount_insurance_value - sum( + line.insurance_value + for line in record.line_ids[:-1]) + else: + for line in record.line_ids[:-1]: + line.insurance_value = amount_insurance_value * ( + line.amount_total / record.amount_total) + record.line_ids[-1].insurance_value = \ + amount_insurance_value - sum( + line.insurance_value + for line in record.line_ids[:-1]) + for line in record.line_ids: + line._onchange_fiscal_taxes() diff --git a/l10n_br_delivery/models/sale_order.py b/l10n_br_delivery/models/sale_order.py index f70ca7b24814..a9b394833849 100644 --- a/l10n_br_delivery/models/sale_order.py +++ b/l10n_br_delivery/models/sale_order.py @@ -13,6 +13,9 @@ class SaleOrder(models.Model): inverse='_inverse_amount_freight', ) + amount_insurance = fields.Float( + inverse='_inverse_amount_insurance', + ) amount_costs = fields.Float( inverse='_inverse_amount_costs', ) @@ -64,6 +67,37 @@ def _inverse_amount_freight(self): line._onchange_fiscal_taxes() record.env.all.todo = todo + @api.multi + def _inverse_amount_insurance(self): + for record in self.filtered(lambda so: so.order_line): + amount_insurance = record.amount_insurance + if all(record.order_line.mapped('insurance_value')): + amount_insurance_old = sum( + record.order_line.mapped('insurance_value')) + for line in record.order_line[:-1]: + line.insurance_value = amount_insurance * ( + line.insurance_value / amount_insurance_old) + record.order_line[-1].insurance_value = \ + amount_insurance - sum( + line.insurance_value + for line in record.order_line[:-1] + ) + else: + amount_total = sum(record.order_line.mapped('price_total')) + for line in record.order_line[:-1]: + line.insurance_value = amount_insurance * ( + line.price_total / amount_total) + todo = record.env.all.todo.copy() + record.order_line[-1].insurance_value = \ + amount_insurance - sum( + line.insurance_value + for line in record.order_line[:-1]) + record.env.all.todo = todo + for line in record.order_line: + todo = record.env.all.todo.copy() + line._onchange_fiscal_taxes() + record.env.all.todo = todo + @api.multi def _inverse_amount_costs(self): for record in self.filtered(lambda so: so.order_line): From 9d45f7981cf9e7098b04afa20596a11fcd5bf0c2 Mon Sep 17 00:00:00 2001 From: Luis Malta Date: Tue, 8 Dec 2020 11:29:10 -0300 Subject: [PATCH 109/223] [FIX] l10n_delivery manifest --- l10n_br_delivery/__manifest__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/l10n_br_delivery/__manifest__.py b/l10n_br_delivery/__manifest__.py index 2fabc233a5c9..2263c2b02247 100644 --- a/l10n_br_delivery/__manifest__.py +++ b/l10n_br_delivery/__manifest__.py @@ -2,13 +2,13 @@ # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html { - 'name': 'L10n Br Delivery', + 'name': 'Brazilian Localization Delivery', 'summary': """ This module changes the delivery model strategy to match brazilian standards.""", 'license': 'AGPL-3', - 'author': 'KMEE INFORMATICA LTDA,Odoo Community Association (OCA)', - 'website': 'kmee.com.br', + 'author': 'KMEE,Odoo Community Association (OCA)', + 'website': 'https://github.com/oca/l10n-brazil', 'version': '12.0.1.1.0', 'depends': [ 'l10n_br_fiscal', @@ -18,6 +18,6 @@ 'data': [ ], 'demo': [], - 'category': 'Localisation', + 'category': 'Localization', 'installable': True, } From 8f69d6f354f3ec4be28cac5e82861f3d99aa8d14 Mon Sep 17 00:00:00 2001 From: Luis Malta Date: Tue, 8 Dec 2020 14:44:47 -0300 Subject: [PATCH 110/223] [ADD] README files --- l10n_br_delivery/README.rst | 99 ++-- l10n_br_delivery/readme/CONFIGURE.rst | 1 + l10n_br_delivery/readme/CONTRIBUTORS.rst | 4 + l10n_br_delivery/readme/DESCRIPTION.rst | 3 + l10n_br_delivery/readme/HISTORY.rst | 1 + l10n_br_delivery/readme/INSTALL.rst | 1 + l10n_br_delivery/readme/ROADMAP.rst | 1 + l10n_br_delivery/readme/USAGE.rst | 10 + .../static/description/index.html | 459 ++++++++++++++++++ 9 files changed, 545 insertions(+), 34 deletions(-) create mode 100644 l10n_br_delivery/readme/CONFIGURE.rst create mode 100644 l10n_br_delivery/readme/CONTRIBUTORS.rst create mode 100644 l10n_br_delivery/readme/DESCRIPTION.rst create mode 100644 l10n_br_delivery/readme/HISTORY.rst create mode 100644 l10n_br_delivery/readme/INSTALL.rst create mode 100644 l10n_br_delivery/readme/ROADMAP.rst create mode 100644 l10n_br_delivery/readme/USAGE.rst create mode 100644 l10n_br_delivery/static/description/index.html diff --git a/l10n_br_delivery/README.rst b/l10n_br_delivery/README.rst index dc14062d3aa9..9b32d5454351 100644 --- a/l10n_br_delivery/README.rst +++ b/l10n_br_delivery/README.rst @@ -1,78 +1,109 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html - :alt: License: AGPL-3 - -============================== -Módulo de Informações de Frete -============================== - -This module was written to extend the functionality of ... to support ... -and allow you to ... +=============================== +Brazilian Localization Delivery +=============================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fhttps://github.com/OCA/l10n--brazil-lightgray.png?logo=github + :target: https://github.com/OCA/https://github.com/OCA/l10n-brazil/tree/12.0/l10n_br_delivery + :alt: OCA/https://github.com/OCA/l10n-brazil +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/https://github.com/OCA/l10n-brazil-12-0/https://github.com/OCA/l10n-brazil-12-0-l10n_br_delivery + :alt: Translate me on Weblate + +|badge1| |badge2| |badge3| |badge4| + +This module was written to extend the functionality of delivery to support the +adequacy of Brazilian delivery standards +and allows you to apportion the value of freight, insurance and other costs. + +**Table of contents** + +.. contents:: + :local: Installation ============ -To install this module, you need to: - -* do this ... +To install this module, you need to do nothing Configuration ============= -To configure this module, you need to: - -* go to ... +No additional configuration is required to use this module Usage ===== To use this module, you need to: -* go to ... +* Create a quote and enter freight, insurance and other costs for each product line +* Check the total values of the quotation being updated according to the sum of the values of the product lines -.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/{repo_id}/{branch} +Alternatively: +* Change only the total freight, insurance and other quote costs -.. repo_id is available in https://github.com/OCA/maintainer-tools/blob/master/tools/repos_with_ids.txt -.. branch is "8.0" for example +* Check that each of the previous values for each product line has been set proportionally to the value of the product Known issues / Roadmap ====================== -TODO +* TODO! + +Changelog +========= + + Bug Tracker =========== -Bugs are tracked on `GitHub Issues `_. +Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. -If you spotted it first, help us smashing it by providing a detailed and welcomed feedback `here `_. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. +Do not contact contributors directly about support or help with technical issues. Credits ======= +Authors +~~~~~~~ + +* KMEE + Contributors ------------- +~~~~~~~~~~~~ * Renato Lima +* Diego Paradeda +* Gabriel Cardoso de Faria +* Luis Otavio Malta Conceição -Maintainer ----------- +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. .. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association :target: https://odoo-community.org -This module is maintained by the OCA. - OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -To contribute to this module, please visit http://odoo-community.org. +This module is part of the `OCA/https://github.com/OCA/l10n-brazil `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/l10n_br_delivery/readme/CONFIGURE.rst b/l10n_br_delivery/readme/CONFIGURE.rst new file mode 100644 index 000000000000..307962dcecec --- /dev/null +++ b/l10n_br_delivery/readme/CONFIGURE.rst @@ -0,0 +1 @@ +No additional configuration is required to use this module diff --git a/l10n_br_delivery/readme/CONTRIBUTORS.rst b/l10n_br_delivery/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000000..201c7451ce5a --- /dev/null +++ b/l10n_br_delivery/readme/CONTRIBUTORS.rst @@ -0,0 +1,4 @@ +* Renato Lima +* Diego Paradeda +* Gabriel Cardoso de Faria +* Luis Otavio Malta Conceição diff --git a/l10n_br_delivery/readme/DESCRIPTION.rst b/l10n_br_delivery/readme/DESCRIPTION.rst new file mode 100644 index 000000000000..14ac460b87bf --- /dev/null +++ b/l10n_br_delivery/readme/DESCRIPTION.rst @@ -0,0 +1,3 @@ +This module was written to extend the functionality of delivery to support the +adequacy of Brazilian delivery standards +and allows you to apportion the value of freight, insurance and other costs. diff --git a/l10n_br_delivery/readme/HISTORY.rst b/l10n_br_delivery/readme/HISTORY.rst new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/l10n_br_delivery/readme/HISTORY.rst @@ -0,0 +1 @@ + diff --git a/l10n_br_delivery/readme/INSTALL.rst b/l10n_br_delivery/readme/INSTALL.rst new file mode 100644 index 000000000000..75f244311185 --- /dev/null +++ b/l10n_br_delivery/readme/INSTALL.rst @@ -0,0 +1 @@ +To install this module, you need to do nothing diff --git a/l10n_br_delivery/readme/ROADMAP.rst b/l10n_br_delivery/readme/ROADMAP.rst new file mode 100644 index 000000000000..4d2ece5d5b4b --- /dev/null +++ b/l10n_br_delivery/readme/ROADMAP.rst @@ -0,0 +1 @@ +* TODO! diff --git a/l10n_br_delivery/readme/USAGE.rst b/l10n_br_delivery/readme/USAGE.rst new file mode 100644 index 000000000000..921e19dbfad5 --- /dev/null +++ b/l10n_br_delivery/readme/USAGE.rst @@ -0,0 +1,10 @@ +To use this module, you need to: + +* Create a quote and enter freight, insurance and other costs for each product line +* Check the total values of the quotation being updated according to the sum of the values of the product lines + +Alternatively: + +* Change only the total freight, insurance and other quote costs + +* Check that each of the previous values for each product line has been set proportionally to the value of the product diff --git a/l10n_br_delivery/static/description/index.html b/l10n_br_delivery/static/description/index.html new file mode 100644 index 000000000000..22cd443b4f30 --- /dev/null +++ b/l10n_br_delivery/static/description/index.html @@ -0,0 +1,459 @@ + + + + + + +Brazilian Localization Delivery + + + +
+

Brazilian Localization Delivery

+ + +

Beta License: AGPL-3 OCA/https://github.com/OCA/l10n-brazil Translate me on Weblate

+

This module was written to extend the functionality of delivery to support the +adequacy of Brazilian delivery standards +and allows you to apportion the value of freight, insurance and other costs.

+

Table of contents

+ +
+

Installation

+

To install this module, you need to do nothing

+
+
+

Configuration

+

No additional configuration is required to use this module

+
+
+

Usage

+

To use this module, you need to:

+
    +
  • Create a quote and enter freight, insurance and other costs for each product line
  • +
  • Check the total values of the quotation being updated according to the sum of the values of the product lines
  • +
+

Alternatively:

+
    +
  • Change only the total freight, insurance and other quote costs
  • +
  • Check that each of the previous values for each product line has been set proportionally to the value of the product
  • +
+
+
+

Known issues / Roadmap

+
    +
  • TODO!
  • +
+
+ +
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • KMEE
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/https://github.com/OCA/l10n-brazil project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + From ee71fcc69bc76750017dc20d35a6fc09dea779ab Mon Sep 17 00:00:00 2001 From: Gabriel Cardoso de Faria Date: Wed, 9 Dec 2020 13:41:06 -0300 Subject: [PATCH 111/223] [IMP] Update values on save --- l10n_br_delivery/models/sale_order.py | 33 +++++++++++++++++---------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/l10n_br_delivery/models/sale_order.py b/l10n_br_delivery/models/sale_order.py index a9b394833849..c89d8c6b08cc 100644 --- a/l10n_br_delivery/models/sale_order.py +++ b/l10n_br_delivery/models/sale_order.py @@ -58,14 +58,17 @@ def _inverse_amount_freight(self): for line in record.order_line[:-1]: line.freight_value = amount_freight * ( line.price_total / amount_total) - todo = record.env.all.todo.copy() record.order_line[-1].freight_value = amount_freight - sum( line.freight_value for line in record.order_line[:-1]) - record.env.all.todo = todo for line in record.order_line: - todo = record.env.all.todo.copy() line._onchange_fiscal_taxes() - record.env.all.todo = todo + record._fields['amount_total'].compute_value(record) + record.write({ + name: value + for name, value in record._cache.items() + if record._fields[name].compute == '_amount_all' and + not record._fields[name].inverse + }) @api.multi def _inverse_amount_insurance(self): @@ -87,16 +90,19 @@ def _inverse_amount_insurance(self): for line in record.order_line[:-1]: line.insurance_value = amount_insurance * ( line.price_total / amount_total) - todo = record.env.all.todo.copy() record.order_line[-1].insurance_value = \ amount_insurance - sum( line.insurance_value for line in record.order_line[:-1]) - record.env.all.todo = todo for line in record.order_line: - todo = record.env.all.todo.copy() line._onchange_fiscal_taxes() - record.env.all.todo = todo + record._fields['amount_total'].compute_value(record) + record.write({ + name: value + for name, value in record._cache.items() + if record._fields[name].compute == '_amount_all' and + not record._fields[name].inverse + }) @api.multi def _inverse_amount_costs(self): @@ -115,11 +121,14 @@ def _inverse_amount_costs(self): for line in record.order_line[:-1]: line.other_costs_value = amount_costs * ( line.price_total / amount_total) - todo = record.env.all.todo.copy() record.order_line[-1].other_costs_value = amount_costs - sum( line.other_costs_value for line in record.order_line[:-1]) - record.env.all.todo = todo for line in record.order_line: - todo = record.env.all.todo.copy() line._onchange_fiscal_taxes() - record.env.all.todo = todo + record._fields['amount_total'].compute_value(record) + record.write({ + name: value + for name, value in record._cache.items() + if record._fields[name].compute == '_amount_all' and + not record._fields[name].inverse + }) From 543751c219f1a4f6ecd95f0275712aaaae54bdad Mon Sep 17 00:00:00 2001 From: Luis Malta Date: Wed, 9 Dec 2020 14:26:42 -0300 Subject: [PATCH 112/223] [ADD] l10n_br_delivey tests --- l10n_br_delivery/tests/__init__.py | 1 + .../tests/test_delivery_inverse_amount.py | 136 ++++++++++++++++++ 2 files changed, 137 insertions(+) create mode 100644 l10n_br_delivery/tests/__init__.py create mode 100644 l10n_br_delivery/tests/test_delivery_inverse_amount.py diff --git a/l10n_br_delivery/tests/__init__.py b/l10n_br_delivery/tests/__init__.py new file mode 100644 index 000000000000..0a2155ebaa8f --- /dev/null +++ b/l10n_br_delivery/tests/__init__.py @@ -0,0 +1 @@ +from . import test_delivery_inverse_amount diff --git a/l10n_br_delivery/tests/test_delivery_inverse_amount.py b/l10n_br_delivery/tests/test_delivery_inverse_amount.py new file mode 100644 index 000000000000..8307d575482d --- /dev/null +++ b/l10n_br_delivery/tests/test_delivery_inverse_amount.py @@ -0,0 +1,136 @@ +# @ 2020 KMEE - www.kmee.com.br +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo.tests.common import TransactionCase, Form + + +class TestDeliveryInverseAmount(TransactionCase): + def setUp(self): + super().setUp() + + # Create a new sale order + sale_order_form = Form(self.env['sale.order'], 'sale.view_order_form') + sale_order_form.partner_id = self.env.ref( + 'l10n_br_base.res_partner_kmee') + self.sale_order_id = sale_order_form.save() + + # Set 2 different products to the sale order + with Form(self.sale_order_id) as so: + with so.order_line.new() as line: + line.product_id = self.env.ref('product.product_delivery_01') + with so.order_line.new() as line: + line.product_id = self.env.ref('product.product_delivery_02') + + # Change freight amount, insurance and other costs values + with Form(self.sale_order_id) as so: + so.amount_freight = 100.0 + so.amount_insurance = 100.0 + so.amount_costs = 100.0 + + # Confirm and create invoice for the sale order + self.sale_order_id.action_confirm() + + for move in self.sale_order_id.picking_ids.mapped( + 'move_ids_without_package'): + move.quantity_done = move.product_uom_qty + + for picking in self.sale_order_id.picking_ids.filtered( + lambda p: p.state == 'assigned'): + picking.button_validate() + + wizard = self.env['sale.advance.payment.inv'].with_context( + {'active_ids': self.sale_order_id.ids}).create({}) + + wizard.create_invoices() + + def test_sale_order_amounts(self): + """Check sale order amounts""" + self.assertEqual( + self.sale_order_id.amount_gross, 110.0, + "Unexpected value for the field amount_gross from Sale Order") + self.assertEqual( + self.sale_order_id.amount_untaxed, 110.0, + "Unexpected value for the field amount_untaxed from Sale Order") + self.assertEqual( + self.sale_order_id.amount_freight, 100.0, + "Unexpected value for the field amount_freight from Sale Order") + self.assertEqual( + self.sale_order_id.amount_insurance, 100.0, + "Unexpected value for the field amount_insurance from Sale Order") + self.assertEqual( + self.sale_order_id.amount_costs, 100.0, + "Unexpected value for the field amount_costs from Sale Order") + self.assertEqual( + self.sale_order_id.amount_tax, 0.0, + "Unexpected value for the field amount_tax from Sale Order") + + def test_invoice_amount_tax(self): + """Check invoice amount tax""" + invoice_tax = self.sale_order_id.invoice_ids[0].amount_tax + + self.assertEqual( + invoice_tax, 300, + "Unexpected value for the field invoice_tax from Invoice") + + def test_inverse_amount_freight(self): + """Check Fiscal Document freight values""" + fiscal_document_id = \ + self.sale_order_id.invoice_ids[0].fiscal_document_id + self.assertEqual( + fiscal_document_id.amount_freight_value, 100, + "Unexpected value for the field amount_freight_value from " + "Fiscal Document") + + for line in fiscal_document_id.line_ids: + if line.name == '[FURN_7777] Office Chair': + self.assertEqual( + line.freight_value, 63.64, + "Unexpected value for the field freight_value from " + "Fiscal Document line") + if line.name == '[FURN_8888] Office Lamp': + self.assertEqual( + line.freight_value, 36.36, + "Unexpected value for the field freight_value from " + "Fiscal Document line") + + def test_inverse_amount_insurance(self): + """Check Fiscal Document insurance values""" + fiscal_document_id = \ + self.sale_order_id.invoice_ids[0].fiscal_document_id + self.assertEqual( + fiscal_document_id.amount_insurance_value, 100, + "Unexpected value for the field amount_insurance_value from " + "Fiscal Document") + + for line in fiscal_document_id.line_ids: + if line.name == '[FURN_7777] Office Chair': + self.assertEqual( + line.insurance_value, 63.64, + "Unexpected value for the field insurance_value from " + "Fiscal Document line") + if line.name == '[FURN_8888] Office Lamp': + self.assertEqual( + line.insurance_value, 36.36, + "Unexpected value for the field insurance_value from " + "Fiscal Document line") + + def test_inverse_amount_other_costs(self): + """Check Fiscal Document other costs values""" + fiscal_document_id = \ + self.sale_order_id.invoice_ids[0].fiscal_document_id + self.assertEqual( + fiscal_document_id.amount_other_costs_value, 100, + "Unexpected value for the field other_costs_value from " + "Fiscal Document") + + for line in fiscal_document_id.line_ids: + if line.name == '[FURN_7777] Office Chair': + self.assertEqual( + line.other_costs_value, 63.64, + "Unexpected value for the field other_costs_value from " + "Fiscal Document line") + if line.name == '[FURN_8888] Office Lamp': + self.assertEqual( + line.other_costs_value, 36.36, + "Unexpected value for the field other_costs_value from " + "Fiscal Document line") From 9c402aec852a9bcd4a76b0f9eb24a9e22678d88c Mon Sep 17 00:00:00 2001 From: Luis Malta Date: Wed, 9 Dec 2020 14:27:12 -0300 Subject: [PATCH 113/223] [FIX] amount_insurance and amount_costs readonly --- l10n_br_delivery/models/sale_order.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/l10n_br_delivery/models/sale_order.py b/l10n_br_delivery/models/sale_order.py index c89d8c6b08cc..ce232b284251 100644 --- a/l10n_br_delivery/models/sale_order.py +++ b/l10n_br_delivery/models/sale_order.py @@ -15,9 +15,11 @@ class SaleOrder(models.Model): amount_insurance = fields.Float( inverse='_inverse_amount_insurance', + readonly=False, ) amount_costs = fields.Float( inverse='_inverse_amount_costs', + readonly=False, ) @api.multi From d25f4c78af2e46cfae5d74e1f015527f8b37aa20 Mon Sep 17 00:00:00 2001 From: Luis Malta Date: Thu, 10 Dec 2020 07:43:00 -0300 Subject: [PATCH 114/223] [FIX] Picking state on test --- l10n_br_delivery/tests/test_delivery_inverse_amount.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_delivery/tests/test_delivery_inverse_amount.py b/l10n_br_delivery/tests/test_delivery_inverse_amount.py index 8307d575482d..2970d1face30 100644 --- a/l10n_br_delivery/tests/test_delivery_inverse_amount.py +++ b/l10n_br_delivery/tests/test_delivery_inverse_amount.py @@ -35,7 +35,7 @@ def setUp(self): move.quantity_done = move.product_uom_qty for picking in self.sale_order_id.picking_ids.filtered( - lambda p: p.state == 'assigned'): + lambda p: p.state == 'confirmed'): picking.button_validate() wizard = self.env['sale.advance.payment.inv'].with_context( From 19c511201afe9dd2f88920fad6c8e5f0098bf2cb Mon Sep 17 00:00:00 2001 From: Luis Malta Date: Thu, 10 Dec 2020 13:01:01 -0300 Subject: [PATCH 115/223] [IMP] New test cases --- .../tests/test_delivery_inverse_amount.py | 199 ++++++++++++++---- 1 file changed, 163 insertions(+), 36 deletions(-) diff --git a/l10n_br_delivery/tests/test_delivery_inverse_amount.py b/l10n_br_delivery/tests/test_delivery_inverse_amount.py index 2970d1face30..5043a5122cb2 100644 --- a/l10n_br_delivery/tests/test_delivery_inverse_amount.py +++ b/l10n_br_delivery/tests/test_delivery_inverse_amount.py @@ -1,81 +1,145 @@ # @ 2020 KMEE - www.kmee.com.br # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from odoo.tests.common import TransactionCase, Form +from odoo.tests.common import SavepointCase, Form -class TestDeliveryInverseAmount(TransactionCase): +class TestDeliveryInverseAmount(SavepointCase): def setUp(self): super().setUp() - # Create a new sale order - sale_order_form = Form(self.env['sale.order'], 'sale.view_order_form') - sale_order_form.partner_id = self.env.ref( + # Create two sale orders + sale_order_form_total = Form(self.env['sale.order'], 'sale.view_order_form') + sale_order_form_total.partner_id = self.env.ref( 'l10n_br_base.res_partner_kmee') - self.sale_order_id = sale_order_form.save() + self.sale_order_total_id = sale_order_form_total.save() - # Set 2 different products to the sale order - with Form(self.sale_order_id) as so: + sale_order_form_line = Form(self.env['sale.order'], 'sale.view_order_form') + sale_order_form_line.partner_id = self.env.ref( + 'l10n_br_base.res_partner_kmee') + self.sale_order_line_id = sale_order_form_line.save() + + # Set 2 different products to the sale orders + with Form(self.sale_order_total_id) as so: + with so.order_line.new() as line: + line.product_id = self.env.ref('product.product_delivery_01') + with so.order_line.new() as line: + line.product_id = self.env.ref('product.product_delivery_02') + + with Form(self.sale_order_line_id) as so: with so.order_line.new() as line: line.product_id = self.env.ref('product.product_delivery_01') with so.order_line.new() as line: line.product_id = self.env.ref('product.product_delivery_02') - # Change freight amount, insurance and other costs values - with Form(self.sale_order_id) as so: + # Change freight, insurance and other costs amount from + # sale_order_total_id + with Form(self.sale_order_total_id) as so: so.amount_freight = 100.0 so.amount_insurance = 100.0 so.amount_costs = 100.0 - # Confirm and create invoice for the sale order - self.sale_order_id.action_confirm() + # Change freight, insurance and other costs amount from + # sale_order_lines_id lines + with Form(self.sale_order_line_id) as so: + with so.order_line.edit(0) as line: + line.freight_value = 80.00 + line.insurance_value = 80.00 + line.other_costs_value = 80.00 + with so.order_line.edit(1) as line: + line.freight_value = 20.00 + line.insurance_value = 20.00 + line.other_costs_value = 20.00 + + # Confirm and create invoices for the sale orders + self.sale_order_total_id.action_confirm() + self.sale_order_line_id.action_confirm() + + for move in self.sale_order_total_id.picking_ids.mapped( + 'move_ids_without_package'): + move.quantity_done = move.product_uom_qty - for move in self.sale_order_id.picking_ids.mapped( + for move in self.sale_order_line_id.picking_ids.mapped( 'move_ids_without_package'): move.quantity_done = move.product_uom_qty - for picking in self.sale_order_id.picking_ids.filtered( + for picking in self.sale_order_total_id.picking_ids.filtered( lambda p: p.state == 'confirmed'): picking.button_validate() - wizard = self.env['sale.advance.payment.inv'].with_context( - {'active_ids': self.sale_order_id.ids}).create({}) + for picking in self.sale_order_line_id.picking_ids.filtered( + lambda p: p.state == 'confirmed'): + picking.button_validate() + + wizard_total = self.env['sale.advance.payment.inv'].with_context( + {'active_ids': self.sale_order_total_id.ids}).create({}) + + wizard_line = self.env['sale.advance.payment.inv'].with_context( + {'active_ids': self.sale_order_line_id.ids}).create({}) - wizard.create_invoices() + wizard_total.create_invoices() + wizard_line.create_invoices() + + def test_sale_order_total_amounts(self): + """Check sale order total amounts""" + self.assertEqual( + self.sale_order_total_id.amount_gross, 110.0, + "Unexpected value for the field amount_gross from Sale Order") + self.assertEqual( + self.sale_order_total_id.amount_untaxed, 110.0, + "Unexpected value for the field amount_untaxed from Sale Order") + self.assertEqual( + self.sale_order_total_id.amount_freight, 100.0, + "Unexpected value for the field amount_freight from Sale Order") + self.assertEqual( + self.sale_order_total_id.amount_insurance, 100.0, + "Unexpected value for the field amount_insurance from Sale Order") + self.assertEqual( + self.sale_order_total_id.amount_costs, 100.0, + "Unexpected value for the field amount_costs from Sale Order") + self.assertEqual( + self.sale_order_total_id.amount_tax, 0.0, + "Unexpected value for the field amount_tax from Sale Order") - def test_sale_order_amounts(self): - """Check sale order amounts""" + def test_sale_order_line_amounts(self): + """Check sale order line amounts""" self.assertEqual( - self.sale_order_id.amount_gross, 110.0, + self.sale_order_line_id.amount_gross, 110.0, "Unexpected value for the field amount_gross from Sale Order") self.assertEqual( - self.sale_order_id.amount_untaxed, 110.0, + self.sale_order_line_id.amount_untaxed, 110.0, "Unexpected value for the field amount_untaxed from Sale Order") self.assertEqual( - self.sale_order_id.amount_freight, 100.0, + self.sale_order_line_id.amount_freight, 100.0, "Unexpected value for the field amount_freight from Sale Order") self.assertEqual( - self.sale_order_id.amount_insurance, 100.0, + self.sale_order_line_id.amount_insurance, 100.0, "Unexpected value for the field amount_insurance from Sale Order") self.assertEqual( - self.sale_order_id.amount_costs, 100.0, + self.sale_order_line_id.amount_costs, 100.0, "Unexpected value for the field amount_costs from Sale Order") self.assertEqual( - self.sale_order_id.amount_tax, 0.0, + self.sale_order_line_id.amount_tax, 0.0, "Unexpected value for the field amount_tax from Sale Order") def test_invoice_amount_tax(self): """Check invoice amount tax""" - invoice_tax = self.sale_order_id.invoice_ids[0].amount_tax + invoice_tax_total = self.sale_order_total_id.invoice_ids[0].amount_tax + + self.assertEqual( + invoice_tax_total, 300, + "Unexpected value for the field invoice_tax from Invoice") + + invoice_tax_line = self.sale_order_line_id.invoice_ids[0].amount_tax self.assertEqual( - invoice_tax, 300, + invoice_tax_line, 300, "Unexpected value for the field invoice_tax from Invoice") - def test_inverse_amount_freight(self): - """Check Fiscal Document freight values""" + def test_inverse_amount_freight_total(self): + """Check Fiscal Document freight values for total""" fiscal_document_id = \ - self.sale_order_id.invoice_ids[0].fiscal_document_id + self.sale_order_total_id.invoice_ids[0].fiscal_document_id self.assertEqual( fiscal_document_id.amount_freight_value, 100, "Unexpected value for the field amount_freight_value from " @@ -93,10 +157,31 @@ def test_inverse_amount_freight(self): "Unexpected value for the field freight_value from " "Fiscal Document line") - def test_inverse_amount_insurance(self): - """Check Fiscal Document insurance values""" + def test_inverse_amount_freight_line(self): + """Check Fiscal Document freight values for lines""" + fiscal_document_id = \ + self.sale_order_line_id.invoice_ids[0].fiscal_document_id + self.assertEqual( + fiscal_document_id.amount_freight_value, 100, + "Unexpected value for the field amount_freight_value from " + "Fiscal Document") + + for line in fiscal_document_id.line_ids: + if line.name == '[FURN_7777] Office Chair': + self.assertEqual( + line.freight_value, 80, + "Unexpected value for the field freight_value from " + "Fiscal Document line") + if line.name == '[FURN_8888] Office Lamp': + self.assertEqual( + line.freight_value, 20, + "Unexpected value for the field freight_value from " + "Fiscal Document line") + + def test_inverse_amount_insurance_total(self): + """Check Fiscal Document insurance values for total""" fiscal_document_id = \ - self.sale_order_id.invoice_ids[0].fiscal_document_id + self.sale_order_total_id.invoice_ids[0].fiscal_document_id self.assertEqual( fiscal_document_id.amount_insurance_value, 100, "Unexpected value for the field amount_insurance_value from " @@ -114,10 +199,31 @@ def test_inverse_amount_insurance(self): "Unexpected value for the field insurance_value from " "Fiscal Document line") - def test_inverse_amount_other_costs(self): - """Check Fiscal Document other costs values""" + def test_inverse_amount_insurance_line(self): + """Check Fiscal Document insurance values for lines""" + fiscal_document_id = \ + self.sale_order_line_id.invoice_ids[0].fiscal_document_id + self.assertEqual( + fiscal_document_id.amount_insurance_value, 100, + "Unexpected value for the field amount_insurance_value from " + "Fiscal Document") + + for line in fiscal_document_id.line_ids: + if line.name == '[FURN_7777] Office Chair': + self.assertEqual( + line.insurance_value, 80, + "Unexpected value for the field insurance_value from " + "Fiscal Document line") + if line.name == '[FURN_8888] Office Lamp': + self.assertEqual( + line.insurance_value, 20, + "Unexpected value for the field insurance_value from " + "Fiscal Document line") + + def test_inverse_amount_other_costs_total(self): + """Check Fiscal Document other costs values for total""" fiscal_document_id = \ - self.sale_order_id.invoice_ids[0].fiscal_document_id + self.sale_order_total_id.invoice_ids[0].fiscal_document_id self.assertEqual( fiscal_document_id.amount_other_costs_value, 100, "Unexpected value for the field other_costs_value from " @@ -134,3 +240,24 @@ def test_inverse_amount_other_costs(self): line.other_costs_value, 36.36, "Unexpected value for the field other_costs_value from " "Fiscal Document line") + + def test_inverse_amount_other_costs_line(self): + """Check Fiscal Document other costs values for lines""" + fiscal_document_id = \ + self.sale_order_line_id.invoice_ids[0].fiscal_document_id + self.assertEqual( + fiscal_document_id.amount_other_costs_value, 100, + "Unexpected value for the field other_costs_value from " + "Fiscal Document") + + for line in fiscal_document_id.line_ids: + if line.name == '[FURN_7777] Office Chair': + self.assertEqual( + line.other_costs_value, 80, + "Unexpected value for the field other_costs_value from " + "Fiscal Document line") + if line.name == '[FURN_8888] Office Lamp': + self.assertEqual( + line.other_costs_value, 20, + "Unexpected value for the field other_costs_value from " + "Fiscal Document line") From a302f09d1df41e730d009415a28aaf3d0031eca4 Mon Sep 17 00:00:00 2001 From: Luis Malta Date: Thu, 10 Dec 2020 16:09:13 -0300 Subject: [PATCH 116/223] [IMP] l10n_br_delivery test cases and performance --- .../tests/test_delivery_inverse_amount.py | 124 ++++++++++++++++-- 1 file changed, 110 insertions(+), 14 deletions(-) diff --git a/l10n_br_delivery/tests/test_delivery_inverse_amount.py b/l10n_br_delivery/tests/test_delivery_inverse_amount.py index 5043a5122cb2..e87e6903ec5a 100644 --- a/l10n_br_delivery/tests/test_delivery_inverse_amount.py +++ b/l10n_br_delivery/tests/test_delivery_inverse_amount.py @@ -5,8 +5,9 @@ class TestDeliveryInverseAmount(SavepointCase): - def setUp(self): - super().setUp() + @classmethod + def setUpClass(self): + super(TestDeliveryInverseAmount, self).setUpClass() # Create two sale orders sale_order_form_total = Form(self.env['sale.order'], 'sale.view_order_form') @@ -43,13 +44,18 @@ def setUp(self): # sale_order_lines_id lines with Form(self.sale_order_line_id) as so: with so.order_line.edit(0) as line: - line.freight_value = 80.00 - line.insurance_value = 80.00 - line.other_costs_value = 80.00 + line.freight_value = 70.00 + line.insurance_value = 70.00 + line.other_costs_value = 70.00 with so.order_line.edit(1) as line: - line.freight_value = 20.00 - line.insurance_value = 20.00 - line.other_costs_value = 20.00 + line.freight_value = 10.00 + line.insurance_value = 10.00 + line.other_costs_value = 10.00 + + with Form(self.sale_order_line_id) as so: + so.amount_freight = 100.0 + so.amount_insurance = 100.0 + so.amount_costs = 100.0 # Confirm and create invoices for the sale orders self.sale_order_total_id.action_confirm() @@ -157,6 +163,21 @@ def test_inverse_amount_freight_total(self): "Unexpected value for the field freight_value from " "Fiscal Document line") + with Form(fiscal_document_id) as doc: + doc.amount_freight_value = 10.0 + + for line in fiscal_document_id.line_ids: + if line.name == '[FURN_7777] Office Chair': + self.assertEqual( + line.freight_value, 6.36, + "Unexpected value for the field freight_value from " + "Fiscal Document line") + if line.name == '[FURN_8888] Office Lamp': + self.assertEqual( + line.freight_value, 3.64, + "Unexpected value for the field freight_value from " + "Fiscal Document line") + def test_inverse_amount_freight_line(self): """Check Fiscal Document freight values for lines""" fiscal_document_id = \ @@ -169,12 +190,27 @@ def test_inverse_amount_freight_line(self): for line in fiscal_document_id.line_ids: if line.name == '[FURN_7777] Office Chair': self.assertEqual( - line.freight_value, 80, + line.freight_value, 87.5, + "Unexpected value for the field freight_value from " + "Fiscal Document line") + if line.name == '[FURN_8888] Office Lamp': + self.assertEqual( + line.freight_value, 12.5, + "Unexpected value for the field freight_value from " + "Fiscal Document line") + + with Form(fiscal_document_id) as doc: + doc.amount_freight_value = 10.0 + + for line in fiscal_document_id.line_ids: + if line.name == '[FURN_7777] Office Chair': + self.assertEqual( + line.freight_value, 8.75, "Unexpected value for the field freight_value from " "Fiscal Document line") if line.name == '[FURN_8888] Office Lamp': self.assertEqual( - line.freight_value, 20, + line.freight_value, 1.25, "Unexpected value for the field freight_value from " "Fiscal Document line") @@ -199,6 +235,21 @@ def test_inverse_amount_insurance_total(self): "Unexpected value for the field insurance_value from " "Fiscal Document line") + with Form(fiscal_document_id) as doc: + doc.amount_insurance_value = 10.0 + + for line in fiscal_document_id.line_ids: + if line.name == '[FURN_7777] Office Chair': + self.assertEqual( + line.insurance_value, 6.36, + "Unexpected value for the field insurance_value from " + "Fiscal Document line") + if line.name == '[FURN_8888] Office Lamp': + self.assertEqual( + line.insurance_value, 3.64, + "Unexpected value for the field insurance_value from " + "Fiscal Document line") + def test_inverse_amount_insurance_line(self): """Check Fiscal Document insurance values for lines""" fiscal_document_id = \ @@ -211,12 +262,27 @@ def test_inverse_amount_insurance_line(self): for line in fiscal_document_id.line_ids: if line.name == '[FURN_7777] Office Chair': self.assertEqual( - line.insurance_value, 80, + line.insurance_value, 87.5, + "Unexpected value for the field insurance_value from " + "Fiscal Document line") + if line.name == '[FURN_8888] Office Lamp': + self.assertEqual( + line.insurance_value, 12.5, + "Unexpected value for the field insurance_value from " + "Fiscal Document line") + + with Form(fiscal_document_id) as doc: + doc.amount_insurance_value = 10.0 + + for line in fiscal_document_id.line_ids: + if line.name == '[FURN_7777] Office Chair': + self.assertEqual( + line.insurance_value, 8.75, "Unexpected value for the field insurance_value from " "Fiscal Document line") if line.name == '[FURN_8888] Office Lamp': self.assertEqual( - line.insurance_value, 20, + line.insurance_value, 1.25, "Unexpected value for the field insurance_value from " "Fiscal Document line") @@ -241,6 +307,21 @@ def test_inverse_amount_other_costs_total(self): "Unexpected value for the field other_costs_value from " "Fiscal Document line") + with Form(fiscal_document_id) as doc: + doc.amount_other_costs_value = 10.0 + + for line in fiscal_document_id.line_ids: + if line.name == '[FURN_7777] Office Chair': + self.assertEqual( + line.other_costs_value, 6.36, + "Unexpected value for the field other_costs_value from " + "Fiscal Document line") + if line.name == '[FURN_8888] Office Lamp': + self.assertEqual( + line.other_costs_value, 3.64, + "Unexpected value for the field other_costs_value from " + "Fiscal Document line") + def test_inverse_amount_other_costs_line(self): """Check Fiscal Document other costs values for lines""" fiscal_document_id = \ @@ -253,11 +334,26 @@ def test_inverse_amount_other_costs_line(self): for line in fiscal_document_id.line_ids: if line.name == '[FURN_7777] Office Chair': self.assertEqual( - line.other_costs_value, 80, + line.other_costs_value, 87.5, + "Unexpected value for the field other_costs_value from " + "Fiscal Document line") + if line.name == '[FURN_8888] Office Lamp': + self.assertEqual( + line.other_costs_value, 12.5, + "Unexpected value for the field other_costs_value from " + "Fiscal Document line") + + with Form(fiscal_document_id) as doc: + doc.amount_other_costs_value = 10.0 + + for line in fiscal_document_id.line_ids: + if line.name == '[FURN_7777] Office Chair': + self.assertEqual( + line.other_costs_value, 8.75, "Unexpected value for the field other_costs_value from " "Fiscal Document line") if line.name == '[FURN_8888] Office Lamp': self.assertEqual( - line.other_costs_value, 20, + line.other_costs_value, 1.25, "Unexpected value for the field other_costs_value from " "Fiscal Document line") From bb2dc5d93db86b471c22711a2922a607915b31f8 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Mon, 14 Dec 2020 11:01:39 +0000 Subject: [PATCH 117/223] [UPD] Update l10n_br_delivery.pot --- l10n_br_delivery/i18n/l10n_br_delivery.pot | 77 ++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 l10n_br_delivery/i18n/l10n_br_delivery.pot diff --git a/l10n_br_delivery/i18n/l10n_br_delivery.pot b/l10n_br_delivery/i18n/l10n_br_delivery.pot new file mode 100644 index 000000000000..1dfe4a5b6f66 --- /dev/null +++ b/l10n_br_delivery/i18n/l10n_br_delivery.pot @@ -0,0 +1,77 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * l10n_br_delivery +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: l10n_br_delivery +#: model:ir.model,name:l10n_br_delivery.model_l10n_br_fiscal_document +msgid "Fiscal Document" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__amount_freight +msgid "Freight" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_invoice__amount_freight_value +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__amount_freight_value +msgid "Freight Value" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__amount_insurance +msgid "Insurance" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_invoice__amount_insurance_value +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__amount_insurance_value +msgid "Insurance Value" +msgstr "" + +#. module: l10n_br_delivery +#: code:addons/l10n_br_delivery/models/sale_order.py:36 +#, python-format +msgid "No carrier set for this order." +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_invoice__amount_other_costs_value +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__amount_other_costs_value +#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__amount_costs +msgid "Other Costs" +msgstr "" + +#. module: l10n_br_delivery +#: code:addons/l10n_br_delivery/models/sale_order.py:38 +#, python-format +msgid "Please use \"Check price\" in order to compute a shipping price for this quotation." +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model,name:l10n_br_delivery.model_sale_order +msgid "Sale Order" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model,name:l10n_br_delivery.model_stock_picking +msgid "Transfer" +msgstr "" + +#. module: l10n_br_delivery +#: code:addons/l10n_br_delivery/models/sale_order.py:32 +#, python-format +msgid "You can add delivery price only on unconfirmed quotations." +msgstr "" + From 06fbff47afdd85c7de2f6523c7a74a22287e7033 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Mon, 14 Dec 2020 11:21:06 +0000 Subject: [PATCH 118/223] [UPD] README.rst --- l10n_br_delivery/README.rst | 19 +++++++++++-------- .../static/description/index.html | 8 ++++---- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/l10n_br_delivery/README.rst b/l10n_br_delivery/README.rst index 9b32d5454351..5d979fac0f60 100644 --- a/l10n_br_delivery/README.rst +++ b/l10n_br_delivery/README.rst @@ -13,14 +13,17 @@ Brazilian Localization Delivery .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 -.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fhttps://github.com/OCA/l10n--brazil-lightgray.png?logo=github - :target: https://github.com/OCA/https://github.com/OCA/l10n-brazil/tree/12.0/l10n_br_delivery - :alt: OCA/https://github.com/OCA/l10n-brazil +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--brazil-lightgray.png?logo=github + :target: https://github.com/OCA/l10n-brazil/tree/12.0/l10n_br_delivery + :alt: OCA/l10n-brazil .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/https://github.com/OCA/l10n-brazil-12-0/https://github.com/OCA/l10n-brazil-12-0-l10n_br_delivery + :target: https://translation.odoo-community.org/projects/l10n-brazil-12-0/l10n-brazil-12-0-l10n_br_delivery :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/124/12.0 + :alt: Try me on Runbot -|badge1| |badge2| |badge3| |badge4| +|badge1| |badge2| |badge3| |badge4| |badge5| This module was written to extend the functionality of delivery to support the adequacy of Brazilian delivery standards @@ -68,10 +71,10 @@ Changelog Bug Tracker =========== -Bugs are tracked on `GitHub Issues `_. +Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -104,6 +107,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/https://github.com/OCA/l10n-brazil `_ project on GitHub. +This module is part of the `OCA/l10n-brazil `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/l10n_br_delivery/static/description/index.html b/l10n_br_delivery/static/description/index.html index 22cd443b4f30..facdc3b68626 100644 --- a/l10n_br_delivery/static/description/index.html +++ b/l10n_br_delivery/static/description/index.html @@ -367,7 +367,7 @@

Brazilian Localization Delivery

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/https://github.com/OCA/l10n-brazil Translate me on Weblate

+

Beta License: AGPL-3 OCA/l10n-brazil Translate me on Weblate Try me on Runbot

This module was written to extend the functionality of delivery to support the adequacy of Brazilian delivery standards and allows you to apportion the value of freight, insurance and other costs.

@@ -420,10 +420,10 @@

Changelog

Bug Tracker

-

Bugs are tracked on GitHub Issues. +

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -450,7 +450,7 @@

Maintainers

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

-

This module is part of the OCA/https://github.com/OCA/l10n-brazil project on GitHub.

+

This module is part of the OCA/l10n-brazil project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

From 006cfb7eaf5534ac9158c3fe5808d8513a786762 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Mon, 14 Dec 2020 11:21:06 +0000 Subject: [PATCH 119/223] [ADD] icon.png --- l10n_br_delivery/static/description/icon.png | Bin 0 -> 9455 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 l10n_br_delivery/static/description/icon.png diff --git a/l10n_br_delivery/static/description/icon.png b/l10n_br_delivery/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d GIT binary patch literal 9455 zcmW++2RxMjAAjx~&dlBk9S+%}OXg)AGE&Cb*&}d0jUxM@u(PQx^-s)697TX`ehR4?GS^qbkof1cslKgkU)h65qZ9Oc=ml_0temigYLJfnz{IDzUf>bGs4N!v3=Z3jMq&A#7%rM5eQ#dc?k~! zVpnB`o+K7|Al`Q_U;eD$B zfJtP*jH`siUq~{KE)`jP2|#TUEFGRryE2`i0**z#*^6~AI|YzIWy$Cu#CSLW3q=GA z6`?GZymC;dCPk~rBS%eCb`5OLr;RUZ;D`}um=H)BfVIq%7VhiMr)_#G0N#zrNH|__ zc+blN2UAB0=617@>_u;MPHN;P;N#YoE=)R#i$k_`UAA>WWCcEVMh~L_ zj--gtp&|K1#58Yz*AHCTMziU1Jzt_jG0I@qAOHsk$2}yTmVkBp_eHuY$A9)>P6o~I z%aQ?!(GqeQ-Y+b0I(m9pwgi(IIZZzsbMv+9w{PFtd_<_(LA~0H(xz{=FhLB@(1&qHA5EJw1>>=%q2f&^X>IQ{!GJ4e9U z&KlB)z(84HmNgm2hg2C0>WM{E(DdPr+EeU_N@57;PC2&DmGFW_9kP&%?X4}+xWi)( z;)z%wI5>D4a*5XwD)P--sPkoY(a~WBw;E~AW`Yue4kFa^LM3X`8x|}ZUeMnqr}>kH zG%WWW>3ml$Yez?i%)2pbKPI7?5o?hydokgQyZsNEr{a|mLdt;X2TX(#B1j35xPnPW z*bMSSOauW>o;*=kO8ojw91VX!qoOQb)zHJ!odWB}d+*K?#sY_jqPdg{Sm2HdYzdEx zOGVPhVRTGPtv0o}RfVP;Nd(|CB)I;*t&QO8h zFfekr30S!-LHmV_Su-W+rEwYXJ^;6&3|L$mMC8*bQptyOo9;>Qb9Q9`ySe3%V$A*9 zeKEe+b0{#KWGp$F+tga)0RtI)nhMa-K@JS}2krK~n8vJ=Ngm?R!9G<~RyuU0d?nz# z-5EK$o(!F?hmX*2Yt6+coY`6jGbb7tF#6nHA zuKk=GGJ;ZwON1iAfG$E#Y7MnZVmrY|j0eVI(DN_MNFJmyZ|;w4tf@=CCDZ#5N_0K= z$;R~bbk?}TpfDjfB&aiQ$VA}s?P}xPERJG{kxk5~R`iRS(SK5d+Xs9swCozZISbnS zk!)I0>t=A<-^z(cmSFz3=jZ23u13X><0b)P)^1T_))Kr`e!-pb#q&J*Q`p+B6la%C zuVl&0duN<;uOsB3%T9Fp8t{ED108<+W(nOZd?gDnfNBC3>M8WE61$So|P zVvqH0SNtDTcsUdzaMDpT=Ty0pDHHNL@Z0w$Y`XO z2M-_r1S+GaH%pz#Uy0*w$Vdl=X=rQXEzO}d6J^R6zjM1u&c9vYLvLp?W7w(?np9x1 zE_0JSAJCPB%i7p*Wvg)pn5T`8k3-uR?*NT|J`eS#_#54p>!p(mLDvmc-3o0mX*mp_ zN*AeS<>#^-{S%W<*mz^!X$w_2dHWpcJ6^j64qFBft-o}o_Vx80o0>}Du;>kLts;$8 zC`7q$QI(dKYG`Wa8#wl@V4jVWBRGQ@1dr-hstpQL)Tl+aqVpGpbSfN>5i&QMXfiZ> zaA?T1VGe?rpQ@;+pkrVdd{klI&jVS@I5_iz!=UMpTsa~mBga?1r}aRBm1WS;TT*s0f0lY=JBl66Upy)-k4J}lh=P^8(SXk~0xW=T9v*B|gzIhN z>qsO7dFd~mgxAy4V?&)=5ieYq?zi?ZEoj)&2o)RLy=@hbCRcfT5jigwtQGE{L*8<@Yd{zg;CsL5mvzfDY}P-wos_6PfprFVaeqNE%h zKZhLtcQld;ZD+>=nqN~>GvROfueSzJD&BE*}XfU|H&(FssBqY=hPCt`d zH?@s2>I(|;fcW&YM6#V#!kUIP8$Nkdh0A(bEVj``-AAyYgwY~jB zT|I7Bf@%;7aL7Wf4dZ%VqF$eiaC38OV6oy3Z#TER2G+fOCd9Iaoy6aLYbPTN{XRPz z;U!V|vBf%H!}52L2gH_+j;`bTcQRXB+y9onc^wLm5wi3-Be}U>k_u>2Eg$=k!(l@I zcCg+flakT2Nej3i0yn+g+}%NYb?ta;R?(g5SnwsQ49U8Wng8d|{B+lyRcEDvR3+`O{zfmrmvFrL6acVP%yG98X zo&+VBg@px@i)%o?dG(`T;n*$S5*rnyiR#=wW}}GsAcfyQpE|>a{=$Hjg=-*_K;UtD z#z-)AXwSRY?OPefw^iI+ z)AXz#PfEjlwTes|_{sB?4(O@fg0AJ^g8gP}ex9Ucf*@_^J(s_5jJV}c)s$`Myn|Kd z$6>}#q^n{4vN@+Os$m7KV+`}c%4)4pv@06af4-x5#wj!KKb%caK{A&Y#Rfs z-po?Dcb1({W=6FKIUirH&(yg=*6aLCekcKwyfK^JN5{wcA3nhO(o}SK#!CINhI`-I z1)6&n7O&ZmyFMuNwvEic#IiOAwNkR=u5it{B9n2sAJV5pNhar=j5`*N!Na;c7g!l$ z3aYBqUkqqTJ=Re-;)s!EOeij=7SQZ3Hq}ZRds%IM*PtM$wV z@;rlc*NRK7i3y5BETSKuumEN`Xu_8GP1Ri=OKQ$@I^ko8>H6)4rjiG5{VBM>B|%`&&s^)jS|-_95&yc=GqjNo{zFkw%%HHhS~e=s zD#sfS+-?*t|J!+ozP6KvtOl!R)@@-z24}`9{QaVLD^9VCSR2b`b!KC#o;Ki<+wXB6 zx3&O0LOWcg4&rv4QG0)4yb}7BFSEg~=IR5#ZRj8kg}dS7_V&^%#Do==#`u zpy6{ox?jWuR(;pg+f@mT>#HGWHAJRRDDDv~@(IDw&R>9643kK#HN`!1vBJHnC+RM&yIh8{gG2q zA%e*U3|N0XSRa~oX-3EAneep)@{h2vvd3Xvy$7og(sayr@95+e6~Xvi1tUqnIxoIH zVWo*OwYElb#uyW{Imam6f2rGbjR!Y3`#gPqkv57dB6K^wRGxc9B(t|aYDGS=m$&S!NmCtrMMaUg(c zc2qC=2Z`EEFMW-me5B)24AqF*bV5Dr-M5ig(l-WPS%CgaPzs6p_gnCIvTJ=Y<6!gT zVt@AfYCzjjsMEGi=rDQHo0yc;HqoRNnNFeWZgcm?f;cp(6CNylj36DoL(?TS7eU#+ z7&mfr#y))+CJOXQKUMZ7QIdS9@#-}7y2K1{8)cCt0~-X0O!O?Qx#E4Og+;A2SjalQ zs7r?qn0H044=sDN$SRG$arw~n=+T_DNdSrarmu)V6@|?1-ZB#hRn`uilTGPJ@fqEy zGt(f0B+^JDP&f=r{#Y_wi#AVDf-y!RIXU^0jXsFpf>=Ji*TeqSY!H~AMbJdCGLhC) zn7Rx+sXw6uYj;WRYrLd^5IZq@6JI1C^YkgnedZEYy<&4(z%Q$5yv#Boo{AH8n$a zhb4Y3PWdr269&?V%uI$xMcUrMzl=;w<_nm*qr=c3Rl@i5wWB;e-`t7D&c-mcQl7x! zZWB`UGcw=Y2=}~wzrfLx=uet<;m3~=8I~ZRuzvMQUQdr+yTV|ATf1Uuomr__nDf=X zZ3WYJtHp_ri(}SQAPjv+Y+0=fH4krOP@S&=zZ-t1jW1o@}z;xk8 z(Nz1co&El^HK^NrhVHa-_;&88vTU>_J33=%{if;BEY*J#1n59=07jrGQ#IP>@u#3A z;!q+E1Rj3ZJ+!4bq9F8PXJ@yMgZL;>&gYA0%_Kbi8?S=XGM~dnQZQ!yBSgcZhY96H zrWnU;k)qy`rX&&xlDyA%(a1Hhi5CWkmg(`Gb%m(HKi-7Z!LKGRP_B8@`7&hdDy5n= z`OIxqxiVfX@OX1p(mQu>0Ai*v_cTMiw4qRt3~NBvr9oBy0)r>w3p~V0SCm=An6@3n)>@z!|o-$HvDK z|3D2ZMJkLE5loMKl6R^ez@Zz%S$&mbeoqH5`Bb){Ei21q&VP)hWS2tjShfFtGE+$z zzCR$P#uktu+#!w)cX!lWN1XU%K-r=s{|j?)Akf@q#3b#{6cZCuJ~gCxuMXRmI$nGtnH+-h z+GEi!*X=AP<|fG`1>MBdTb?28JYc=fGvAi2I<$B(rs$;eoJCyR6_bc~p!XR@O-+sD z=eH`-ye})I5ic1eL~TDmtfJ|8`0VJ*Yr=hNCd)G1p2MMz4C3^Mj?7;!w|Ly%JqmuW zlIEW^Ft%z?*|fpXda>Jr^1noFZEwFgVV%|*XhH@acv8rdGxeEX{M$(vG{Zw+x(ei@ zmfXb22}8-?Fi`vo-YVrTH*C?a8%M=Hv9MqVH7H^J$KsD?>!SFZ;ZsvnHr_gn=7acz z#W?0eCdVhVMWN12VV^$>WlQ?f;P^{(&pYTops|btm6aj>_Uz+hqpGwB)vWp0Cf5y< zft8-je~nn?W11plq}N)4A{l8I7$!ks_x$PXW-2XaRFswX_BnF{R#6YIwMhAgd5F9X zGmwdadS6(a^fjHtXg8=l?Rc0Sm%hk6E9!5cLVloEy4eh(=FwgP`)~I^5~pBEWo+F6 zSf2ncyMurJN91#cJTy_u8Y}@%!bq1RkGC~-bV@SXRd4F{R-*V`bS+6;W5vZ(&+I<9$;-V|eNfLa5n-6% z2(}&uGRF;p92eS*sE*oR$@pexaqr*meB)VhmIg@h{uzkk$9~qh#cHhw#>O%)b@+(| z^IQgqzuj~Sk(J;swEM-3TrJAPCq9k^^^`q{IItKBRXYe}e0Tdr=Huf7da3$l4PdpwWDop%^}n;dD#K4s#DYA8SHZ z&1!riV4W4R7R#C))JH1~axJ)RYnM$$lIR%6fIVA@zV{XVyx}C+a-Dt8Y9M)^KU0+H zR4IUb2CJ{Hg>CuaXtD50jB(_Tcx=Z$^WYu2u5kubqmwp%drJ6 z?Fo40g!Qd<-l=TQxqHEOuPX0;^z7iX?Ke^a%XT<13TA^5`4Xcw6D@Ur&VT&CUe0d} z1GjOVF1^L@>O)l@?bD~$wzgf(nxX1OGD8fEV?TdJcZc2KoUe|oP1#=$$7ee|xbY)A zDZq+cuTpc(fFdj^=!;{k03C69lMQ(|>uhRfRu%+!k&YOi-3|1QKB z z?n?eq1XP>p-IM$Z^C;2L3itnbJZAip*Zo0aw2bs8@(s^~*8T9go!%dHcAz2lM;`yp zD=7&xjFV$S&5uDaiScyD?B-i1ze`+CoRtz`Wn+Zl&#s4&}MO{@N!ufrzjG$B79)Y2d3tBk&)TxUTw@QS0TEL_?njX|@vq?Uz(nBFK5Pq7*xj#u*R&i|?7+6# z+|r_n#SW&LXhtheZdah{ZVoqwyT{D>MC3nkFF#N)xLi{p7J1jXlmVeb;cP5?e(=f# zuT7fvjSbjS781v?7{)-X3*?>tq?)Yd)~|1{BDS(pqC zC}~H#WXlkUW*H5CDOo<)#x7%RY)A;ShGhI5s*#cRDA8YgqG(HeKDx+#(ZQ?386dv! zlXCO)w91~Vw4AmOcATuV653fa9R$fyK8ul%rG z-wfS zihugoZyr38Im?Zuh6@RcF~t1anQu7>#lPpb#}4cOA!EM11`%f*07RqOVkmX{p~KJ9 z^zP;K#|)$`^Rb{rnHGH{~>1(fawV0*Z#)}M`m8-?ZJV<+e}s9wE# z)l&az?w^5{)`S(%MRzxdNqrs1n*-=jS^_jqE*5XDrA0+VE`5^*p3CuM<&dZEeCjoz zR;uu_H9ZPZV|fQq`Cyw4nscrVwi!fE6ciMmX$!_hN7uF;jjKG)d2@aC4ropY)8etW=xJvni)8eHi`H$%#zn^WJ5NLc-rqk|u&&4Z6fD_m&JfSI1Bvb?b<*n&sfl0^t z=HnmRl`XrFvMKB%9}>PaA`m-fK6a0(8=qPkWS5bb4=v?XcWi&hRY?O5HdulRi4?fN zlsJ*N-0Qw+Yic@s0(2uy%F@ib;GjXt01Fmx5XbRo6+n|pP(&nodMoap^z{~q ziEeaUT@Mxe3vJSfI6?uLND(CNr=#^W<1b}jzW58bIfyWTDle$mmS(|x-0|2UlX+9k zQ^EX7Nw}?EzVoBfT(-LT|=9N@^hcn-_p&sqG z&*oVs2JSU+N4ZD`FhCAWaS;>|wH2G*Id|?pa#@>tyxX`+4HyIArWDvVrX)2WAOQff z0qyHu&-S@i^MS-+j--!pr4fPBj~_8({~e1bfcl0wI1kaoN>mJL6KUPQm5N7lB(ui1 zE-o%kq)&djzWJ}ob<-GfDlkB;F31j-VHKvQUGQ3sp`CwyGJk_i!y^sD0fqC@$9|jO zOqN!r!8-p==F@ZVP=U$qSpY(gQ0)59P1&t@y?5rvg<}E+GB}26NYPp4f2YFQrQtot5mn3wu_qprZ=>Ig-$ zbW26Ws~IgY>}^5w`vTB(G`PTZaDiGBo5o(tp)qli|NeV( z@H_=R8V39rt5J5YB2Ky?4eJJ#b`_iBe2ot~6%7mLt5t8Vwi^Jy7|jWXqa3amOIoRb zOr}WVFP--DsS`1WpN%~)t3R!arKF^Q$e12KEqU36AWwnCBICpH4XCsfnyrHr>$I$4 z!DpKX$OKLWarN7nv@!uIA+~RNO)l$$w}p(;b>mx8pwYvu;dD_unryX_NhT8*Tj>BTrTTL&!?O+%Rv;b?B??gSzdp?6Uug9{ zd@V08Z$BdI?fpoCS$)t4mg4rT8Q_I}h`0d-vYZ^|dOB*Q^S|xqTV*vIg?@fVFSmMpaw0qtTRbx} z({Pg?#{2`sc9)M5N$*N|4;^t$+QP?#mov zGVC@I*lBVrOU-%2y!7%)fAKjpEFsgQc4{amtiHb95KQEwvf<(3T<9-Zm$xIew#P22 zc2Ix|App^>v6(3L_MCU0d3W##AB0M~3D00EWoKZqsJYT(#@w$Y_H7G22M~ApVFTRHMI_3be)Lkn#0F*V8Pq zc}`Cjy$bE;FJ6H7p=0y#R>`}-m4(0F>%@P|?7fx{=R^uFdISRnZ2W_xQhD{YuR3t< z{6yxu=4~JkeA;|(J6_nv#>Nvs&FuLA&PW^he@t(UwFFE8)|a!R{`E`K`i^ZnyE4$k z;(749Ix|oi$c3QbEJ3b~D_kQsPz~fIUKym($a_7dJ?o+40*OLl^{=&oq$<#Q(yyrp z{J-FAniyAw9tPbe&IhQ|a`DqFTVQGQ&Gq3!C2==4x{6EJwiPZ8zub-iXoUtkJiG{} zPaR&}_fn8_z~(=;5lD-aPWD3z8PZS@AaUiomF!G8I}Mf>e~0g#BelA-5#`cj;O5>N Xviia!U7SGha1wx#SCgwmn*{w2TRX*I literal 0 HcmV?d00001 From 94a8edd3d1c6d67f7dee4568ba15f1251788d8ab Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Thu, 17 Dec 2020 05:25:03 +0000 Subject: [PATCH 120/223] Added translation using Weblate (Portuguese (Brazil)) --- l10n_br_delivery/i18n/pt_BR.po | 77 ++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 l10n_br_delivery/i18n/pt_BR.po diff --git a/l10n_br_delivery/i18n/pt_BR.po b/l10n_br_delivery/i18n/pt_BR.po new file mode 100644 index 000000000000..c36dc8a5c36c --- /dev/null +++ b/l10n_br_delivery/i18n/pt_BR.po @@ -0,0 +1,77 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * l10n_br_delivery +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" + +#. module: l10n_br_delivery +#: model:ir.model,name:l10n_br_delivery.model_l10n_br_fiscal_document +msgid "Fiscal Document" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__amount_freight +msgid "Freight" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_invoice__amount_freight_value +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__amount_freight_value +msgid "Freight Value" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__amount_insurance +msgid "Insurance" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_invoice__amount_insurance_value +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__amount_insurance_value +msgid "Insurance Value" +msgstr "" + +#. module: l10n_br_delivery +#: code:addons/l10n_br_delivery/models/sale_order.py:36 +#, python-format +msgid "No carrier set for this order." +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_invoice__amount_other_costs_value +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__amount_other_costs_value +#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__amount_costs +msgid "Other Costs" +msgstr "" + +#. module: l10n_br_delivery +#: code:addons/l10n_br_delivery/models/sale_order.py:38 +#, python-format +msgid "Please use \"Check price\" in order to compute a shipping price for this quotation." +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model,name:l10n_br_delivery.model_sale_order +msgid "Sale Order" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model,name:l10n_br_delivery.model_stock_picking +msgid "Transfer" +msgstr "" + +#. module: l10n_br_delivery +#: code:addons/l10n_br_delivery/models/sale_order.py:32 +#, python-format +msgid "You can add delivery price only on unconfirmed quotations." +msgstr "" From 5b022685fb511ed958759806b2a4a896e481d3a8 Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Thu, 17 Dec 2020 05:26:37 +0000 Subject: [PATCH 121/223] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (11 of 11 strings) Translation: l10n-brazil-12.0/l10n-brazil-12.0-l10n_br_delivery Translate-URL: https://translation.odoo-community.org/projects/l10n-brazil-12-0/l10n-brazil-12-0-l10n_br_delivery/pt_BR/ --- l10n_br_delivery/i18n/pt_BR.po | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/l10n_br_delivery/i18n/pt_BR.po b/l10n_br_delivery/i18n/pt_BR.po index c36dc8a5c36c..ddcf6047ee32 100644 --- a/l10n_br_delivery/i18n/pt_BR.po +++ b/l10n_br_delivery/i18n/pt_BR.po @@ -6,72 +6,77 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2020-12-17 05:26+0000\n" +"Last-Translator: Marcel Savegnago \n" "Language-Team: none\n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 4.3.2\n" #. module: l10n_br_delivery #: model:ir.model,name:l10n_br_delivery.model_l10n_br_fiscal_document msgid "Fiscal Document" -msgstr "" +msgstr "Contagem de Documentos Fiscais" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__amount_freight msgid "Freight" -msgstr "" +msgstr "Frete" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_account_invoice__amount_freight_value #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__amount_freight_value msgid "Freight Value" -msgstr "" +msgstr "Valor do Frete" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__amount_insurance msgid "Insurance" -msgstr "" +msgstr "Seguros" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_account_invoice__amount_insurance_value #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__amount_insurance_value msgid "Insurance Value" -msgstr "" +msgstr "Valor do Seguro" #. module: l10n_br_delivery #: code:addons/l10n_br_delivery/models/sale_order.py:36 #, python-format msgid "No carrier set for this order." -msgstr "" +msgstr "Nenhum operadora definida para esta ordem." #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_account_invoice__amount_other_costs_value #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__amount_other_costs_value #: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__amount_costs msgid "Other Costs" -msgstr "" +msgstr "Outros Custos" #. module: l10n_br_delivery #: code:addons/l10n_br_delivery/models/sale_order.py:38 #, python-format msgid "Please use \"Check price\" in order to compute a shipping price for this quotation." msgstr "" +"Por favor, use \"Verificar preço\" para calcular um preço de envio para esta " +"cotação." #. module: l10n_br_delivery #: model:ir.model,name:l10n_br_delivery.model_sale_order msgid "Sale Order" -msgstr "" +msgstr "Pedido de Venda" #. module: l10n_br_delivery #: model:ir.model,name:l10n_br_delivery.model_stock_picking msgid "Transfer" -msgstr "" +msgstr "Transferir" #. module: l10n_br_delivery #: code:addons/l10n_br_delivery/models/sale_order.py:32 #, python-format msgid "You can add delivery price only on unconfirmed quotations." msgstr "" +"Você pode adicionar preço de entrega apenas em cotações não confirmadas." From 69dc8c9e5286c2dfb8964a7f57919451fce5040b Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Fri, 18 Dec 2020 21:41:27 +0000 Subject: [PATCH 122/223] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (11 of 11 strings) Translation: l10n-brazil-12.0/l10n-brazil-12.0-l10n_br_delivery Translate-URL: https://translation.odoo-community.org/projects/l10n-brazil-12-0/l10n-brazil-12-0-l10n_br_delivery/pt_BR/ --- l10n_br_delivery/i18n/pt_BR.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/l10n_br_delivery/i18n/pt_BR.po b/l10n_br_delivery/i18n/pt_BR.po index ddcf6047ee32..174e6b90f0b3 100644 --- a/l10n_br_delivery/i18n/pt_BR.po +++ b/l10n_br_delivery/i18n/pt_BR.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2020-12-17 05:26+0000\n" +"PO-Revision-Date: 2020-12-18 21:45+0000\n" "Last-Translator: Marcel Savegnago \n" "Language-Team: none\n" "Language: pt_BR\n" @@ -19,7 +19,7 @@ msgstr "" #. module: l10n_br_delivery #: model:ir.model,name:l10n_br_delivery.model_l10n_br_fiscal_document msgid "Fiscal Document" -msgstr "Contagem de Documentos Fiscais" +msgstr "Documento Fiscal" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__amount_freight From ad48c8589398f43291ef4dc28361d824fe4d39f0 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Mon, 22 Feb 2021 12:30:53 +0000 Subject: [PATCH 123/223] [UPD] Update l10n_br_delivery.pot --- l10n_br_delivery/i18n/l10n_br_delivery.pot | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/l10n_br_delivery/i18n/l10n_br_delivery.pot b/l10n_br_delivery/i18n/l10n_br_delivery.pot index 1dfe4a5b6f66..016f74cfdc0b 100644 --- a/l10n_br_delivery/i18n/l10n_br_delivery.pot +++ b/l10n_br_delivery/i18n/l10n_br_delivery.pot @@ -14,24 +14,29 @@ msgstr "" "Plural-Forms: \n" #. module: l10n_br_delivery -#: model:ir.model,name:l10n_br_delivery.model_l10n_br_fiscal_document -msgid "Fiscal Document" +#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__amount_costs +msgid "Amount Costs" msgstr "" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__amount_freight -msgid "Freight" +msgid "Amount Freight" msgstr "" #. module: l10n_br_delivery -#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_invoice__amount_freight_value -#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__amount_freight_value -msgid "Freight Value" +#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__amount_insurance +msgid "Amount Insurance" msgstr "" #. module: l10n_br_delivery -#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__amount_insurance -msgid "Insurance" +#: model:ir.model,name:l10n_br_delivery.model_l10n_br_fiscal_document +msgid "Fiscal Document" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_invoice__amount_freight_value +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__amount_freight_value +msgid "Freight Value" msgstr "" #. module: l10n_br_delivery @@ -49,7 +54,6 @@ msgstr "" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_account_invoice__amount_other_costs_value #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__amount_other_costs_value -#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__amount_costs msgid "Other Costs" msgstr "" From 392f7fdbaf711964066a1093ca4b8020716119c9 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Mon, 8 Mar 2021 17:43:36 -0300 Subject: [PATCH 124/223] [REF] l10n_br_delivery: compute fields, methods, tests and views to use fiscal mixin --- l10n_br_delivery/models/document.py | 30 ++++---- l10n_br_delivery/models/sale_order.py | 66 +++++++++------- .../tests/test_delivery_inverse_amount.py | 76 +++++++++---------- 3 files changed, 92 insertions(+), 80 deletions(-) diff --git a/l10n_br_delivery/models/document.py b/l10n_br_delivery/models/document.py index 21dc6df6fe71..60f46dc03cf7 100644 --- a/l10n_br_delivery/models/document.py +++ b/l10n_br_delivery/models/document.py @@ -11,8 +11,8 @@ class Document(models.Model): inverse='_inverse_amount_freight_value' ) - amount_other_costs_value = fields.Monetary( - inverse='_inverse_amount_other_costs_value' + amount_costs_value = fields.Monetary( + inverse='_inverse_amount_costs_value' ) amount_insurance_value = fields.Monetary( @@ -43,26 +43,26 @@ def _inverse_amount_freight_value(self): line._onchange_fiscal_taxes() @api.multi - def _inverse_amount_other_costs_value(self): + def _inverse_amount_costs_value(self): for record in self.filtered(lambda doc: doc.line_ids): - amount_other_costs_value = record.amount_other_costs_value - if all(record.line_ids.mapped('other_costs_value')): + amount_costs_value = record.amount_costs_value + if all(record.line_ids.mapped('costs_value')): amount_freight_old = sum( - record.line_ids.mapped('other_costs_value')) + record.line_ids.mapped('costs_value')) for line in record.line_ids[:-1]: - line.other_costs_value = amount_other_costs_value * ( - line.other_costs_value / amount_freight_old) - record.line_ids[-1].other_costs_value = \ - amount_other_costs_value - sum( - line.other_costs_value + line.costs_value = amount_costs_value * ( + line.costs_value / amount_freight_old) + record.line_ids[-1].costs_value = \ + amount_costs_value - sum( + line.costs_value for line in record.line_ids[:-1]) else: for line in record.line_ids[:-1]: - line.other_costs_value = amount_other_costs_value * ( + line.costs_value = amount_costs_value * ( line.amount_total / record.amount_total) - record.line_ids[-1].other_costs_value = \ - amount_other_costs_value - sum( - line.other_costs_value + record.line_ids[-1].costs_value = \ + amount_costs_value - sum( + line.costs_value for line in record.line_ids[:-1]) for line in record.line_ids: line._onchange_fiscal_taxes() diff --git a/l10n_br_delivery/models/sale_order.py b/l10n_br_delivery/models/sale_order.py index ce232b284251..edc57775d56d 100644 --- a/l10n_br_delivery/models/sale_order.py +++ b/l10n_br_delivery/models/sale_order.py @@ -9,15 +9,16 @@ class SaleOrder(models.Model): _inherit = 'sale.order' - amount_freight = fields.Float( + amount_freight_value = fields.Monetary( inverse='_inverse_amount_freight', - ) + ) - amount_insurance = fields.Float( + amount_insurance_value = fields.Monetary( inverse='_inverse_amount_insurance', readonly=False, ) - amount_costs = fields.Float( + + amount_costs_value = fields.Monetary( inverse='_inverse_amount_costs', readonly=False, ) @@ -40,28 +41,33 @@ def set_delivery_line(self): 'price for this quotation.')) else: price_unit = order.carrier_id.rate_shipment(order)['price'] - order.amount_freight = price_unit + order.amount_freight_value = price_unit return True @api.multi def _inverse_amount_freight(self): for record in self.filtered(lambda so: so.order_line): - amount_freight = record.amount_freight + amount_freight_value = record.amount_freight_value if all(record.order_line.mapped('freight_value')): amount_freight_old = sum( record.order_line.mapped('freight_value')) for line in record.order_line[:-1]: - line.freight_value = amount_freight * ( + line.freight_value = amount_freight_value * ( line.freight_value / amount_freight_old) - record.order_line[-1].freight_value = amount_freight - sum( - line.freight_value for line in record.order_line[:-1]) + record.order_line[-1].freight_value = ( + amount_freight_value - + sum(line.freight_value + for line in record.order_line[:-1]) + ) else: amount_total = sum(record.order_line.mapped('price_total')) for line in record.order_line[:-1]: - line.freight_value = amount_freight * ( + line.freight_value = amount_freight_value * ( line.price_total / amount_total) - record.order_line[-1].freight_value = amount_freight - sum( - line.freight_value for line in record.order_line[:-1]) + record.order_line[-1].freight_value = ( + amount_freight_value - + sum(line.freight_value for line in record.order_line[:-1]) + ) for line in record.order_line: line._onchange_fiscal_taxes() record._fields['amount_total'].compute_value(record) @@ -75,25 +81,25 @@ def _inverse_amount_freight(self): @api.multi def _inverse_amount_insurance(self): for record in self.filtered(lambda so: so.order_line): - amount_insurance = record.amount_insurance + amount_insurance_value = record.amount_insurance_value if all(record.order_line.mapped('insurance_value')): amount_insurance_old = sum( record.order_line.mapped('insurance_value')) for line in record.order_line[:-1]: - line.insurance_value = amount_insurance * ( + line.insurance_value = amount_insurance_value * ( line.insurance_value / amount_insurance_old) record.order_line[-1].insurance_value = \ - amount_insurance - sum( + amount_insurance_value - sum( line.insurance_value for line in record.order_line[:-1] ) else: amount_total = sum(record.order_line.mapped('price_total')) for line in record.order_line[:-1]: - line.insurance_value = amount_insurance * ( + line.insurance_value = amount_insurance_value * ( line.price_total / amount_total) record.order_line[-1].insurance_value = \ - amount_insurance - sum( + amount_insurance_value - sum( line.insurance_value for line in record.order_line[:-1]) for line in record.order_line: @@ -109,22 +115,28 @@ def _inverse_amount_insurance(self): @api.multi def _inverse_amount_costs(self): for record in self.filtered(lambda so: so.order_line): - amount_costs = record.amount_costs - if all(record.order_line.mapped('other_costs_value')): + amount_costs_value = record.amount_costs_value + if all(record.order_line.mapped('costs_value')): amount_costs_old = sum( - record.order_line.mapped('other_costs_value')) + record.order_line.mapped('costs_value')) for line in record.order_line[:-1]: - line.other_costs_value = amount_costs * ( - line.other_costs_value / amount_costs_old) - record.order_line[-1].other_costs_value = amount_costs - sum( - line.other_costs_value for line in record.order_line[:-1]) + line.costs_value = amount_costs_value * ( + line.costs_value / amount_costs_old) + record.order_line[-1].costs_value = ( + amount_costs_value - + sum(line.costs_value + for line in record.order_line[:-1]) + ) else: amount_total = sum(record.order_line.mapped('price_total')) for line in record.order_line[:-1]: - line.other_costs_value = amount_costs * ( + line.costs_value = amount_costs_value * ( line.price_total / amount_total) - record.order_line[-1].other_costs_value = amount_costs - sum( - line.other_costs_value for line in record.order_line[:-1]) + record.order_line[-1].costs_value = ( + amount_costs_value - + sum(line.costs_value + for line in record.order_line[:-1]) + ) for line in record.order_line: line._onchange_fiscal_taxes() record._fields['amount_total'].compute_value(record) diff --git a/l10n_br_delivery/tests/test_delivery_inverse_amount.py b/l10n_br_delivery/tests/test_delivery_inverse_amount.py index e87e6903ec5a..9dd2b56d93b2 100644 --- a/l10n_br_delivery/tests/test_delivery_inverse_amount.py +++ b/l10n_br_delivery/tests/test_delivery_inverse_amount.py @@ -36,9 +36,9 @@ def setUpClass(self): # Change freight, insurance and other costs amount from # sale_order_total_id with Form(self.sale_order_total_id) as so: - so.amount_freight = 100.0 - so.amount_insurance = 100.0 - so.amount_costs = 100.0 + so.amount_freight_value = 100.0 + so.amount_insurance_value = 100.0 + so.amount_costs_value = 100.0 # Change freight, insurance and other costs amount from # sale_order_lines_id lines @@ -46,16 +46,16 @@ def setUpClass(self): with so.order_line.edit(0) as line: line.freight_value = 70.00 line.insurance_value = 70.00 - line.other_costs_value = 70.00 + line.costs_value = 70.00 with so.order_line.edit(1) as line: line.freight_value = 10.00 line.insurance_value = 10.00 - line.other_costs_value = 10.00 + line.costs_value = 10.00 with Form(self.sale_order_line_id) as so: - so.amount_freight = 100.0 - so.amount_insurance = 100.0 - so.amount_costs = 100.0 + so.amount_freight_value = 100.0 + so.amount_insurance_value = 100.0 + so.amount_costs_value = 100.0 # Confirm and create invoices for the sale orders self.sale_order_total_id.action_confirm() @@ -95,13 +95,13 @@ def test_sale_order_total_amounts(self): self.sale_order_total_id.amount_untaxed, 110.0, "Unexpected value for the field amount_untaxed from Sale Order") self.assertEqual( - self.sale_order_total_id.amount_freight, 100.0, + self.sale_order_total_id.amount_freight_value, 100.0, "Unexpected value for the field amount_freight from Sale Order") self.assertEqual( - self.sale_order_total_id.amount_insurance, 100.0, + self.sale_order_total_id.amount_insurance_value, 100.0, "Unexpected value for the field amount_insurance from Sale Order") self.assertEqual( - self.sale_order_total_id.amount_costs, 100.0, + self.sale_order_total_id.amount_costs_value, 100.0, "Unexpected value for the field amount_costs from Sale Order") self.assertEqual( self.sale_order_total_id.amount_tax, 0.0, @@ -116,13 +116,13 @@ def test_sale_order_line_amounts(self): self.sale_order_line_id.amount_untaxed, 110.0, "Unexpected value for the field amount_untaxed from Sale Order") self.assertEqual( - self.sale_order_line_id.amount_freight, 100.0, + self.sale_order_line_id.amount_freight_value, 100.0, "Unexpected value for the field amount_freight from Sale Order") self.assertEqual( - self.sale_order_line_id.amount_insurance, 100.0, + self.sale_order_line_id.amount_insurance_value, 100.0, "Unexpected value for the field amount_insurance from Sale Order") self.assertEqual( - self.sale_order_line_id.amount_costs, 100.0, + self.sale_order_line_id.amount_costs_value, 100.0, "Unexpected value for the field amount_costs from Sale Order") self.assertEqual( self.sale_order_line_id.amount_tax, 0.0, @@ -133,13 +133,13 @@ def test_invoice_amount_tax(self): invoice_tax_total = self.sale_order_total_id.invoice_ids[0].amount_tax self.assertEqual( - invoice_tax_total, 300, + invoice_tax_total, 0.0, "Unexpected value for the field invoice_tax from Invoice") invoice_tax_line = self.sale_order_line_id.invoice_ids[0].amount_tax self.assertEqual( - invoice_tax_line, 300, + invoice_tax_line, 0.0, "Unexpected value for the field invoice_tax from Invoice") def test_inverse_amount_freight_total(self): @@ -291,35 +291,35 @@ def test_inverse_amount_other_costs_total(self): fiscal_document_id = \ self.sale_order_total_id.invoice_ids[0].fiscal_document_id self.assertEqual( - fiscal_document_id.amount_other_costs_value, 100, - "Unexpected value for the field other_costs_value from " + fiscal_document_id.amount_costs_value, 100, + "Unexpected value for the field costs_value from " "Fiscal Document") for line in fiscal_document_id.line_ids: if line.name == '[FURN_7777] Office Chair': self.assertEqual( - line.other_costs_value, 63.64, - "Unexpected value for the field other_costs_value from " + line.costs_value, 63.64, + "Unexpected value for the field costs_value from " "Fiscal Document line") if line.name == '[FURN_8888] Office Lamp': self.assertEqual( - line.other_costs_value, 36.36, - "Unexpected value for the field other_costs_value from " + line.costs_value, 36.36, + "Unexpected value for the field costs_value from " "Fiscal Document line") with Form(fiscal_document_id) as doc: - doc.amount_other_costs_value = 10.0 + doc.amount_costs_value = 10.0 for line in fiscal_document_id.line_ids: if line.name == '[FURN_7777] Office Chair': self.assertEqual( - line.other_costs_value, 6.36, - "Unexpected value for the field other_costs_value from " + line.costs_value, 6.36, + "Unexpected value for the field costs_value from " "Fiscal Document line") if line.name == '[FURN_8888] Office Lamp': self.assertEqual( - line.other_costs_value, 3.64, - "Unexpected value for the field other_costs_value from " + line.costs_value, 3.64, + "Unexpected value for the field costs_value from " "Fiscal Document line") def test_inverse_amount_other_costs_line(self): @@ -327,33 +327,33 @@ def test_inverse_amount_other_costs_line(self): fiscal_document_id = \ self.sale_order_line_id.invoice_ids[0].fiscal_document_id self.assertEqual( - fiscal_document_id.amount_other_costs_value, 100, - "Unexpected value for the field other_costs_value from " + fiscal_document_id.amount_costs_value, 100, + "Unexpected value for the field costs_value from " "Fiscal Document") for line in fiscal_document_id.line_ids: if line.name == '[FURN_7777] Office Chair': self.assertEqual( - line.other_costs_value, 87.5, - "Unexpected value for the field other_costs_value from " + line.costs_value, 87.5, + "Unexpected value for the field costs_value from " "Fiscal Document line") if line.name == '[FURN_8888] Office Lamp': self.assertEqual( - line.other_costs_value, 12.5, - "Unexpected value for the field other_costs_value from " + line.costs_value, 12.5, + "Unexpected value for the field costs_value from " "Fiscal Document line") with Form(fiscal_document_id) as doc: - doc.amount_other_costs_value = 10.0 + doc.amount_costs_value = 10.0 for line in fiscal_document_id.line_ids: if line.name == '[FURN_7777] Office Chair': self.assertEqual( - line.other_costs_value, 8.75, - "Unexpected value for the field other_costs_value from " + line.costs_value, 8.75, + "Unexpected value for the field costs_value from " "Fiscal Document line") if line.name == '[FURN_8888] Office Lamp': self.assertEqual( - line.other_costs_value, 1.25, - "Unexpected value for the field other_costs_value from " + line.costs_value, 1.25, + "Unexpected value for the field costs_value from " "Fiscal Document line") From edc15c416199eabf7357a3e4e34155f2a603790b Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 10 Mar 2021 19:00:01 -0300 Subject: [PATCH 125/223] l10n_br_delivery: rename costs_value to other_value --- l10n_br_delivery/models/document.py | 30 ++++----- l10n_br_delivery/models/sale_order.py | 32 +++++----- .../tests/test_delivery_inverse_amount.py | 62 +++++++++---------- 3 files changed, 62 insertions(+), 62 deletions(-) diff --git a/l10n_br_delivery/models/document.py b/l10n_br_delivery/models/document.py index 60f46dc03cf7..f9a86772d27a 100644 --- a/l10n_br_delivery/models/document.py +++ b/l10n_br_delivery/models/document.py @@ -11,8 +11,8 @@ class Document(models.Model): inverse='_inverse_amount_freight_value' ) - amount_costs_value = fields.Monetary( - inverse='_inverse_amount_costs_value' + amount_other_value = fields.Monetary( + inverse='_inverse_amount_other_value' ) amount_insurance_value = fields.Monetary( @@ -43,26 +43,26 @@ def _inverse_amount_freight_value(self): line._onchange_fiscal_taxes() @api.multi - def _inverse_amount_costs_value(self): + def _inverse_amount_other_value(self): for record in self.filtered(lambda doc: doc.line_ids): - amount_costs_value = record.amount_costs_value - if all(record.line_ids.mapped('costs_value')): + amount_other_value = record.amount_other_value + if all(record.line_ids.mapped('other_value')): amount_freight_old = sum( - record.line_ids.mapped('costs_value')) + record.line_ids.mapped('other_value')) for line in record.line_ids[:-1]: - line.costs_value = amount_costs_value * ( - line.costs_value / amount_freight_old) - record.line_ids[-1].costs_value = \ - amount_costs_value - sum( - line.costs_value + line.other_value = amount_other_value * ( + line.other_value / amount_freight_old) + record.line_ids[-1].other_value = \ + amount_other_value - sum( + line.other_value for line in record.line_ids[:-1]) else: for line in record.line_ids[:-1]: - line.costs_value = amount_costs_value * ( + line.other_value = amount_other_value * ( line.amount_total / record.amount_total) - record.line_ids[-1].costs_value = \ - amount_costs_value - sum( - line.costs_value + record.line_ids[-1].other_value = \ + amount_other_value - sum( + line.other_value for line in record.line_ids[:-1]) for line in record.line_ids: line._onchange_fiscal_taxes() diff --git a/l10n_br_delivery/models/sale_order.py b/l10n_br_delivery/models/sale_order.py index edc57775d56d..dbd1191d4f58 100644 --- a/l10n_br_delivery/models/sale_order.py +++ b/l10n_br_delivery/models/sale_order.py @@ -18,8 +18,8 @@ class SaleOrder(models.Model): readonly=False, ) - amount_costs_value = fields.Monetary( - inverse='_inverse_amount_costs', + amount_other_value = fields.Monetary( + inverse='_inverse_amount_other', readonly=False, ) @@ -113,28 +113,28 @@ def _inverse_amount_insurance(self): }) @api.multi - def _inverse_amount_costs(self): + def _inverse_amount_other(self): for record in self.filtered(lambda so: so.order_line): - amount_costs_value = record.amount_costs_value - if all(record.order_line.mapped('costs_value')): - amount_costs_old = sum( - record.order_line.mapped('costs_value')) + amount_other_value = record.amount_other_value + if all(record.order_line.mapped('other_value')): + amount_other_old = sum( + record.order_line.mapped('other_value')) for line in record.order_line[:-1]: - line.costs_value = amount_costs_value * ( - line.costs_value / amount_costs_old) - record.order_line[-1].costs_value = ( - amount_costs_value - - sum(line.costs_value + line.other_value = amount_other_value * ( + line.other_value / amount_other_old) + record.order_line[-1].other_value = ( + amount_other_value - + sum(line.other_value for line in record.order_line[:-1]) ) else: amount_total = sum(record.order_line.mapped('price_total')) for line in record.order_line[:-1]: - line.costs_value = amount_costs_value * ( + line.other_value = amount_other_value * ( line.price_total / amount_total) - record.order_line[-1].costs_value = ( - amount_costs_value - - sum(line.costs_value + record.order_line[-1].other_value = ( + amount_other_value - + sum(line.other_value for line in record.order_line[:-1]) ) for line in record.order_line: diff --git a/l10n_br_delivery/tests/test_delivery_inverse_amount.py b/l10n_br_delivery/tests/test_delivery_inverse_amount.py index 9dd2b56d93b2..3d192121363a 100644 --- a/l10n_br_delivery/tests/test_delivery_inverse_amount.py +++ b/l10n_br_delivery/tests/test_delivery_inverse_amount.py @@ -38,7 +38,7 @@ def setUpClass(self): with Form(self.sale_order_total_id) as so: so.amount_freight_value = 100.0 so.amount_insurance_value = 100.0 - so.amount_costs_value = 100.0 + so.amount_other_value = 100.0 # Change freight, insurance and other costs amount from # sale_order_lines_id lines @@ -46,16 +46,16 @@ def setUpClass(self): with so.order_line.edit(0) as line: line.freight_value = 70.00 line.insurance_value = 70.00 - line.costs_value = 70.00 + line.other_value = 70.00 with so.order_line.edit(1) as line: line.freight_value = 10.00 line.insurance_value = 10.00 - line.costs_value = 10.00 + line.other_value = 10.00 with Form(self.sale_order_line_id) as so: so.amount_freight_value = 100.0 so.amount_insurance_value = 100.0 - so.amount_costs_value = 100.0 + so.amount_other_value = 100.0 # Confirm and create invoices for the sale orders self.sale_order_total_id.action_confirm() @@ -101,7 +101,7 @@ def test_sale_order_total_amounts(self): self.sale_order_total_id.amount_insurance_value, 100.0, "Unexpected value for the field amount_insurance from Sale Order") self.assertEqual( - self.sale_order_total_id.amount_costs_value, 100.0, + self.sale_order_total_id.amount_other_value, 100.0, "Unexpected value for the field amount_costs from Sale Order") self.assertEqual( self.sale_order_total_id.amount_tax, 0.0, @@ -122,8 +122,8 @@ def test_sale_order_line_amounts(self): self.sale_order_line_id.amount_insurance_value, 100.0, "Unexpected value for the field amount_insurance from Sale Order") self.assertEqual( - self.sale_order_line_id.amount_costs_value, 100.0, - "Unexpected value for the field amount_costs from Sale Order") + self.sale_order_line_id.amount_other_value, 100.0, + "Unexpected value for the field amount_other from Sale Order") self.assertEqual( self.sale_order_line_id.amount_tax, 0.0, "Unexpected value for the field amount_tax from Sale Order") @@ -291,69 +291,69 @@ def test_inverse_amount_other_costs_total(self): fiscal_document_id = \ self.sale_order_total_id.invoice_ids[0].fiscal_document_id self.assertEqual( - fiscal_document_id.amount_costs_value, 100, - "Unexpected value for the field costs_value from " + fiscal_document_id.amount_other_value, 100, + "Unexpected value for the field other_value from " "Fiscal Document") for line in fiscal_document_id.line_ids: if line.name == '[FURN_7777] Office Chair': self.assertEqual( - line.costs_value, 63.64, - "Unexpected value for the field costs_value from " + line.other_value, 63.64, + "Unexpected value for the field other_value from " "Fiscal Document line") if line.name == '[FURN_8888] Office Lamp': self.assertEqual( - line.costs_value, 36.36, - "Unexpected value for the field costs_value from " + line.other_value, 36.36, + "Unexpected value for the field other_value from " "Fiscal Document line") with Form(fiscal_document_id) as doc: - doc.amount_costs_value = 10.0 + doc.amount_other_value = 10.0 for line in fiscal_document_id.line_ids: if line.name == '[FURN_7777] Office Chair': self.assertEqual( - line.costs_value, 6.36, - "Unexpected value for the field costs_value from " + line.other_value, 6.36, + "Unexpected value for the field other_value from " "Fiscal Document line") if line.name == '[FURN_8888] Office Lamp': self.assertEqual( - line.costs_value, 3.64, - "Unexpected value for the field costs_value from " + line.other_value, 3.64, + "Unexpected value for the field other_value from " "Fiscal Document line") - def test_inverse_amount_other_costs_line(self): - """Check Fiscal Document other costs values for lines""" + def test_inverse_amount_other_line(self): + """Check Fiscal Document other other values for lines""" fiscal_document_id = \ self.sale_order_line_id.invoice_ids[0].fiscal_document_id self.assertEqual( - fiscal_document_id.amount_costs_value, 100, - "Unexpected value for the field costs_value from " + fiscal_document_id.amount_other_value, 100, + "Unexpected value for the field other_value from " "Fiscal Document") for line in fiscal_document_id.line_ids: if line.name == '[FURN_7777] Office Chair': self.assertEqual( - line.costs_value, 87.5, - "Unexpected value for the field costs_value from " + line.other_value, 87.5, + "Unexpected value for the field other_value from " "Fiscal Document line") if line.name == '[FURN_8888] Office Lamp': self.assertEqual( - line.costs_value, 12.5, - "Unexpected value for the field costs_value from " + line.other_value, 12.5, + "Unexpected value for the field other_value from " "Fiscal Document line") with Form(fiscal_document_id) as doc: - doc.amount_costs_value = 10.0 + doc.amount_other_value = 10.0 for line in fiscal_document_id.line_ids: if line.name == '[FURN_7777] Office Chair': self.assertEqual( - line.costs_value, 8.75, - "Unexpected value for the field costs_value from " + line.other_value, 8.75, + "Unexpected value for the field other_value from " "Fiscal Document line") if line.name == '[FURN_8888] Office Lamp': self.assertEqual( - line.costs_value, 1.25, - "Unexpected value for the field costs_value from " + line.other_value, 1.25, + "Unexpected value for the field other_value from " "Fiscal Document line") From 7f47da918d0076b134970742e7ee501acd8bd56e Mon Sep 17 00:00:00 2001 From: oca-travis Date: Fri, 26 Mar 2021 00:57:57 +0000 Subject: [PATCH 126/223] [UPD] Update l10n_br_delivery.pot --- l10n_br_delivery/i18n/l10n_br_delivery.pot | 28 +++++++--------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/l10n_br_delivery/i18n/l10n_br_delivery.pot b/l10n_br_delivery/i18n/l10n_br_delivery.pot index 016f74cfdc0b..0084afd21efc 100644 --- a/l10n_br_delivery/i18n/l10n_br_delivery.pot +++ b/l10n_br_delivery/i18n/l10n_br_delivery.pot @@ -13,21 +13,6 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" -#. module: l10n_br_delivery -#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__amount_costs -msgid "Amount Costs" -msgstr "" - -#. module: l10n_br_delivery -#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__amount_freight -msgid "Amount Freight" -msgstr "" - -#. module: l10n_br_delivery -#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__amount_insurance -msgid "Amount Insurance" -msgstr "" - #. module: l10n_br_delivery #: model:ir.model,name:l10n_br_delivery.model_l10n_br_fiscal_document msgid "Fiscal Document" @@ -36,29 +21,32 @@ msgstr "" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_account_invoice__amount_freight_value #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__amount_freight_value +#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__amount_freight_value msgid "Freight Value" msgstr "" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_account_invoice__amount_insurance_value #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__amount_insurance_value +#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__amount_insurance_value msgid "Insurance Value" msgstr "" #. module: l10n_br_delivery -#: code:addons/l10n_br_delivery/models/sale_order.py:36 +#: code:addons/l10n_br_delivery/models/sale_order.py:37 #, python-format msgid "No carrier set for this order." msgstr "" #. module: l10n_br_delivery -#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_invoice__amount_other_costs_value -#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__amount_other_costs_value +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_invoice__amount_other_value +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__amount_other_value +#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__amount_other_value msgid "Other Costs" msgstr "" #. module: l10n_br_delivery -#: code:addons/l10n_br_delivery/models/sale_order.py:38 +#: code:addons/l10n_br_delivery/models/sale_order.py:39 #, python-format msgid "Please use \"Check price\" in order to compute a shipping price for this quotation." msgstr "" @@ -74,7 +62,7 @@ msgid "Transfer" msgstr "" #. module: l10n_br_delivery -#: code:addons/l10n_br_delivery/models/sale_order.py:32 +#: code:addons/l10n_br_delivery/models/sale_order.py:33 #, python-format msgid "You can add delivery price only on unconfirmed quotations." msgstr "" From f6d8290cc634e91c739039c8d8a14066d2efedee Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Fri, 26 Mar 2021 01:26:12 +0000 Subject: [PATCH 127/223] l10n_br_delivery 12.0.2.0.0 --- l10n_br_delivery/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_delivery/__manifest__.py b/l10n_br_delivery/__manifest__.py index 2263c2b02247..7ade74bc8192 100644 --- a/l10n_br_delivery/__manifest__.py +++ b/l10n_br_delivery/__manifest__.py @@ -9,7 +9,7 @@ 'license': 'AGPL-3', 'author': 'KMEE,Odoo Community Association (OCA)', 'website': 'https://github.com/oca/l10n-brazil', - 'version': '12.0.1.1.0', + 'version': '12.0.2.0.0', 'depends': [ 'l10n_br_fiscal', 'l10n_br_sale_stock', From 4e9068523c69a9880ebe9b28884aa833ff46199e Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 14 Apr 2021 17:51:48 -0300 Subject: [PATCH 128/223] rename amount_gross to amount_price_gross in l10n_br_delivery tests --- l10n_br_delivery/tests/test_delivery_inverse_amount.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/l10n_br_delivery/tests/test_delivery_inverse_amount.py b/l10n_br_delivery/tests/test_delivery_inverse_amount.py index 3d192121363a..cec935cf304c 100644 --- a/l10n_br_delivery/tests/test_delivery_inverse_amount.py +++ b/l10n_br_delivery/tests/test_delivery_inverse_amount.py @@ -89,8 +89,8 @@ def setUpClass(self): def test_sale_order_total_amounts(self): """Check sale order total amounts""" self.assertEqual( - self.sale_order_total_id.amount_gross, 110.0, - "Unexpected value for the field amount_gross from Sale Order") + self.sale_order_total_id.amount_price_gross, 110.0, + "Unexpected value for the field amount_price_gross from Sale Order") self.assertEqual( self.sale_order_total_id.amount_untaxed, 110.0, "Unexpected value for the field amount_untaxed from Sale Order") @@ -110,8 +110,8 @@ def test_sale_order_total_amounts(self): def test_sale_order_line_amounts(self): """Check sale order line amounts""" self.assertEqual( - self.sale_order_line_id.amount_gross, 110.0, - "Unexpected value for the field amount_gross from Sale Order") + self.sale_order_line_id.amount_price_gross, 110.0, + "Unexpected value for the field amount_price_gross from Sale Order") self.assertEqual( self.sale_order_line_id.amount_untaxed, 110.0, "Unexpected value for the field amount_untaxed from Sale Order") From bfdd9c53845912a47cac9695cc4e6cbd0e966541 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Thu, 15 Apr 2021 16:36:38 +0000 Subject: [PATCH 129/223] l10n_br_delivery 12.0.3.0.0 --- l10n_br_delivery/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_delivery/__manifest__.py b/l10n_br_delivery/__manifest__.py index 7ade74bc8192..6bccfb1637e2 100644 --- a/l10n_br_delivery/__manifest__.py +++ b/l10n_br_delivery/__manifest__.py @@ -9,7 +9,7 @@ 'license': 'AGPL-3', 'author': 'KMEE,Odoo Community Association (OCA)', 'website': 'https://github.com/oca/l10n-brazil', - 'version': '12.0.2.0.0', + 'version': '12.0.3.0.0', 'depends': [ 'l10n_br_fiscal', 'l10n_br_sale_stock', From 910e8c934b71370bbf155ebfc6a3a4cb58dd1020 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 26 May 2021 15:16:01 -0300 Subject: [PATCH 130/223] [ADD] l10n_br_delivery migration 12.0.1.0.0 --- .../migrations/12.0.1.0.0/pre-migration.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 l10n_br_delivery/migrations/12.0.1.0.0/pre-migration.py diff --git a/l10n_br_delivery/migrations/12.0.1.0.0/pre-migration.py b/l10n_br_delivery/migrations/12.0.1.0.0/pre-migration.py new file mode 100644 index 000000000000..c5927a71ecb1 --- /dev/null +++ b/l10n_br_delivery/migrations/12.0.1.0.0/pre-migration.py @@ -0,0 +1,19 @@ +# Copyright (C) 2021 - TODAY Renato Lima - Akretion +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openupgradelib import openupgrade + +_columns_rename = { + 'account_invoice': [ + ('incoterm', 'incoterm_id'), + ], +} + + +@openupgrade.migrate(use_env=True) +def migrate(env, version): + for table in _columns_rename.keys(): + for rename_column in _columns_rename[table]: + if openupgrade.column_exists(env.cr, table, rename_column[0]): + openupgrade.rename_columns( + env.cr, {table: [rename_column]}) From 7f95770fd678f79467d57afd4f14a718e1e6c56e Mon Sep 17 00:00:00 2001 From: Luis Felipe Mileo Date: Sun, 30 May 2021 18:00:22 -0300 Subject: [PATCH 131/223] [REF] Standard OCA website l10n_br_delivery --- l10n_br_delivery/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_delivery/__manifest__.py b/l10n_br_delivery/__manifest__.py index 6bccfb1637e2..24b94f9142c9 100644 --- a/l10n_br_delivery/__manifest__.py +++ b/l10n_br_delivery/__manifest__.py @@ -8,7 +8,7 @@ standards.""", 'license': 'AGPL-3', 'author': 'KMEE,Odoo Community Association (OCA)', - 'website': 'https://github.com/oca/l10n-brazil', + 'website': 'https://github.com/OCA/l10n-brazil', 'version': '12.0.3.0.0', 'depends': [ 'l10n_br_fiscal', From a055acdc573318f1207594157afce382d432d491 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Mon, 4 Jan 2021 15:21:18 -0300 Subject: [PATCH 132/223] [ADD] Carrier infos --- l10n_br_delivery/__manifest__.py | 7 ++++--- l10n_br_delivery/models/__init__.py | 1 + l10n_br_delivery/models/carrier.py | 19 +++++++++++++++++++ l10n_br_delivery/views/carrier.xml | 15 +++++++++++++++ 4 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 l10n_br_delivery/models/carrier.py create mode 100644 l10n_br_delivery/views/carrier.xml diff --git a/l10n_br_delivery/__manifest__.py b/l10n_br_delivery/__manifest__.py index 24b94f9142c9..0a641cd85214 100644 --- a/l10n_br_delivery/__manifest__.py +++ b/l10n_br_delivery/__manifest__.py @@ -1,4 +1,4 @@ -# Copyright (C) 2020 KMEE INFORMATICA LTDA +# Copyright (C) 2010 Renato Lima - Akretion # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html { @@ -7,8 +7,8 @@ This module changes the delivery model strategy to match brazilian standards.""", 'license': 'AGPL-3', - 'author': 'KMEE,Odoo Community Association (OCA)', - 'website': 'https://github.com/OCA/l10n-brazil', + 'author': 'Akretion, Odoo Community Association (OCA)', + 'website': 'https://github.com/oca/l10n-brazil', 'version': '12.0.3.0.0', 'depends': [ 'l10n_br_fiscal', @@ -16,6 +16,7 @@ 'delivery', ], 'data': [ + 'views/carrier.xml', ], 'demo': [], 'category': 'Localization', diff --git a/l10n_br_delivery/models/__init__.py b/l10n_br_delivery/models/__init__.py index c17376150892..7ac15e6d60d0 100644 --- a/l10n_br_delivery/models/__init__.py +++ b/l10n_br_delivery/models/__init__.py @@ -1,3 +1,4 @@ +from . import carrier from . import sale_order from . import stock_picking from . import document diff --git a/l10n_br_delivery/models/carrier.py b/l10n_br_delivery/models/carrier.py new file mode 100644 index 000000000000..b70f24efb0cc --- /dev/null +++ b/l10n_br_delivery/models/carrier.py @@ -0,0 +1,19 @@ +# Copyright (C) 2010 Renato Lima - Akretion +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from odoo import fields, models + + +class Carrier(models.Model): + _inherit = 'delivery.carrier' + + partner_id = fields.Many2one( + comodel_name='res.partner', + string='Transportadora', + domain=[('supplier', '=', True)], + ) + + antt_code = fields.Char( + string='Codigo ANTT', + size=32, + ) diff --git a/l10n_br_delivery/views/carrier.xml b/l10n_br_delivery/views/carrier.xml new file mode 100644 index 000000000000..7a34f1e86d6c --- /dev/null +++ b/l10n_br_delivery/views/carrier.xml @@ -0,0 +1,15 @@ + + + + + l10n_br_delivery.carrier.form + delivery.carrier + + + + + + + + + From 5f10beece9cd062467bb826fdac61a23ef29d52a Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Fri, 16 Apr 2021 16:44:06 -0300 Subject: [PATCH 133/223] [MOV] Moved fields Freight, Insurance and Other Costs to l10n_br_sale because already exist there. --- l10n_br_delivery/models/sale_order.py | 120 +------------------------- 1 file changed, 1 insertion(+), 119 deletions(-) diff --git a/l10n_br_delivery/models/sale_order.py b/l10n_br_delivery/models/sale_order.py index dbd1191d4f58..e1c3da9a2e43 100644 --- a/l10n_br_delivery/models/sale_order.py +++ b/l10n_br_delivery/models/sale_order.py @@ -1,28 +1,13 @@ # Copyright 2020 KMEE INFORMATICA LTDA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import api, fields, models, _ - +from odoo import _, api, models from odoo.exceptions import UserError class SaleOrder(models.Model): _inherit = 'sale.order' - amount_freight_value = fields.Monetary( - inverse='_inverse_amount_freight', - ) - - amount_insurance_value = fields.Monetary( - inverse='_inverse_amount_insurance', - readonly=False, - ) - - amount_other_value = fields.Monetary( - inverse='_inverse_amount_other', - readonly=False, - ) - @api.multi def set_delivery_line(self): # Remove delivery products from the sales order @@ -43,106 +28,3 @@ def set_delivery_line(self): price_unit = order.carrier_id.rate_shipment(order)['price'] order.amount_freight_value = price_unit return True - - @api.multi - def _inverse_amount_freight(self): - for record in self.filtered(lambda so: so.order_line): - amount_freight_value = record.amount_freight_value - if all(record.order_line.mapped('freight_value')): - amount_freight_old = sum( - record.order_line.mapped('freight_value')) - for line in record.order_line[:-1]: - line.freight_value = amount_freight_value * ( - line.freight_value / amount_freight_old) - record.order_line[-1].freight_value = ( - amount_freight_value - - sum(line.freight_value - for line in record.order_line[:-1]) - ) - else: - amount_total = sum(record.order_line.mapped('price_total')) - for line in record.order_line[:-1]: - line.freight_value = amount_freight_value * ( - line.price_total / amount_total) - record.order_line[-1].freight_value = ( - amount_freight_value - - sum(line.freight_value for line in record.order_line[:-1]) - ) - for line in record.order_line: - line._onchange_fiscal_taxes() - record._fields['amount_total'].compute_value(record) - record.write({ - name: value - for name, value in record._cache.items() - if record._fields[name].compute == '_amount_all' and - not record._fields[name].inverse - }) - - @api.multi - def _inverse_amount_insurance(self): - for record in self.filtered(lambda so: so.order_line): - amount_insurance_value = record.amount_insurance_value - if all(record.order_line.mapped('insurance_value')): - amount_insurance_old = sum( - record.order_line.mapped('insurance_value')) - for line in record.order_line[:-1]: - line.insurance_value = amount_insurance_value * ( - line.insurance_value / amount_insurance_old) - record.order_line[-1].insurance_value = \ - amount_insurance_value - sum( - line.insurance_value - for line in record.order_line[:-1] - ) - else: - amount_total = sum(record.order_line.mapped('price_total')) - for line in record.order_line[:-1]: - line.insurance_value = amount_insurance_value * ( - line.price_total / amount_total) - record.order_line[-1].insurance_value = \ - amount_insurance_value - sum( - line.insurance_value - for line in record.order_line[:-1]) - for line in record.order_line: - line._onchange_fiscal_taxes() - record._fields['amount_total'].compute_value(record) - record.write({ - name: value - for name, value in record._cache.items() - if record._fields[name].compute == '_amount_all' and - not record._fields[name].inverse - }) - - @api.multi - def _inverse_amount_other(self): - for record in self.filtered(lambda so: so.order_line): - amount_other_value = record.amount_other_value - if all(record.order_line.mapped('other_value')): - amount_other_old = sum( - record.order_line.mapped('other_value')) - for line in record.order_line[:-1]: - line.other_value = amount_other_value * ( - line.other_value / amount_other_old) - record.order_line[-1].other_value = ( - amount_other_value - - sum(line.other_value - for line in record.order_line[:-1]) - ) - else: - amount_total = sum(record.order_line.mapped('price_total')) - for line in record.order_line[:-1]: - line.other_value = amount_other_value * ( - line.price_total / amount_total) - record.order_line[-1].other_value = ( - amount_other_value - - sum(line.other_value - for line in record.order_line[:-1]) - ) - for line in record.order_line: - line._onchange_fiscal_taxes() - record._fields['amount_total'].compute_value(record) - record.write({ - name: value - for name, value in record._cache.items() - if record._fields[name].compute == '_amount_all' and - not record._fields[name].inverse - }) From c111db63b7b0ddac9159d60e51d2e7632378d28b Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Mon, 19 Apr 2021 16:59:07 -0300 Subject: [PATCH 134/223] [IMP] Demo data. --- l10n_br_delivery/__manifest__.py | 4 +- l10n_br_delivery/demo/sale_order_demo.xml | 66 +++++++++++++++++++++++ 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 l10n_br_delivery/demo/sale_order_demo.xml diff --git a/l10n_br_delivery/__manifest__.py b/l10n_br_delivery/__manifest__.py index 0a641cd85214..0ecfacf71049 100644 --- a/l10n_br_delivery/__manifest__.py +++ b/l10n_br_delivery/__manifest__.py @@ -18,7 +18,9 @@ 'data': [ 'views/carrier.xml', ], - 'demo': [], + 'demo': [ + 'demo/sale_order_demo.xml', + ], 'category': 'Localization', 'installable': True, } diff --git a/l10n_br_delivery/demo/sale_order_demo.xml b/l10n_br_delivery/demo/sale_order_demo.xml new file mode 100644 index 000000000000..cac40691477d --- /dev/null +++ b/l10n_br_delivery/demo/sale_order_demo.xml @@ -0,0 +1,66 @@ + + + + + + + Main l10n_br_delivery - Produtos + + + + + + + draft + + TESTE + + + + + + Cadeira de Escritório + + 2 + + 500 + out + + + 10 + 20 + 30 + + + + + + + + + + + + + Lâmpada de Escritório + + 2 + + 500 + out + + + 5 + 10 + 15 + + + + + + + + + + + From e26fd1aede48afe3313e375607cbc6caf3b98d05 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Mon, 19 Apr 2021 17:48:07 -0300 Subject: [PATCH 135/223] [REM] Delivery Costs in Fiscal Document should be made by wizard Ratio Costs. --- l10n_br_delivery/models/__init__.py | 1 - l10n_br_delivery/models/document.py | 93 ----------------------------- 2 files changed, 94 deletions(-) delete mode 100644 l10n_br_delivery/models/document.py diff --git a/l10n_br_delivery/models/__init__.py b/l10n_br_delivery/models/__init__.py index 7ac15e6d60d0..0483be4f1593 100644 --- a/l10n_br_delivery/models/__init__.py +++ b/l10n_br_delivery/models/__init__.py @@ -1,4 +1,3 @@ from . import carrier from . import sale_order from . import stock_picking -from . import document diff --git a/l10n_br_delivery/models/document.py b/l10n_br_delivery/models/document.py deleted file mode 100644 index f9a86772d27a..000000000000 --- a/l10n_br_delivery/models/document.py +++ /dev/null @@ -1,93 +0,0 @@ -# Copyright (C) 2020 - Gabriel Cardoso de Faria -# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html - -from odoo import api, fields, models - - -class Document(models.Model): - _inherit = 'l10n_br_fiscal.document' - - amount_freight_value = fields.Monetary( - inverse='_inverse_amount_freight_value' - ) - - amount_other_value = fields.Monetary( - inverse='_inverse_amount_other_value' - ) - - amount_insurance_value = fields.Monetary( - inverse='_inverse_amount_insurance_value' - ) - - @api.multi - def _inverse_amount_freight_value(self): - for record in self.filtered(lambda doc: doc.line_ids): - amount_freight_value = record.amount_freight_value - if all(record.line_ids.mapped('freight_value')): - amount_freight_old = sum( - record.line_ids.mapped('freight_value')) - for line in record.line_ids[:-1]: - line.freight_value = amount_freight_value * ( - line.freight_value / amount_freight_old) - record.line_ids[-1].freight_value = \ - amount_freight_value - sum( - line.freight_value for line in record.line_ids[:-1]) - else: - for line in record.line_ids[:-1]: - line.freight_value = amount_freight_value * ( - line.amount_total / record.amount_total) - record.line_ids[-1].freight_value = \ - amount_freight_value - sum( - line.freight_value for line in record.line_ids[:-1]) - for line in record.line_ids: - line._onchange_fiscal_taxes() - - @api.multi - def _inverse_amount_other_value(self): - for record in self.filtered(lambda doc: doc.line_ids): - amount_other_value = record.amount_other_value - if all(record.line_ids.mapped('other_value')): - amount_freight_old = sum( - record.line_ids.mapped('other_value')) - for line in record.line_ids[:-1]: - line.other_value = amount_other_value * ( - line.other_value / amount_freight_old) - record.line_ids[-1].other_value = \ - amount_other_value - sum( - line.other_value - for line in record.line_ids[:-1]) - else: - for line in record.line_ids[:-1]: - line.other_value = amount_other_value * ( - line.amount_total / record.amount_total) - record.line_ids[-1].other_value = \ - amount_other_value - sum( - line.other_value - for line in record.line_ids[:-1]) - for line in record.line_ids: - line._onchange_fiscal_taxes() - - @api.multi - def _inverse_amount_insurance_value(self): - for record in self.filtered(lambda doc: doc.line_ids): - amount_insurance_value = record.amount_insurance_value - if all(record.line_ids.mapped('insurance_value')): - amount_freight_old = sum( - record.line_ids.mapped('insurance_value')) - for line in record.line_ids[:-1]: - line.insurance_value = amount_insurance_value * ( - line.insurance_value / amount_freight_old) - record.line_ids[-1].insurance_value = \ - amount_insurance_value - sum( - line.insurance_value - for line in record.line_ids[:-1]) - else: - for line in record.line_ids[:-1]: - line.insurance_value = amount_insurance_value * ( - line.amount_total / record.amount_total) - record.line_ids[-1].insurance_value = \ - amount_insurance_value - sum( - line.insurance_value - for line in record.line_ids[:-1]) - for line in record.line_ids: - line._onchange_fiscal_taxes() From fcc5a0cc11c9c984a58d658b143c61dca35546c6 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Mon, 19 Apr 2021 17:51:06 -0300 Subject: [PATCH 136/223] [IMP] Test case where delivery costs Insurance, Freight and Other Costs has different values in lines. --- .../tests/test_delivery_inverse_amount.py | 272 ++++++++++++------ 1 file changed, 188 insertions(+), 84 deletions(-) diff --git a/l10n_br_delivery/tests/test_delivery_inverse_amount.py b/l10n_br_delivery/tests/test_delivery_inverse_amount.py index cec935cf304c..55462aa0a465 100644 --- a/l10n_br_delivery/tests/test_delivery_inverse_amount.py +++ b/l10n_br_delivery/tests/test_delivery_inverse_amount.py @@ -7,7 +7,9 @@ class TestDeliveryInverseAmount(SavepointCase): @classmethod def setUpClass(self): - super(TestDeliveryInverseAmount, self).setUpClass() + super().setUpClass() + + self.sale_demo = self.env.ref('l10n_br_sale.main_so_delivery_costs_1') # Create two sale orders sale_order_form_total = Form(self.env['sale.order'], 'sale.view_order_form') @@ -42,6 +44,8 @@ def setUpClass(self): # Change freight, insurance and other costs amount from # sale_order_lines_id lines + # TODO ?: alterando para permitir edição do campo e não falhar o teste + self.sale_order_line_id.company_id.delivery_costs = 'line' with Form(self.sale_order_line_id) as so: with so.order_line.edit(0) as line: line.freight_value = 70.00 @@ -52,6 +56,8 @@ def setUpClass(self): line.insurance_value = 10.00 line.other_value = 10.00 + # TODO ?: alterando para permitir edição do campo e não falhar o teste + self.sale_order_line_id.company_id.delivery_costs = 'total' with Form(self.sale_order_line_id) as so: so.amount_freight_value = 100.0 so.amount_insurance_value = 100.0 @@ -163,20 +169,22 @@ def test_inverse_amount_freight_total(self): "Unexpected value for the field freight_value from " "Fiscal Document line") - with Form(fiscal_document_id) as doc: - doc.amount_freight_value = 10.0 - - for line in fiscal_document_id.line_ids: - if line.name == '[FURN_7777] Office Chair': - self.assertEqual( - line.freight_value, 6.36, - "Unexpected value for the field freight_value from " - "Fiscal Document line") - if line.name == '[FURN_8888] Office Lamp': - self.assertEqual( - line.freight_value, 3.64, - "Unexpected value for the field freight_value from " - "Fiscal Document line") + # TODO ? : O documento fiscal so permite os valores serem informados + # por linha, pendente wizard p/ informar total e ratear por linhas + # with Form(fiscal_document_id) as doc: + # doc.amount_freight_value = 10.0 + + # for line in fiscal_document_id.line_ids: + # if line.name == '[FURN_7777] Office Chair': + # self.assertEqual( + # line.freight_value, 6.36, + # "Unexpected value for the field freight_value from " + # "Fiscal Document line") + # if line.name == '[FURN_8888] Office Lamp': + # self.assertEqual( + # line.freight_value, 3.64, + # "Unexpected value for the field freight_value from " + # "Fiscal Document line") def test_inverse_amount_freight_line(self): """Check Fiscal Document freight values for lines""" @@ -199,20 +207,22 @@ def test_inverse_amount_freight_line(self): "Unexpected value for the field freight_value from " "Fiscal Document line") - with Form(fiscal_document_id) as doc: - doc.amount_freight_value = 10.0 - - for line in fiscal_document_id.line_ids: - if line.name == '[FURN_7777] Office Chair': - self.assertEqual( - line.freight_value, 8.75, - "Unexpected value for the field freight_value from " - "Fiscal Document line") - if line.name == '[FURN_8888] Office Lamp': - self.assertEqual( - line.freight_value, 1.25, - "Unexpected value for the field freight_value from " - "Fiscal Document line") + # TODO ? : O documento fiscal so permite os valores serem informados + # por linha, pendente wizard p/ informar total e ratear por linhas + # with Form(fiscal_document_id) as doc: + # doc.amount_freight_value = 10.0 + + # for line in fiscal_document_id.line_ids: + # if line.name == '[FURN_7777] Office Chair': + # self.assertEqual( + # line.freight_value, 8.75, + # "Unexpected value for the field freight_value from " + # "Fiscal Document line") + # if line.name == '[FURN_8888] Office Lamp': + # self.assertEqual( + # line.freight_value, 1.25, + # "Unexpected value for the field freight_value from " + # "Fiscal Document line") def test_inverse_amount_insurance_total(self): """Check Fiscal Document insurance values for total""" @@ -235,20 +245,22 @@ def test_inverse_amount_insurance_total(self): "Unexpected value for the field insurance_value from " "Fiscal Document line") - with Form(fiscal_document_id) as doc: - doc.amount_insurance_value = 10.0 - - for line in fiscal_document_id.line_ids: - if line.name == '[FURN_7777] Office Chair': - self.assertEqual( - line.insurance_value, 6.36, - "Unexpected value for the field insurance_value from " - "Fiscal Document line") - if line.name == '[FURN_8888] Office Lamp': - self.assertEqual( - line.insurance_value, 3.64, - "Unexpected value for the field insurance_value from " - "Fiscal Document line") + # TODO ? : O documento fiscal so permite os valores serem informados + # por linha, pendente wizard p/ informar total e ratear por linhas + # with Form(fiscal_document_id) as doc: + # doc.amount_insurance_value = 10.0 + + # for line in fiscal_document_id.line_ids: + # if line.name == '[FURN_7777] Office Chair': + # self.assertEqual( + # line.insurance_value, 6.36, + # "Unexpected value for the field insurance_value from " + # "Fiscal Document line") + # if line.name == '[FURN_8888] Office Lamp': + # self.assertEqual( + # line.insurance_value, 3.64, + # "Unexpected value for the field insurance_value from " + # "Fiscal Document line") def test_inverse_amount_insurance_line(self): """Check Fiscal Document insurance values for lines""" @@ -271,20 +283,22 @@ def test_inverse_amount_insurance_line(self): "Unexpected value for the field insurance_value from " "Fiscal Document line") - with Form(fiscal_document_id) as doc: - doc.amount_insurance_value = 10.0 - - for line in fiscal_document_id.line_ids: - if line.name == '[FURN_7777] Office Chair': - self.assertEqual( - line.insurance_value, 8.75, - "Unexpected value for the field insurance_value from " - "Fiscal Document line") - if line.name == '[FURN_8888] Office Lamp': - self.assertEqual( - line.insurance_value, 1.25, - "Unexpected value for the field insurance_value from " - "Fiscal Document line") + # TODO ? : O documento fiscal so permite os valores serem informados + # por linha, pendente wizard p/ informar total e ratear por linhas + # with Form(fiscal_document_id) as doc: + # doc.amount_insurance_value = 10.0 + + # for line in fiscal_document_id.line_ids: + # if line.name == '[FURN_7777] Office Chair': + # self.assertEqual( + # line.insurance_value, 8.75, + # "Unexpected value for the field insurance_value from " + # "Fiscal Document line") + # if line.name == '[FURN_8888] Office Lamp': + # self.assertEqual( + # line.insurance_value, 1.25, + # "Unexpected value for the field insurance_value from " + # "Fiscal Document line") def test_inverse_amount_other_costs_total(self): """Check Fiscal Document other costs values for total""" @@ -307,20 +321,22 @@ def test_inverse_amount_other_costs_total(self): "Unexpected value for the field other_value from " "Fiscal Document line") - with Form(fiscal_document_id) as doc: - doc.amount_other_value = 10.0 - - for line in fiscal_document_id.line_ids: - if line.name == '[FURN_7777] Office Chair': - self.assertEqual( - line.other_value, 6.36, - "Unexpected value for the field other_value from " - "Fiscal Document line") - if line.name == '[FURN_8888] Office Lamp': - self.assertEqual( - line.other_value, 3.64, - "Unexpected value for the field other_value from " - "Fiscal Document line") + # TODO ? : O documento fiscal so permite os valores serem informados + # por linha, pendente wizard p/ informar total e ratear por linhas + # with Form(fiscal_document_id) as doc: + # doc.amount_other_value = 10.0 + + # for line in fiscal_document_id.line_ids: + # if line.name == '[FURN_7777] Office Chair': + # self.assertEqual( + # line.other_value, 6.36, + # "Unexpected value for the field other_value from " + # "Fiscal Document line") + # if line.name == '[FURN_8888] Office Lamp': + # self.assertEqual( + # line.other_value, 3.64, + # "Unexpected value for the field other_value from " + # "Fiscal Document line") def test_inverse_amount_other_line(self): """Check Fiscal Document other other values for lines""" @@ -343,17 +359,105 @@ def test_inverse_amount_other_line(self): "Unexpected value for the field other_value from " "Fiscal Document line") - with Form(fiscal_document_id) as doc: - doc.amount_other_value = 10.0 + # TODO ? : O documento fiscal so permite os valores serem informados + # por linha, pendente wizard p/ informar total e ratear por linhas + # with Form(fiscal_document_id) as doc: + # doc.amount_other_value = 10.0 + + # for line in fiscal_document_id.line_ids: + # if line.name == '[FURN_7777] Office Chair': + # self.assertEqual( + # line.other_value, 8.75, + # "Unexpected value for the field other_value from " + # "Fiscal Document line") + # if line.name == '[FURN_8888] Office Lamp': + # self.assertEqual( + # line.other_value, 1.25, + # "Unexpected value for the field other_value from " + # "Fiscal Document line") + + def test_not_cost_ratio_by_lines(self): + """ + Teste quando não deve acontecer divisão proporcional entre os valores, + de Frete, Seguro e Outros Custos, esses valores nas linhas devem ser + independentes. + """ + self.sale_demo.company_id.delivery_costs = 'line' + self.sale_demo.action_confirm() - for line in fiscal_document_id.line_ids: - if line.name == '[FURN_7777] Office Chair': - self.assertEqual( - line.other_value, 8.75, - "Unexpected value for the field other_value from " - "Fiscal Document line") - if line.name == '[FURN_8888] Office Lamp': - self.assertEqual( - line.other_value, 1.25, - "Unexpected value for the field other_value from " - "Fiscal Document line") + self.assertEqual( + self.sale_demo.amount_freight_value, 30.0, + 'Unexpected value for the field amount_freight from Sale Order') + self.assertEqual( + self.sale_demo.amount_insurance_value, 45.0, + 'Unexpected value for the field amount_insurance from Sale Order') + self.assertEqual( + self.sale_demo.amount_other_value, 15.0, + 'Unexpected value for the field amount_costs from Sale Order') + for l in self.sale_demo.order_line: + other_line = self.sale_demo.order_line.filtered( + lambda o_l: o_l.id != l.id ) + self.assertNotEqual( + l.freight_value, other_line.freight_value, + 'Value freight_value should not be has same value in lines.') + self.assertNotEqual( + l.insurance_value, other_line.insurance_value, + 'Value insurance_value should not be has same value in lines.') + self.assertNotEqual( + l.other_value, other_line.other_value, + 'Value other_value should not be has same value in lines.') + + picking = self.sale_demo.picking_ids + # Check product availability + picking.action_assign() + # Force product availability + for move in picking.move_ids_without_package: + move.quantity_done = move.product_uom_qty + picking.button_validate() + self.assertEqual(picking.state, 'done') + + self.sale_demo.action_invoice_create(final=True) + + self.assertEquals( + self.sale_demo.state, 'sale', 'Error to confirm Sale Order.' + ) + + invoice = self.sale_demo.invoice_ids[0] + invoice.action_invoice_open() + self.assertEquals( + invoice.state, "open", "Invoice should be in state Open" + ) + for l in invoice.invoice_line_ids: + other_line = invoice.invoice_line_ids.filtered( + lambda o_l: o_l.id != l.id ) + self.assertNotEqual( + l.freight_value, other_line.freight_value, + 'Value freight_value should not be has same value' + ' in invoice lines.') + self.assertNotEqual( + l.insurance_value, other_line.insurance_value, + 'Value insurance_value should not be has same value' + ' in invoice lines.') + self.assertNotEqual( + l.other_value, other_line.other_value, + 'Value other_value should not be has same value' + ' in invoice lines.') + + fiscal_document_id = \ + self.sale_demo.invoice_ids[0].fiscal_document_id + + for l in fiscal_document_id.line_ids: + other_line = fiscal_document_id.line_ids.filtered( + lambda o_l: o_l.id != l.id ) + self.assertNotEqual( + l.freight_value, other_line.freight_value, + 'Value freight_value should not be has same value' + ' in invoice lines.') + self.assertNotEqual( + l.insurance_value, other_line.insurance_value, + 'Value insurance_value should not be has same value' + ' in invoice lines.') + self.assertNotEqual( + l.other_value, other_line.other_value, + 'Value other_value should not be has same value' + ' in invoice lines.') From cb974be04152d8c6d4a7f5433e2d4bc86219cc4b Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Mon, 19 Apr 2021 17:53:17 -0300 Subject: [PATCH 137/223] [FIX] Put back objects l10n_br_delivery.carrier.vehicle and l10n_br_delivery.shipment missing during the migration. --- l10n_br_delivery/__manifest__.py | 4 ++ l10n_br_delivery/models/__init__.py | 1 + l10n_br_delivery/models/l10n_br_delivery.py | 45 ++++++++++++++++ l10n_br_delivery/security/ir.model.access.csv | 11 ++++ .../views/l10n_br_delivery_view.xml | 54 +++++++++++++++++++ 5 files changed, 115 insertions(+) create mode 100644 l10n_br_delivery/models/l10n_br_delivery.py create mode 100644 l10n_br_delivery/security/ir.model.access.csv create mode 100644 l10n_br_delivery/views/l10n_br_delivery_view.xml diff --git a/l10n_br_delivery/__manifest__.py b/l10n_br_delivery/__manifest__.py index 0ecfacf71049..7ebee60b3a57 100644 --- a/l10n_br_delivery/__manifest__.py +++ b/l10n_br_delivery/__manifest__.py @@ -16,7 +16,11 @@ 'delivery', ], 'data': [ + # View 'views/carrier.xml', + 'views/l10n_br_delivery_view.xml', + # Security + 'security/ir.model.access.csv', ], 'demo': [ 'demo/sale_order_demo.xml', diff --git a/l10n_br_delivery/models/__init__.py b/l10n_br_delivery/models/__init__.py index 0483be4f1593..59776468d18d 100644 --- a/l10n_br_delivery/models/__init__.py +++ b/l10n_br_delivery/models/__init__.py @@ -1,3 +1,4 @@ from . import carrier from . import sale_order from . import stock_picking +from . import l10n_br_delivery diff --git a/l10n_br_delivery/models/l10n_br_delivery.py b/l10n_br_delivery/models/l10n_br_delivery.py new file mode 100644 index 000000000000..416a6061d987 --- /dev/null +++ b/l10n_br_delivery/models/l10n_br_delivery.py @@ -0,0 +1,45 @@ +# Copyright (C) 2010 Renato Lima - Akretion +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from odoo import models, fields + + +class L10nBrDeliveryCarrierVehicle(models.Model): + _name = 'l10n_br_delivery.carrier.vehicle' + _description = 'Veiculos das transportadoras' + + name = fields.Char('Nome', required=True, size=32) + description = fields.Char(u'Descrição', size=132) + plate = fields.Char('Placa', size=7) + driver = fields.Char('Condudor', size=64) + rntc_code = fields.Char('Codigo ANTT', size=32) + country_id = fields.Many2one('res.country', 'País') + state_id = fields.Many2one( + 'res.country.state', 'Estado', + domain="[('country_id', '=', country_id)]") + l10n_br_city_id = fields.Many2one( + 'res.city', 'Municipio', + domain="[('state_id','=',state_id)]") + active = fields.Boolean('Ativo') + manufacture_year = fields.Char(u'Ano de Fabricação', size=4) + model_year = fields.Char('Ano do Modelo', size=4) + type = fields.Selection([('bau', u'Caminhão Baú')], 'Tipo do Modelo') + carrier_id = fields.Many2one( + 'delivery.carrier', 'Carrier', index=True, + required=True, ondelete='cascade') + + +class L10nBrDeliveryShipment(models.Model): + _name = 'l10n_br_delivery.shipment' + _description = 'Carga/Remessa/Transporte/?' + + code = fields.Char('Nome', size=32) + description = fields.Char('Descrição', size=132) + carrier_id = fields.Many2one( + 'delivery.carrier', 'Carrier', index=True, required=True) + vehicle_id = fields.Many2one( + 'l10n_br_delivery.carrier.vehicle', 'Vehicle', + index=True, required=True) + volume = fields.Float('Volume') + carrier_tracking_ref = fields.Char('Carrier Tracking Ref', size=32) + number_of_packages = fields.Integer('Number of Packages') diff --git a/l10n_br_delivery/security/ir.model.access.csv b/l10n_br_delivery/security/ir.model.access.csv new file mode 100644 index 000000000000..55751029f6c3 --- /dev/null +++ b/l10n_br_delivery/security/ir.model.access.csv @@ -0,0 +1,11 @@ +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +"access_l10n_br_delivery_carrier_vehicle_sale","l10n_br_delivery_carrier_vehicle","model_l10n_br_delivery_carrier_vehicle","sales_team.group_sale_salesman",1,0,0,0 +"access_l10n_br_delivery_carrier_vehicle_sale_manager","l10n_br_delivery_carrier_vehicle","model_l10n_br_delivery_carrier_vehicle","sales_team.group_sale_manager",1,0,0,0 +"access_l10n_br_delivery_carrier_vehicle_partner_manager","l10n_br_delivery_carrier_vehicle","model_l10n_br_delivery_carrier_vehicle","base.group_partner_manager",1,0,0,0 +"access_l10n_br_delivery_carrier_vehicle_stock_user","l10n_br_delivery_carrier_vehicle","model_l10n_br_delivery_carrier_vehicle","stock.group_stock_user",1,0,0,0 +"access_l10n_br_delivery_carrier_vehicle_stock_manager","l10n_br_delivery_carrier_vehicle","model_l10n_br_delivery_carrier_vehicle","stock.group_stock_manager",1,1,1,1 +"access_l10n_br_delivery_shipment_sale","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","sales_team.group_sale_salesman",1,0,0,0 +"access_l10n_br_delivery_shipment_sale_manager","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","sales_team.group_sale_manager",1,0,0,0 +"access_l10n_br_delivery_shipment_partner_manager","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","base.group_partner_manager",1,0,0,0 +"access_l10n_br_delivery_shipment_stock_user","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","stock.group_stock_user",1,0,0,0 +"access_l10n_br_delivery_shipment_stock_manager","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","stock.group_stock_manager",1,1,1,1 \ No newline at end of file diff --git a/l10n_br_delivery/views/l10n_br_delivery_view.xml b/l10n_br_delivery/views/l10n_br_delivery_view.xml new file mode 100644 index 000000000000..75c4a6756c59 --- /dev/null +++ b/l10n_br_delivery/views/l10n_br_delivery_view.xml @@ -0,0 +1,54 @@ + + + + + + l10n_br_delivery.carrier.vehicle.form + l10n_br_delivery.carrier.vehicle + form + +
+ + + + + + + + + + + + + + + + + +
+ + + l10n_br_delivery.carrier.vehicle.tree + l10n_br_delivery.carrier.vehicle + tree + + + + + + + + + + + Veículo + ir.actions.act_window + l10n_br_delivery.carrier.vehicle + tree,form + form + + + + + +
From 7024ed2b19684ef008b8f764ac316491cdd9e9a8 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Mon, 19 Apr 2021 19:57:55 -0300 Subject: [PATCH 138/223] [FIX] PEP8 and test. --- l10n_br_delivery/tests/test_delivery_inverse_amount.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/l10n_br_delivery/tests/test_delivery_inverse_amount.py b/l10n_br_delivery/tests/test_delivery_inverse_amount.py index 55462aa0a465..2419e1b855b3 100644 --- a/l10n_br_delivery/tests/test_delivery_inverse_amount.py +++ b/l10n_br_delivery/tests/test_delivery_inverse_amount.py @@ -9,7 +9,7 @@ class TestDeliveryInverseAmount(SavepointCase): def setUpClass(self): super().setUpClass() - self.sale_demo = self.env.ref('l10n_br_sale.main_so_delivery_costs_1') + self.sale_demo = self.env.ref('l10n_br_delivery.main_so_delivery_1') # Create two sale orders sale_order_form_total = Form(self.env['sale.order'], 'sale.view_order_form') @@ -396,7 +396,7 @@ def test_not_cost_ratio_by_lines(self): 'Unexpected value for the field amount_costs from Sale Order') for l in self.sale_demo.order_line: other_line = self.sale_demo.order_line.filtered( - lambda o_l: o_l.id != l.id ) + lambda o_l: o_l.id != l.id) self.assertNotEqual( l.freight_value, other_line.freight_value, 'Value freight_value should not be has same value in lines.') @@ -429,7 +429,7 @@ def test_not_cost_ratio_by_lines(self): ) for l in invoice.invoice_line_ids: other_line = invoice.invoice_line_ids.filtered( - lambda o_l: o_l.id != l.id ) + lambda o_l: o_l.id != l.id) self.assertNotEqual( l.freight_value, other_line.freight_value, 'Value freight_value should not be has same value' @@ -448,7 +448,7 @@ def test_not_cost_ratio_by_lines(self): for l in fiscal_document_id.line_ids: other_line = fiscal_document_id.line_ids.filtered( - lambda o_l: o_l.id != l.id ) + lambda o_l: o_l.id != l.id) self.assertNotEqual( l.freight_value, other_line.freight_value, 'Value freight_value should not be has same value' From 10386780f9d5e8164ef7ab3474cc4fdb7b4c3e36 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Sat, 24 Apr 2021 17:48:56 -0300 Subject: [PATCH 139/223] [REF] l10n_br_delivery objects --- l10n_br_delivery/models/l10n_br_delivery.py | 134 +++++++++++++++----- 1 file changed, 105 insertions(+), 29 deletions(-) diff --git a/l10n_br_delivery/models/l10n_br_delivery.py b/l10n_br_delivery/models/l10n_br_delivery.py index 416a6061d987..4d35bac69944 100644 --- a/l10n_br_delivery/models/l10n_br_delivery.py +++ b/l10n_br_delivery/models/l10n_br_delivery.py @@ -4,42 +4,118 @@ from odoo import models, fields -class L10nBrDeliveryCarrierVehicle(models.Model): +class CarrierVehicle(models.Model): _name = 'l10n_br_delivery.carrier.vehicle' - _description = 'Veiculos das transportadoras' - - name = fields.Char('Nome', required=True, size=32) - description = fields.Char(u'Descrição', size=132) - plate = fields.Char('Placa', size=7) - driver = fields.Char('Condudor', size=64) - rntc_code = fields.Char('Codigo ANTT', size=32) - country_id = fields.Many2one('res.country', 'País') + _description = 'Carrier Vehicle' + + name = fields.Char( + string='Name', + required=True, + size=32 + ) + + description = fields.Char( + string='Description', + size=132, + ) + + plate = fields.Char( + string='Placa', + size=7, + ) + + driver = fields.Char( + string='Driver', + size=64, + ) + + rntc_code = fields.Char( + string='ANTT Code', + size=32, + ) + + country_id = fields.Many2one( + comodel_name='res.country', + string='Country', + ) + state_id = fields.Many2one( - 'res.country.state', 'Estado', - domain="[('country_id', '=', country_id)]") + comodel_name='res.country.state', + string='State', + domain="[('country_id', '=', country_id)]", + ) + l10n_br_city_id = fields.Many2one( - 'res.city', 'Municipio', - domain="[('state_id','=',state_id)]") - active = fields.Boolean('Ativo') - manufacture_year = fields.Char(u'Ano de Fabricação', size=4) - model_year = fields.Char('Ano do Modelo', size=4) - type = fields.Selection([('bau', u'Caminhão Baú')], 'Tipo do Modelo') + comodel_name='res.city', + string='City', + domain="[('state_id', '=', state_id)]", + ) + + active = fields.Boolean( + string='Active', + ) + + manufacture_year = fields.Char( + string='Ano de Fabricação', + size=4, + ) + + model_year = fields.Char( + string='Ano do Modelo', + size=4, + ) + + type = fields.Selection( + selection=[('bau', 'Caminhão Baú')], + string='Model Type', + ) + carrier_id = fields.Many2one( - 'delivery.carrier', 'Carrier', index=True, - required=True, ondelete='cascade') + comodel_nam'delivery.carrier', + string='Carrier', + index=True, + required=True, + ondelete='cascade', + ) -class L10nBrDeliveryShipment(models.Model): +class DeliveryShipment(models.Model): _name = 'l10n_br_delivery.shipment' - _description = 'Carga/Remessa/Transporte/?' + _description = 'Delivery Shipment' + + code = fields.Char( + string='Name', + size=32, + ) + + description = fields.Char( + string='Description', + size=132, + ) - code = fields.Char('Nome', size=32) - description = fields.Char('Descrição', size=132) carrier_id = fields.Many2one( - 'delivery.carrier', 'Carrier', index=True, required=True) + comodel_name='delivery.carrier', + string='Carrier', + index=True, + required=True, + ) + vehicle_id = fields.Many2one( - 'l10n_br_delivery.carrier.vehicle', 'Vehicle', - index=True, required=True) - volume = fields.Float('Volume') - carrier_tracking_ref = fields.Char('Carrier Tracking Ref', size=32) - number_of_packages = fields.Integer('Number of Packages') + comodel_name='l10n_br_delivery.carrier.vehicle', + string='Vehicle', + index=True, + required=True, + ) + + volume = fields.Float( + string='Volume', + ) + + carrier_tracking_ref = fields.Char( + string='Carrier Tracking Ref', + size=32, + ) + + number_of_packages = fields.Integer( + string='Number of Packages', + ) From f4cd072a1741d42fd72a366e449298340584259d Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Sat, 24 Apr 2021 18:00:52 -0300 Subject: [PATCH 140/223] [REF] split file by objects --- l10n_br_delivery/models/__init__.py | 5 +- l10n_br_delivery/models/shipment.py | 46 +++++++++++++++++++ .../{l10n_br_delivery.py => vehicle.py} | 44 +----------------- 3 files changed, 51 insertions(+), 44 deletions(-) create mode 100644 l10n_br_delivery/models/shipment.py rename l10n_br_delivery/models/{l10n_br_delivery.py => vehicle.py} (65%) diff --git a/l10n_br_delivery/models/__init__.py b/l10n_br_delivery/models/__init__.py index 59776468d18d..d829465b691c 100644 --- a/l10n_br_delivery/models/__init__.py +++ b/l10n_br_delivery/models/__init__.py @@ -1,4 +1,7 @@ +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + from . import carrier +from . import vehicle +from . import shipment from . import sale_order from . import stock_picking -from . import l10n_br_delivery diff --git a/l10n_br_delivery/models/shipment.py b/l10n_br_delivery/models/shipment.py new file mode 100644 index 000000000000..d6b15c9ed188 --- /dev/null +++ b/l10n_br_delivery/models/shipment.py @@ -0,0 +1,46 @@ +# Copyright (C) 2010 Renato Lima - Akretion +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from odoo import models, fields + + +class DeliveryShipment(models.Model): + _name = 'l10n_br_delivery.shipment' + _description = 'Delivery Shipment' + + code = fields.Char( + string='Name', + size=32, + ) + + description = fields.Char( + string='Description', + size=132, + ) + + carrier_id = fields.Many2one( + comodel_name='delivery.carrier', + string='Carrier', + index=True, + required=True, + ) + + vehicle_id = fields.Many2one( + comodel_name='l10n_br_delivery.carrier.vehicle', + string='Vehicle', + index=True, + required=True, + ) + + volume = fields.Float( + string='Volume', + ) + + carrier_tracking_ref = fields.Char( + string='Carrier Tracking Ref', + size=32, + ) + + number_of_packages = fields.Integer( + string='Number of Packages', + ) diff --git a/l10n_br_delivery/models/l10n_br_delivery.py b/l10n_br_delivery/models/vehicle.py similarity index 65% rename from l10n_br_delivery/models/l10n_br_delivery.py rename to l10n_br_delivery/models/vehicle.py index 4d35bac69944..9597bbdac42f 100644 --- a/l10n_br_delivery/models/l10n_br_delivery.py +++ b/l10n_br_delivery/models/vehicle.py @@ -70,52 +70,10 @@ class CarrierVehicle(models.Model): string='Model Type', ) - carrier_id = fields.Many2one( - comodel_nam'delivery.carrier', - string='Carrier', - index=True, - required=True, - ondelete='cascade', - ) - - -class DeliveryShipment(models.Model): - _name = 'l10n_br_delivery.shipment' - _description = 'Delivery Shipment' - - code = fields.Char( - string='Name', - size=32, - ) - - description = fields.Char( - string='Description', - size=132, - ) - carrier_id = fields.Many2one( comodel_name='delivery.carrier', string='Carrier', index=True, required=True, - ) - - vehicle_id = fields.Many2one( - comodel_name='l10n_br_delivery.carrier.vehicle', - string='Vehicle', - index=True, - required=True, - ) - - volume = fields.Float( - string='Volume', - ) - - carrier_tracking_ref = fields.Char( - string='Carrier Tracking Ref', - size=32, - ) - - number_of_packages = fields.Integer( - string='Number of Packages', + ondelete='cascade', ) From 68888cd8cf9b5d27138b7c18d5d8d099d6b13240 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Tue, 27 Apr 2021 17:23:18 -0300 Subject: [PATCH 141/223] [IMP] Included field for amount weight and volume in sale order. --- l10n_br_delivery/__manifest__.py | 1 + l10n_br_delivery/demo/sale_order_demo.xml | 14 ++++++++++ l10n_br_delivery/models/sale_order.py | 30 +++++++++++++++++++++- l10n_br_delivery/views/sale_order_view.xml | 17 ++++++++++++ 4 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 l10n_br_delivery/views/sale_order_view.xml diff --git a/l10n_br_delivery/__manifest__.py b/l10n_br_delivery/__manifest__.py index 7ebee60b3a57..0b93c68fee57 100644 --- a/l10n_br_delivery/__manifest__.py +++ b/l10n_br_delivery/__manifest__.py @@ -19,6 +19,7 @@ # View 'views/carrier.xml', 'views/l10n_br_delivery_view.xml', + 'views/sale_order_view.xml', # Security 'security/ir.model.access.csv', ], diff --git a/l10n_br_delivery/demo/sale_order_demo.xml b/l10n_br_delivery/demo/sale_order_demo.xml index cac40691477d..e0e689da3352 100644 --- a/l10n_br_delivery/demo/sale_order_demo.xml +++ b/l10n_br_delivery/demo/sale_order_demo.xml @@ -1,6 +1,20 @@ + + + + 3.0 + 1 + + + + + 3.0 + 1 + + + diff --git a/l10n_br_delivery/models/sale_order.py b/l10n_br_delivery/models/sale_order.py index e1c3da9a2e43..cbcb1e76776a 100644 --- a/l10n_br_delivery/models/sale_order.py +++ b/l10n_br_delivery/models/sale_order.py @@ -1,7 +1,7 @@ # Copyright 2020 KMEE INFORMATICA LTDA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import _, api, models +from odoo import _, api, fields, models from odoo.exceptions import UserError @@ -28,3 +28,31 @@ def set_delivery_line(self): price_unit = order.carrier_id.rate_shipment(order)['price'] order.amount_freight_value = price_unit return True + + # TODO: Deveria exisitr o Peso Total Liquido e Peso Total Bruto como era na + # v8, aparetemente agora so existe o campo weight no cadastro do Produto + amount_weight = fields.Float( + string=_('Amount Weight'), + compute='_compute_amount_weight' + ) + + amount_volume = fields.Float( + string=_('Amount Volume'), + compute='_compute_amount_volume' + ) + + def _compute_amount_weight(self): + + for record in self: + amount_weight = 0.0 + for l in record.order_line: + amount_weight += l.product_qty * l.product_id.weight + record.amount_weight = amount_weight + + def _compute_amount_volume(self): + + for record in self: + amount_volume = 0.0 + for l in record.order_line: + amount_volume += l.product_qty * l.product_id.volume + record.amount_volume = amount_volume diff --git a/l10n_br_delivery/views/sale_order_view.xml b/l10n_br_delivery/views/sale_order_view.xml new file mode 100644 index 000000000000..2d1a1f67d4cc --- /dev/null +++ b/l10n_br_delivery/views/sale_order_view.xml @@ -0,0 +1,17 @@ + + + + + l10n_br_delivery.sale.order.form + sale.order + + 99 + + + + + + + + + From b39a4c5068b5eb2811a4d7425a82251cd0a92f95 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 19 May 2021 12:37:31 -0300 Subject: [PATCH 142/223] [FIX] Delivery module has dependency on Sale, this one from Account. --- l10n_br_delivery/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_delivery/__manifest__.py b/l10n_br_delivery/__manifest__.py index 0b93c68fee57..74a8cf79bd84 100644 --- a/l10n_br_delivery/__manifest__.py +++ b/l10n_br_delivery/__manifest__.py @@ -11,7 +11,7 @@ 'website': 'https://github.com/oca/l10n-brazil', 'version': '12.0.3.0.0', 'depends': [ - 'l10n_br_fiscal', + 'l10n_br_account', 'l10n_br_sale_stock', 'delivery', ], From d3a81bd6b1e599fed4e225ab42f274660f390178 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 19 May 2021 13:16:54 -0300 Subject: [PATCH 143/223] [IMP] Information fiscal of freight responsibility can be defined in Incoterm. --- l10n_br_delivery/__manifest__.py | 3 + .../data/account_incoterms_data.xml | 75 +++++++++++++++++++ l10n_br_delivery/models/__init__.py | 1 + l10n_br_delivery/models/account_incoterms.py | 28 +++++++ .../views/account_incoterms_view.xml | 16 ++++ 5 files changed, 123 insertions(+) create mode 100644 l10n_br_delivery/data/account_incoterms_data.xml create mode 100644 l10n_br_delivery/models/account_incoterms.py create mode 100644 l10n_br_delivery/views/account_incoterms_view.xml diff --git a/l10n_br_delivery/__manifest__.py b/l10n_br_delivery/__manifest__.py index 74a8cf79bd84..e3c09ed99d0a 100644 --- a/l10n_br_delivery/__manifest__.py +++ b/l10n_br_delivery/__manifest__.py @@ -16,10 +16,13 @@ 'delivery', ], 'data': [ + # Data + 'data/account_incoterms_data.xml', # View 'views/carrier.xml', 'views/l10n_br_delivery_view.xml', 'views/sale_order_view.xml', + "views/account_incoterms_view.xml", # Security 'security/ir.model.access.csv', ], diff --git a/l10n_br_delivery/data/account_incoterms_data.xml b/l10n_br_delivery/data/account_incoterms_data.xml new file mode 100644 index 000000000000..931e675ab22a --- /dev/null +++ b/l10n_br_delivery/data/account_incoterms_data.xml @@ -0,0 +1,75 @@ + + + + + + + 1 + + + + + + 0 + + + + + diff --git a/l10n_br_delivery/models/__init__.py b/l10n_br_delivery/models/__init__.py index d829465b691c..63e182d3be7b 100644 --- a/l10n_br_delivery/models/__init__.py +++ b/l10n_br_delivery/models/__init__.py @@ -5,3 +5,4 @@ from . import shipment from . import sale_order from . import stock_picking +from . import account_incoterms diff --git a/l10n_br_delivery/models/account_incoterms.py b/l10n_br_delivery/models/account_incoterms.py new file mode 100644 index 000000000000..0a8be7a117a7 --- /dev/null +++ b/l10n_br_delivery/models/account_incoterms.py @@ -0,0 +1,28 @@ +# Copyright (C) 2021-Today - Akretion (). +# @author Magno Costa +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + +# Modalidade do frete +MODFRETE_TRANSP = [ + ('0', '0 - Contratação do Frete por conta do Remetente (CIF)'), + ('1', '1 - Contratação do Frete por conta do' + ' destinatário/remetente (FOB)'), + ('2', '2 - Contratação do Frete por conta de terceiros'), + ('3', '3 - Transporte próprio por conta do remetente'), + ('4', '4 - Transporte próprio por conta do destinatário'), + ('9', '9 - Sem Ocorrência de transporte.'), +] + + +class AccountIncoterms(models.Model): + _inherit = 'account.incoterms' + + freight_responsibility = fields.Selection( + selection=MODFRETE_TRANSP, + string='Frete por Conta', + help='Informação usada na emissão de Documentos Fiscais', + required=True, + default='0' + ) diff --git a/l10n_br_delivery/views/account_incoterms_view.xml b/l10n_br_delivery/views/account_incoterms_view.xml new file mode 100644 index 000000000000..12aebc018372 --- /dev/null +++ b/l10n_br_delivery/views/account_incoterms_view.xml @@ -0,0 +1,16 @@ + + + + + account.incoterms.form + account.incoterms + 10 + + + + + + + + + From 39ebdf2b881c9854c1fe05a45ceb8caf4c81214f Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 19 May 2021 13:20:07 -0300 Subject: [PATCH 144/223] [IMP] Included fields to be able to used at inherit objects. --- l10n_br_delivery/models/__init__.py | 1 + .../models/fiscal_document_mixin.py | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 l10n_br_delivery/models/fiscal_document_mixin.py diff --git a/l10n_br_delivery/models/__init__.py b/l10n_br_delivery/models/__init__.py index 63e182d3be7b..b935d1ee708b 100644 --- a/l10n_br_delivery/models/__init__.py +++ b/l10n_br_delivery/models/__init__.py @@ -6,3 +6,4 @@ from . import sale_order from . import stock_picking from . import account_incoterms +from . import fiscal_document_mixin diff --git a/l10n_br_delivery/models/fiscal_document_mixin.py b/l10n_br_delivery/models/fiscal_document_mixin.py new file mode 100644 index 000000000000..5bae6dca1e49 --- /dev/null +++ b/l10n_br_delivery/models/fiscal_document_mixin.py @@ -0,0 +1,27 @@ +# Copyright (C) 2021-Today - Akretion (). +# @author Magno Costa +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models, _ + + +class FiscalDocumentMixin(models.AbstractModel): + _inherit = 'l10n_br_fiscal.document.mixin' + + def _get_default_incoterm(self): + return self.env.user.company_id.incoterm_id + + # Esta sendo implementado aqui para existir nos objetos herdados + incoterm_id = fields.Many2one( + comodel_name='account.incoterms', + string='Incoterm', + help=_('International Commercial Terms are a series of' + ' predefined commercial terms used in international' + ' transactions.') + ) + + carrier_id = fields.Many2one( + comodel_name='delivery.carrier', + string='Carrier', + ondelete='cascade', + ) From fb8853e83331b26b0744cc8e90fb879d47600aad Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 19 May 2021 13:32:24 -0300 Subject: [PATCH 145/223] [FIX] Incoterm at sale.order is not defined with standard field name incoterm_id. --- l10n_br_delivery/models/sale_order.py | 34 +++++++++++++++++---------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/l10n_br_delivery/models/sale_order.py b/l10n_br_delivery/models/sale_order.py index cbcb1e76776a..d11655c55c23 100644 --- a/l10n_br_delivery/models/sale_order.py +++ b/l10n_br_delivery/models/sale_order.py @@ -8,6 +8,28 @@ class SaleOrder(models.Model): _inherit = 'sale.order' + # TODO: Na v12 o produto possui apenas o campo weight que é referente + # ao Peso Liquido a parametrização do Peso Bruto parece ser feita + # através do cadastro de embalagens + amount_weight = fields.Float( + string=_('Amount Weight'), + compute='_compute_amount_weight' + ) + + amount_volume = fields.Float( + string=_('Amount Volume'), + compute='_compute_amount_volume' + ) + + # Devido o campo no sale_order chamar apenas incoterm + # ao inves de incoterm_id como o padrão, a copia do + # arquivo não acontece, por isso é preciso fazer o + # related abaixo + # TODO: Verificar na migração se isso foi alterado + incoterm_id = fields.Many2one( + related='incoterm' + ) + @api.multi def set_delivery_line(self): # Remove delivery products from the sales order @@ -29,18 +51,6 @@ def set_delivery_line(self): order.amount_freight_value = price_unit return True - # TODO: Deveria exisitr o Peso Total Liquido e Peso Total Bruto como era na - # v8, aparetemente agora so existe o campo weight no cadastro do Produto - amount_weight = fields.Float( - string=_('Amount Weight'), - compute='_compute_amount_weight' - ) - - amount_volume = fields.Float( - string=_('Amount Volume'), - compute='_compute_amount_volume' - ) - def _compute_amount_weight(self): for record in self: From 8239ea46b0b6aa6611ce47919be64aae03e60ad7 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 19 May 2021 13:34:14 -0300 Subject: [PATCH 146/223] [IMP] Included incoterm at stock picking view. --- l10n_br_delivery/__manifest__.py | 1 + l10n_br_delivery/views/stock_picking_view.xml | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 l10n_br_delivery/views/stock_picking_view.xml diff --git a/l10n_br_delivery/__manifest__.py b/l10n_br_delivery/__manifest__.py index e3c09ed99d0a..56405ec88ffc 100644 --- a/l10n_br_delivery/__manifest__.py +++ b/l10n_br_delivery/__manifest__.py @@ -23,6 +23,7 @@ 'views/l10n_br_delivery_view.xml', 'views/sale_order_view.xml', "views/account_incoterms_view.xml", + 'views/stock_picking_view.xml', # Security 'security/ir.model.access.csv', ], diff --git a/l10n_br_delivery/views/stock_picking_view.xml b/l10n_br_delivery/views/stock_picking_view.xml new file mode 100644 index 000000000000..493a9d84e055 --- /dev/null +++ b/l10n_br_delivery/views/stock_picking_view.xml @@ -0,0 +1,16 @@ + + + + + l10n_br_delivery.picking.form + stock.picking + + 99 + + + + + + + + From 51db78c7eb88a30ff8142fa8e90a72b37c9425b3 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 19 May 2021 13:39:14 -0300 Subject: [PATCH 147/223] [IMP] Defined to show Incoterm at Sale Order and Invoice. --- l10n_br_delivery/__manifest__.py | 1 + l10n_br_delivery/data/res_config_settings_data.xml | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 l10n_br_delivery/data/res_config_settings_data.xml diff --git a/l10n_br_delivery/__manifest__.py b/l10n_br_delivery/__manifest__.py index 56405ec88ffc..9805617dbb04 100644 --- a/l10n_br_delivery/__manifest__.py +++ b/l10n_br_delivery/__manifest__.py @@ -17,6 +17,7 @@ ], 'data': [ # Data + 'data/res_config_settings_data.xml', 'data/account_incoterms_data.xml', # View 'views/carrier.xml', diff --git a/l10n_br_delivery/data/res_config_settings_data.xml b/l10n_br_delivery/data/res_config_settings_data.xml new file mode 100644 index 000000000000..ac5ff62e406e --- /dev/null +++ b/l10n_br_delivery/data/res_config_settings_data.xml @@ -0,0 +1,13 @@ + + + + + True + + + + + + + From 9cad04448b9344d481520cc70e2c0cfecf41d136 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 19 May 2021 14:43:19 -0300 Subject: [PATCH 148/223] [IMP] Demo data. --- l10n_br_delivery/__manifest__.py | 1 + .../demo/l10n_br_delivery_demo.xml | 80 +++++++++++++++++++ l10n_br_delivery/demo/sale_order_demo.xml | 23 ++---- 3 files changed, 86 insertions(+), 18 deletions(-) create mode 100644 l10n_br_delivery/demo/l10n_br_delivery_demo.xml diff --git a/l10n_br_delivery/__manifest__.py b/l10n_br_delivery/__manifest__.py index 9805617dbb04..5e5af0254ec1 100644 --- a/l10n_br_delivery/__manifest__.py +++ b/l10n_br_delivery/__manifest__.py @@ -29,6 +29,7 @@ 'security/ir.model.access.csv', ], 'demo': [ + 'demo/l10n_br_delivery_demo.xml', 'demo/sale_order_demo.xml', ], 'category': 'Localization', diff --git a/l10n_br_delivery/demo/l10n_br_delivery_demo.xml b/l10n_br_delivery/demo/l10n_br_delivery_demo.xml new file mode 100644 index 000000000000..51c45495edd8 --- /dev/null +++ b/l10n_br_delivery/demo/l10n_br_delivery_demo.xml @@ -0,0 +1,80 @@ + + + + + + Transportadora - Teste + Transportadora - Teste + 21.221.265/0001-90 + Estrada do Caminho Velho + 1 + Jardim Nova Cidade + + + + 07252-312 + + www.transportadora.com.br + (11) 9999-9999 + teste@teste.com.br + 115.106.496.207 + + + + + + + + + Teste - l10n_br_delivery + 10.0 + 3 + fixed + + + + + + + + Starting Inventory - l10n_br_delivery + + + + + + + + + 100 + + + + + + + + 100 + + + + + + + + + + + 3.0 + 1 + + + + + 3.0 + 1 + + + diff --git a/l10n_br_delivery/demo/sale_order_demo.xml b/l10n_br_delivery/demo/sale_order_demo.xml index e0e689da3352..0e471aa911a9 100644 --- a/l10n_br_delivery/demo/sale_order_demo.xml +++ b/l10n_br_delivery/demo/sale_order_demo.xml @@ -1,22 +1,7 @@ - - - - 3.0 - 1 - - - - - 3.0 - 1 - - - - - + Main l10n_br_delivery - Produtos @@ -29,11 +14,13 @@ TESTE + + - Cadeira de Escritório + Office Chair 2 @@ -56,7 +43,7 @@ - Lâmpada de Escritório + Office Lamp 2 From b725436ffa630bd26d4b0cb25c7dce6c8fe1f9f7 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 19 May 2021 18:05:40 -0300 Subject: [PATCH 149/223] [FIX] Flake8. --- l10n_br_delivery/models/fiscal_document_mixin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/l10n_br_delivery/models/fiscal_document_mixin.py b/l10n_br_delivery/models/fiscal_document_mixin.py index 5bae6dca1e49..2ec785abbce4 100644 --- a/l10n_br_delivery/models/fiscal_document_mixin.py +++ b/l10n_br_delivery/models/fiscal_document_mixin.py @@ -2,11 +2,11 @@ # @author Magno Costa # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import api, fields, models, _ +from odoo import fields, models, _ class FiscalDocumentMixin(models.AbstractModel): - _inherit = 'l10n_br_fiscal.document.mixin' + _inherit = 'l10n_br_fiscal.document.mixin' def _get_default_incoterm(self): return self.env.user.company_id.incoterm_id From 69852c53c2b42dcb37a601d466b2db1e6e89b47b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Wed, 19 May 2021 21:17:35 -0300 Subject: [PATCH 150/223] pylint fixes --- l10n_br_delivery/models/fiscal_document_mixin.py | 6 +++--- l10n_br_delivery/models/sale_order.py | 14 +++++++------- l10n_br_delivery/security/ir.model.access.csv | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/l10n_br_delivery/models/fiscal_document_mixin.py b/l10n_br_delivery/models/fiscal_document_mixin.py index 2ec785abbce4..cb651a59b109 100644 --- a/l10n_br_delivery/models/fiscal_document_mixin.py +++ b/l10n_br_delivery/models/fiscal_document_mixin.py @@ -2,7 +2,7 @@ # @author Magno Costa # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import fields, models, _ +from odoo import fields, models class FiscalDocumentMixin(models.AbstractModel): @@ -15,9 +15,9 @@ def _get_default_incoterm(self): incoterm_id = fields.Many2one( comodel_name='account.incoterms', string='Incoterm', - help=_('International Commercial Terms are a series of' + help='International Commercial Terms are a series of' ' predefined commercial terms used in international' - ' transactions.') + ' transactions.' ) carrier_id = fields.Many2one( diff --git a/l10n_br_delivery/models/sale_order.py b/l10n_br_delivery/models/sale_order.py index d11655c55c23..0d0a1f370ae0 100644 --- a/l10n_br_delivery/models/sale_order.py +++ b/l10n_br_delivery/models/sale_order.py @@ -1,7 +1,7 @@ # Copyright 2020 KMEE INFORMATICA LTDA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import _, api, fields, models +from odoo import _, fields, models from odoo.exceptions import UserError @@ -12,12 +12,12 @@ class SaleOrder(models.Model): # ao Peso Liquido a parametrização do Peso Bruto parece ser feita # através do cadastro de embalagens amount_weight = fields.Float( - string=_('Amount Weight'), + string='Amount Weight', compute='_compute_amount_weight' ) amount_volume = fields.Float( - string=_('Amount Volume'), + string='Amount Volume', compute='_compute_amount_volume' ) @@ -55,14 +55,14 @@ def _compute_amount_weight(self): for record in self: amount_weight = 0.0 - for l in record.order_line: - amount_weight += l.product_qty * l.product_id.weight + for line in record.order_line: + amount_weight += line.product_qty * line.product_id.weight record.amount_weight = amount_weight def _compute_amount_volume(self): for record in self: amount_volume = 0.0 - for l in record.order_line: - amount_volume += l.product_qty * l.product_id.volume + for line in record.order_line: + amount_volume += line.product_qty * line.product_id.volume record.amount_volume = amount_volume diff --git a/l10n_br_delivery/security/ir.model.access.csv b/l10n_br_delivery/security/ir.model.access.csv index 55751029f6c3..444a862f2876 100644 --- a/l10n_br_delivery/security/ir.model.access.csv +++ b/l10n_br_delivery/security/ir.model.access.csv @@ -8,4 +8,4 @@ "access_l10n_br_delivery_shipment_sale_manager","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","sales_team.group_sale_manager",1,0,0,0 "access_l10n_br_delivery_shipment_partner_manager","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","base.group_partner_manager",1,0,0,0 "access_l10n_br_delivery_shipment_stock_user","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","stock.group_stock_user",1,0,0,0 -"access_l10n_br_delivery_shipment_stock_manager","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","stock.group_stock_manager",1,1,1,1 \ No newline at end of file +"access_l10n_br_delivery_shipment_stock_manager","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","stock.group_stock_manager",1,1,1,1 From bd79d8934b3a80a3e28347ad08f1768defdaa26e Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Fri, 21 May 2021 10:58:50 -0300 Subject: [PATCH 151/223] [FIX] API definition don't needed. --- l10n_br_delivery/models/sale_order.py | 1 - 1 file changed, 1 deletion(-) diff --git a/l10n_br_delivery/models/sale_order.py b/l10n_br_delivery/models/sale_order.py index 0d0a1f370ae0..331488f87c2e 100644 --- a/l10n_br_delivery/models/sale_order.py +++ b/l10n_br_delivery/models/sale_order.py @@ -30,7 +30,6 @@ class SaleOrder(models.Model): related='incoterm' ) - @api.multi def set_delivery_line(self): # Remove delivery products from the sales order self._remove_delivery_line() From b367f71a6410d3222ffd9485235dd94a6f4de416 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Fri, 21 May 2021 11:02:28 -0300 Subject: [PATCH 152/223] [REF] Changed method Delivery Price to get value from amount_freight_value, to don't has different values. --- l10n_br_delivery/models/carrier.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/l10n_br_delivery/models/carrier.py b/l10n_br_delivery/models/carrier.py index b70f24efb0cc..93da13a981e3 100644 --- a/l10n_br_delivery/models/carrier.py +++ b/l10n_br_delivery/models/carrier.py @@ -17,3 +17,22 @@ class Carrier(models.Model): string='Codigo ANTT', size=32, ) + + def rate_shipment(self, order): + """ Compute the price of the order shipment + + :param order: record of sale.order + :return dict: {'success': boolean, + 'price': a float, + 'error_message': a string containing an error message, + 'warning_message': a string containing a warning message} + # TODO maybe the currency code? + """ + self.ensure_one() + res = super().rate_shipment(order) + # TODO: Localização deveria ter uma maior aderencia + # aos metodos do core, mapear melhor os processos, + # com dados de demo e testes. + res['price'] = order.amount_freight_value + + return res From 1db7a42556c680b8e87dd724110380ce20548740 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Fri, 21 May 2021 11:04:48 -0300 Subject: [PATCH 153/223] [FIX+REF] In the tests product should have picking done to create invoice and change self to cls in class method. --- .../tests/test_delivery_inverse_amount.py | 77 ++++++++++--------- 1 file changed, 41 insertions(+), 36 deletions(-) diff --git a/l10n_br_delivery/tests/test_delivery_inverse_amount.py b/l10n_br_delivery/tests/test_delivery_inverse_amount.py index 2419e1b855b3..3390f6953c40 100644 --- a/l10n_br_delivery/tests/test_delivery_inverse_amount.py +++ b/l10n_br_delivery/tests/test_delivery_inverse_amount.py @@ -6,38 +6,38 @@ class TestDeliveryInverseAmount(SavepointCase): @classmethod - def setUpClass(self): + def setUpClass(cls): super().setUpClass() - self.sale_demo = self.env.ref('l10n_br_delivery.main_so_delivery_1') + cls.sale_demo = cls.env.ref('l10n_br_delivery.main_so_delivery_1') # Create two sale orders - sale_order_form_total = Form(self.env['sale.order'], 'sale.view_order_form') - sale_order_form_total.partner_id = self.env.ref( + sale_order_form_total = Form(cls.env['sale.order'], 'sale.view_order_form') + sale_order_form_total.partner_id = cls.env.ref( 'l10n_br_base.res_partner_kmee') - self.sale_order_total_id = sale_order_form_total.save() + cls.sale_order_total_id = sale_order_form_total.save() - sale_order_form_line = Form(self.env['sale.order'], 'sale.view_order_form') - sale_order_form_line.partner_id = self.env.ref( + sale_order_form_line = Form(cls.env['sale.order'], 'sale.view_order_form') + sale_order_form_line.partner_id = cls.env.ref( 'l10n_br_base.res_partner_kmee') - self.sale_order_line_id = sale_order_form_line.save() + cls.sale_order_line_id = sale_order_form_line.save() # Set 2 different products to the sale orders - with Form(self.sale_order_total_id) as so: + with Form(cls.sale_order_total_id) as so: with so.order_line.new() as line: - line.product_id = self.env.ref('product.product_delivery_01') + line.product_id = cls.env.ref('product.product_delivery_01') with so.order_line.new() as line: - line.product_id = self.env.ref('product.product_delivery_02') + line.product_id = cls.env.ref('product.product_delivery_02') - with Form(self.sale_order_line_id) as so: + with Form(cls.sale_order_line_id) as so: with so.order_line.new() as line: - line.product_id = self.env.ref('product.product_delivery_01') + line.product_id = cls.env.ref('product.product_delivery_01') with so.order_line.new() as line: - line.product_id = self.env.ref('product.product_delivery_02') + line.product_id = cls.env.ref('product.product_delivery_02') # Change freight, insurance and other costs amount from # sale_order_total_id - with Form(self.sale_order_total_id) as so: + with Form(cls.sale_order_total_id) as so: so.amount_freight_value = 100.0 so.amount_insurance_value = 100.0 so.amount_other_value = 100.0 @@ -45,8 +45,8 @@ def setUpClass(self): # Change freight, insurance and other costs amount from # sale_order_lines_id lines # TODO ?: alterando para permitir edição do campo e não falhar o teste - self.sale_order_line_id.company_id.delivery_costs = 'line' - with Form(self.sale_order_line_id) as so: + cls.sale_order_line_id.company_id.delivery_costs = 'line' + with Form(cls.sale_order_line_id) as so: with so.order_line.edit(0) as line: line.freight_value = 70.00 line.insurance_value = 70.00 @@ -57,37 +57,42 @@ def setUpClass(self): line.other_value = 10.00 # TODO ?: alterando para permitir edição do campo e não falhar o teste - self.sale_order_line_id.company_id.delivery_costs = 'total' - with Form(self.sale_order_line_id) as so: + cls.sale_order_line_id.company_id.delivery_costs = 'total' + with Form(cls.sale_order_line_id) as so: so.amount_freight_value = 100.0 so.amount_insurance_value = 100.0 so.amount_other_value = 100.0 # Confirm and create invoices for the sale orders - self.sale_order_total_id.action_confirm() - self.sale_order_line_id.action_confirm() + cls.sale_order_total_id.action_confirm() + cls.sale_order_line_id.action_confirm() - for move in self.sale_order_total_id.picking_ids.mapped( - 'move_ids_without_package'): + picking = cls.sale_order_total_id.picking_ids + picking.action_confirm() + # Check product availability + picking.action_assign() + # Force product availability + for move in picking.move_ids_without_package: move.quantity_done = move.product_uom_qty + picking.button_validate() - for move in self.sale_order_line_id.picking_ids.mapped( - 'move_ids_without_package'): + picking = cls.sale_order_line_id.picking_ids + picking.action_confirm() + # Check product availability + picking.action_assign() + # Force product availability + for move in picking.move_ids_without_package: move.quantity_done = move.product_uom_qty + picking.button_validate() - for picking in self.sale_order_total_id.picking_ids.filtered( - lambda p: p.state == 'confirmed'): - picking.button_validate() - - for picking in self.sale_order_line_id.picking_ids.filtered( - lambda p: p.state == 'confirmed'): - picking.button_validate() + for move in picking.move_ids_without_package: + move.quantity_done = move.product_uom_qty - wizard_total = self.env['sale.advance.payment.inv'].with_context( - {'active_ids': self.sale_order_total_id.ids}).create({}) + wizard_total = cls.env['sale.advance.payment.inv'].with_context( + {'active_ids': cls.sale_order_total_id.ids}).create({}) - wizard_line = self.env['sale.advance.payment.inv'].with_context( - {'active_ids': self.sale_order_line_id.ids}).create({}) + wizard_line = cls.env['sale.advance.payment.inv'].with_context( + {'active_ids': cls.sale_order_line_id.ids}).create({}) wizard_total.create_invoices() wizard_line.create_invoices() From fbcec7be588c2250f11fe67ea80d9c091f48ff85 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Thu, 10 Jun 2021 16:29:54 -0300 Subject: [PATCH 154/223] [FIX] Pre commit. --- l10n_br_delivery/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_delivery/__manifest__.py b/l10n_br_delivery/__manifest__.py index 5e5af0254ec1..f247791cc03d 100644 --- a/l10n_br_delivery/__manifest__.py +++ b/l10n_br_delivery/__manifest__.py @@ -8,7 +8,7 @@ standards.""", 'license': 'AGPL-3', 'author': 'Akretion, Odoo Community Association (OCA)', - 'website': 'https://github.com/oca/l10n-brazil', + 'website': 'https://github.com/OCA/l10n-brazil', 'version': '12.0.3.0.0', 'depends': [ 'l10n_br_account', From 518d68446fc27db8d36148b028e31485e6c76df7 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 18 Aug 2021 13:48:26 -0300 Subject: [PATCH 155/223] [FIX] Weight field refers to Gross Weight. --- l10n_br_delivery/models/sale_order.py | 23 ++++++++++++---------- l10n_br_delivery/views/sale_order_view.xml | 2 +- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/l10n_br_delivery/models/sale_order.py b/l10n_br_delivery/models/sale_order.py index 331488f87c2e..44aa17976776 100644 --- a/l10n_br_delivery/models/sale_order.py +++ b/l10n_br_delivery/models/sale_order.py @@ -8,12 +8,15 @@ class SaleOrder(models.Model): _inherit = 'sale.order' - # TODO: Na v12 o produto possui apenas o campo weight que é referente - # ao Peso Liquido a parametrização do Peso Bruto parece ser feita - # através do cadastro de embalagens - amount_weight = fields.Float( - string='Amount Weight', - compute='_compute_amount_weight' + # A partir da v9 existe apenas o campo weight, que é referente ao + # Peso Bruto/Gross Weight https://github.com/OCA/product-attribute/pull/894 + # Caso a implementação precise do Peso Liquido o modulo do link deve ser + # cosiderado. + # Esse modulo l10n_br_delivery é pensando para ter aderencia com o + # product_net_weight (modulo link acima). + amount_gross_weight = fields.Float( + string='Amount Gross Weight', + compute='_compute_amount_gross_weight' ) amount_volume = fields.Float( @@ -50,13 +53,13 @@ def set_delivery_line(self): order.amount_freight_value = price_unit return True - def _compute_amount_weight(self): + def _compute_amount_gross_weight(self): for record in self: - amount_weight = 0.0 + amount_gross_weight = 0.0 for line in record.order_line: - amount_weight += line.product_qty * line.product_id.weight - record.amount_weight = amount_weight + amount_gross_weight += line.product_qty * line.product_id.weight + record.amount_gross_weight = amount_gross_weight def _compute_amount_volume(self): diff --git a/l10n_br_delivery/views/sale_order_view.xml b/l10n_br_delivery/views/sale_order_view.xml index 2d1a1f67d4cc..b5fa1ba4230a 100644 --- a/l10n_br_delivery/views/sale_order_view.xml +++ b/l10n_br_delivery/views/sale_order_view.xml @@ -8,7 +8,7 @@ 99 - + From 9aff92ed9f2c591818d60dc18b699b5ba5843273 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Fri, 20 Aug 2021 10:06:07 -0300 Subject: [PATCH 156/223] [REF] Included dependecy of module delivery_carrier_partner, less code here. --- l10n_br_delivery/__manifest__.py | 1 + l10n_br_delivery/models/carrier.py | 6 ------ l10n_br_delivery/views/carrier.xml | 8 ++++---- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/l10n_br_delivery/__manifest__.py b/l10n_br_delivery/__manifest__.py index f247791cc03d..4ec1d12309a4 100644 --- a/l10n_br_delivery/__manifest__.py +++ b/l10n_br_delivery/__manifest__.py @@ -14,6 +14,7 @@ 'l10n_br_account', 'l10n_br_sale_stock', 'delivery', + 'delivery_carrier_partner', ], 'data': [ # Data diff --git a/l10n_br_delivery/models/carrier.py b/l10n_br_delivery/models/carrier.py index 93da13a981e3..02064698e9ce 100644 --- a/l10n_br_delivery/models/carrier.py +++ b/l10n_br_delivery/models/carrier.py @@ -7,12 +7,6 @@ class Carrier(models.Model): _inherit = 'delivery.carrier' - partner_id = fields.Many2one( - comodel_name='res.partner', - string='Transportadora', - domain=[('supplier', '=', True)], - ) - antt_code = fields.Char( string='Codigo ANTT', size=32, diff --git a/l10n_br_delivery/views/carrier.xml b/l10n_br_delivery/views/carrier.xml index 7a34f1e86d6c..cfafcec5efca 100644 --- a/l10n_br_delivery/views/carrier.xml +++ b/l10n_br_delivery/views/carrier.xml @@ -1,13 +1,13 @@ - + l10n_br_delivery.carrier.form delivery.carrier - + - - + + [('supplier', '=', True)] From e43feee3cf21b87b4ed634a24935282604d739db Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Fri, 20 Aug 2021 10:09:56 -0300 Subject: [PATCH 157/223] [REF] Standard name of files. --- l10n_br_delivery/__manifest__.py | 2 +- l10n_br_delivery/models/__init__.py | 2 +- l10n_br_delivery/models/{carrier.py => delivery_carrier.py} | 0 .../views/{carrier.xml => delivery_carrier_views.xml} | 0 4 files changed, 2 insertions(+), 2 deletions(-) rename l10n_br_delivery/models/{carrier.py => delivery_carrier.py} (100%) rename l10n_br_delivery/views/{carrier.xml => delivery_carrier_views.xml} (100%) diff --git a/l10n_br_delivery/__manifest__.py b/l10n_br_delivery/__manifest__.py index 4ec1d12309a4..7e7bd2641298 100644 --- a/l10n_br_delivery/__manifest__.py +++ b/l10n_br_delivery/__manifest__.py @@ -21,7 +21,7 @@ 'data/res_config_settings_data.xml', 'data/account_incoterms_data.xml', # View - 'views/carrier.xml', + 'views/delivery_carrier_views.xml', 'views/l10n_br_delivery_view.xml', 'views/sale_order_view.xml', "views/account_incoterms_view.xml", diff --git a/l10n_br_delivery/models/__init__.py b/l10n_br_delivery/models/__init__.py index b935d1ee708b..ce6495ec3d4b 100644 --- a/l10n_br_delivery/models/__init__.py +++ b/l10n_br_delivery/models/__init__.py @@ -1,6 +1,6 @@ # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html -from . import carrier +from . import delivery_carrier from . import vehicle from . import shipment from . import sale_order diff --git a/l10n_br_delivery/models/carrier.py b/l10n_br_delivery/models/delivery_carrier.py similarity index 100% rename from l10n_br_delivery/models/carrier.py rename to l10n_br_delivery/models/delivery_carrier.py diff --git a/l10n_br_delivery/views/carrier.xml b/l10n_br_delivery/views/delivery_carrier_views.xml similarity index 100% rename from l10n_br_delivery/views/carrier.xml rename to l10n_br_delivery/views/delivery_carrier_views.xml From 6466a1be95c604fd0816ea60547db312394a94ed Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Fri, 20 Aug 2021 10:27:23 -0300 Subject: [PATCH 158/223] [FIX] Amount Freight informed has preference over value calculate. --- l10n_br_delivery/models/delivery_carrier.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/l10n_br_delivery/models/delivery_carrier.py b/l10n_br_delivery/models/delivery_carrier.py index 02064698e9ce..e6cd9877852b 100644 --- a/l10n_br_delivery/models/delivery_carrier.py +++ b/l10n_br_delivery/models/delivery_carrier.py @@ -27,6 +27,9 @@ def rate_shipment(self, order): # TODO: Localização deveria ter uma maior aderencia # aos metodos do core, mapear melhor os processos, # com dados de demo e testes. - res['price'] = order.amount_freight_value + # Se o Valor Total de Frete estiver preenchido ele tem + # preferencia sobre o valor Calculado. + if order.amount_freight_value > 0.0: + res['price'] = order.amount_freight_value return res From 92e2c1a1ccdc13756d33e540a0f63757241d3689 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Mon, 23 Aug 2021 15:49:38 -0300 Subject: [PATCH 159/223] [REM][WIP] The implementation of Shipment information should be made in Package, for now just removed the object. --- l10n_br_delivery/models/__init__.py | 1 - l10n_br_delivery/models/shipment.py | 46 ------------------- l10n_br_delivery/security/ir.model.access.csv | 5 -- 3 files changed, 52 deletions(-) delete mode 100644 l10n_br_delivery/models/shipment.py diff --git a/l10n_br_delivery/models/__init__.py b/l10n_br_delivery/models/__init__.py index ce6495ec3d4b..8ce15a2bb494 100644 --- a/l10n_br_delivery/models/__init__.py +++ b/l10n_br_delivery/models/__init__.py @@ -2,7 +2,6 @@ from . import delivery_carrier from . import vehicle -from . import shipment from . import sale_order from . import stock_picking from . import account_incoterms diff --git a/l10n_br_delivery/models/shipment.py b/l10n_br_delivery/models/shipment.py deleted file mode 100644 index d6b15c9ed188..000000000000 --- a/l10n_br_delivery/models/shipment.py +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (C) 2010 Renato Lima - Akretion -# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html - -from odoo import models, fields - - -class DeliveryShipment(models.Model): - _name = 'l10n_br_delivery.shipment' - _description = 'Delivery Shipment' - - code = fields.Char( - string='Name', - size=32, - ) - - description = fields.Char( - string='Description', - size=132, - ) - - carrier_id = fields.Many2one( - comodel_name='delivery.carrier', - string='Carrier', - index=True, - required=True, - ) - - vehicle_id = fields.Many2one( - comodel_name='l10n_br_delivery.carrier.vehicle', - string='Vehicle', - index=True, - required=True, - ) - - volume = fields.Float( - string='Volume', - ) - - carrier_tracking_ref = fields.Char( - string='Carrier Tracking Ref', - size=32, - ) - - number_of_packages = fields.Integer( - string='Number of Packages', - ) diff --git a/l10n_br_delivery/security/ir.model.access.csv b/l10n_br_delivery/security/ir.model.access.csv index 444a862f2876..f2e948d64b7f 100644 --- a/l10n_br_delivery/security/ir.model.access.csv +++ b/l10n_br_delivery/security/ir.model.access.csv @@ -4,8 +4,3 @@ "access_l10n_br_delivery_carrier_vehicle_partner_manager","l10n_br_delivery_carrier_vehicle","model_l10n_br_delivery_carrier_vehicle","base.group_partner_manager",1,0,0,0 "access_l10n_br_delivery_carrier_vehicle_stock_user","l10n_br_delivery_carrier_vehicle","model_l10n_br_delivery_carrier_vehicle","stock.group_stock_user",1,0,0,0 "access_l10n_br_delivery_carrier_vehicle_stock_manager","l10n_br_delivery_carrier_vehicle","model_l10n_br_delivery_carrier_vehicle","stock.group_stock_manager",1,1,1,1 -"access_l10n_br_delivery_shipment_sale","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","sales_team.group_sale_salesman",1,0,0,0 -"access_l10n_br_delivery_shipment_sale_manager","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","sales_team.group_sale_manager",1,0,0,0 -"access_l10n_br_delivery_shipment_partner_manager","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","base.group_partner_manager",1,0,0,0 -"access_l10n_br_delivery_shipment_stock_user","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","stock.group_stock_user",1,0,0,0 -"access_l10n_br_delivery_shipment_stock_manager","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","stock.group_stock_manager",1,1,1,1 From bdc00aad878b2332df94a1ecc0fda5ca65f6b2e4 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Mon, 23 Aug 2021 17:43:26 -0300 Subject: [PATCH 160/223] [REF] Relation between Vehicle and Delivery Carrier. --- l10n_br_delivery/models/delivery_carrier.py | 7 +++++++ l10n_br_delivery/models/vehicle.py | 1 - l10n_br_delivery/views/delivery_carrier_views.xml | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/l10n_br_delivery/models/delivery_carrier.py b/l10n_br_delivery/models/delivery_carrier.py index e6cd9877852b..b850b3fe4834 100644 --- a/l10n_br_delivery/models/delivery_carrier.py +++ b/l10n_br_delivery/models/delivery_carrier.py @@ -12,6 +12,13 @@ class Carrier(models.Model): size=32, ) + vehicle_ids = fields.One2many( + comodel_name='l10n_br_delivery.carrier.vehicle', + inverse_name='carrier_id', + string='Vehicles', + ondelete='cascade', + ) + def rate_shipment(self, order): """ Compute the price of the order shipment diff --git a/l10n_br_delivery/models/vehicle.py b/l10n_br_delivery/models/vehicle.py index 9597bbdac42f..05ecff955ce4 100644 --- a/l10n_br_delivery/models/vehicle.py +++ b/l10n_br_delivery/models/vehicle.py @@ -74,6 +74,5 @@ class CarrierVehicle(models.Model): comodel_name='delivery.carrier', string='Carrier', index=True, - required=True, ondelete='cascade', ) diff --git a/l10n_br_delivery/views/delivery_carrier_views.xml b/l10n_br_delivery/views/delivery_carrier_views.xml index cfafcec5efca..818f4f3f82e5 100644 --- a/l10n_br_delivery/views/delivery_carrier_views.xml +++ b/l10n_br_delivery/views/delivery_carrier_views.xml @@ -9,6 +9,10 @@ [('supplier', '=', True)] + + + + From 1038f53451d5e63182289313705323f08853962a Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Mon, 23 Aug 2021 17:59:21 -0300 Subject: [PATCH 161/223] [IMP] Demo data. --- .../demo/l10n_br_delivery_demo.xml | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/l10n_br_delivery/demo/l10n_br_delivery_demo.xml b/l10n_br_delivery/demo/l10n_br_delivery_demo.xml index 51c45495edd8..1d2c891dd8d8 100644 --- a/l10n_br_delivery/demo/l10n_br_delivery_demo.xml +++ b/l10n_br_delivery/demo/l10n_br_delivery_demo.xml @@ -26,6 +26,39 @@ + + + Teste - Veículo da Transportadora 1 + Teste - Veículo da Transportadora 1 + ABC1234 + Teste - Motorista 1 + Teste - Codigo RTNC 1 + + + + + 2000 + 2001 + 2001 + bau + + + + Teste - Veículo da Transportadora 2 + Teste - Veículo da Transportadora 2 + DEF5678 + Teste - Motorista 2 + Teste - Codigo RTNC 2 + + + + + 2010 + 2011 + 2011 + bau + + Teste - l10n_br_delivery @@ -34,6 +67,14 @@ fixed + Teste - Código ANTT + + From 85c07731363556c7d68030526ab0089149547416 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Mon, 23 Aug 2021 18:01:18 -0300 Subject: [PATCH 162/223] [FIX] Depends modules. --- l10n_br_delivery/__manifest__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/l10n_br_delivery/__manifest__.py b/l10n_br_delivery/__manifest__.py index 7e7bd2641298..240004712185 100644 --- a/l10n_br_delivery/__manifest__.py +++ b/l10n_br_delivery/__manifest__.py @@ -11,7 +11,6 @@ 'website': 'https://github.com/OCA/l10n-brazil', 'version': '12.0.3.0.0', 'depends': [ - 'l10n_br_account', 'l10n_br_sale_stock', 'delivery', 'delivery_carrier_partner', From 96d593056a3d8c004bd1981cda44acd7ce496344 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Tue, 24 Aug 2021 05:26:31 +0000 Subject: [PATCH 163/223] [UPD] Update l10n_br_delivery.pot --- l10n_br_delivery/i18n/l10n_br_delivery.pot | 270 +++++++++++++++++++-- 1 file changed, 253 insertions(+), 17 deletions(-) diff --git a/l10n_br_delivery/i18n/l10n_br_delivery.pot b/l10n_br_delivery/i18n/l10n_br_delivery.pot index 0084afd21efc..2680f3138aa3 100644 --- a/l10n_br_delivery/i18n/l10n_br_delivery.pot +++ b/l10n_br_delivery/i18n/l10n_br_delivery.pot @@ -14,39 +14,242 @@ msgstr "" "Plural-Forms: \n" #. module: l10n_br_delivery -#: model:ir.model,name:l10n_br_delivery.model_l10n_br_fiscal_document -msgid "Fiscal Document" +#: selection:account.incoterms,freight_responsibility:0 +msgid "0 - Contratação do Frete por conta do Remetente (CIF)" msgstr "" #. module: l10n_br_delivery -#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_invoice__amount_freight_value -#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__amount_freight_value -#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__amount_freight_value -msgid "Freight Value" +#: selection:account.incoterms,freight_responsibility:0 +msgid "1 - Contratação do Frete por conta do destinatário/remetente (FOB)" msgstr "" #. module: l10n_br_delivery -#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_invoice__amount_insurance_value -#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__amount_insurance_value -#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__amount_insurance_value -msgid "Insurance Value" +#: selection:account.incoterms,freight_responsibility:0 +msgid "2 - Contratação do Frete por conta de terceiros" msgstr "" #. module: l10n_br_delivery -#: code:addons/l10n_br_delivery/models/sale_order.py:37 +#: selection:account.incoterms,freight_responsibility:0 +msgid "3 - Transporte próprio por conta do remetente" +msgstr "" + +#. module: l10n_br_delivery +#: selection:account.incoterms,freight_responsibility:0 +msgid "4 - Transporte próprio por conta do destinatário" +msgstr "" + +#. module: l10n_br_delivery +#: selection:account.incoterms,freight_responsibility:0 +msgid "9 - Sem Ocorrência de transporte." +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__rntc_code +msgid "ANTT Code" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__active +msgid "Active" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__amount_gross_weight +msgid "Amount Gross Weight" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__amount_volume +msgid "Amount Volume" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__manufacture_year +msgid "Ano de Fabricação" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__model_year +msgid "Ano do Modelo" +msgstr "" + +#. module: l10n_br_delivery +#: model:res.partner,nfe40_xPais:l10n_br_delivery.test_carrier +msgid "Brazil" +msgstr "" + +#. module: l10n_br_delivery +#: selection:l10n_br_delivery.carrier.vehicle,type:0 +msgid "Caminhão Baú" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_invoice__carrier_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_contract_contract__carrier_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__carrier_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__carrier_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__carrier_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_purchase_order__carrier_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_repair_order__carrier_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_stock_picking__carrier_id +msgid "Carrier" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model,name:l10n_br_delivery.model_l10n_br_delivery_carrier_vehicle +msgid "Carrier Vehicle" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__l10n_br_city_id +msgid "City" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_delivery_carrier__antt_code +msgid "Codigo ANTT" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__country_id +msgid "Country" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__create_uid +msgid "Created by" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__create_date +msgid "Created on" +msgstr "" + +#. module: l10n_br_delivery +#: model_terms:ir.ui.view,arch_db:l10n_br_delivery.l10n_br_delivery_carrier_vehicle_form +msgid "Dados do Veículo" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__carrier_id +msgid "Delivery Method" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model,name:l10n_br_delivery.model_delivery_carrier +msgid "Delivery Methods" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__description +msgid "Description" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__display_name +msgid "Display Name" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model,name:l10n_br_delivery.model_l10n_br_fiscal_document_mixin +msgid "Document Fiscal Mixin" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__driver +msgid "Driver" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,help:l10n_br_delivery.field_sale_order__carrier_id +msgid "Fill this field if you plan to invoice the shipping based on picking." +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_incoterms__freight_responsibility +msgid "Frete por Conta" +msgstr "" + +#. module: l10n_br_delivery +#: model:res.partner,nfe40_xMun:l10n_br_delivery.test_carrier +msgid "Guarulhos" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__id +msgid "ID" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_contract_contract__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_purchase_order__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_repair_order__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_stock_picking__incoterm_id +msgid "Incoterm" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model,name:l10n_br_delivery.model_account_incoterms +msgid "Incoterms" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,help:l10n_br_delivery.field_account_incoterms__freight_responsibility +msgid "Informação usada na emissão de Documentos Fiscais" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,help:l10n_br_delivery.field_contract_contract__incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_l10n_br_fiscal_document__incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_purchase_order__incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_repair_order__incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_sale_order__incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_stock_picking__incoterm_id +msgid "International Commercial Terms are a series of predefined commercial terms used in international transactions." +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle____last_update +msgid "Last Modified on" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__write_date +msgid "Last Updated on" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__type +msgid "Model Type" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__name +msgid "Name" +msgstr "" + +#. module: l10n_br_delivery +#: code:addons/l10n_br_delivery/models/sale_order.py:46 #, python-format msgid "No carrier set for this order." msgstr "" #. module: l10n_br_delivery -#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_invoice__amount_other_value -#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__amount_other_value -#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__amount_other_value -msgid "Other Costs" +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__plate +msgid "Placa" msgstr "" #. module: l10n_br_delivery -#: code:addons/l10n_br_delivery/models/sale_order.py:39 +#: code:addons/l10n_br_delivery/models/sale_order.py:48 #, python-format msgid "Please use \"Check price\" in order to compute a shipping price for this quotation." msgstr "" @@ -56,14 +259,47 @@ msgstr "" msgid "Sale Order" msgstr "" +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__state_id +msgid "State" +msgstr "" + +#. module: l10n_br_delivery +#: model:delivery.carrier,name:l10n_br_delivery.test_br_delivery_carrier +msgid "Teste - l10n_br_delivery" +msgstr "" + #. module: l10n_br_delivery #: model:ir.model,name:l10n_br_delivery.model_stock_picking msgid "Transfer" msgstr "" #. module: l10n_br_delivery -#: code:addons/l10n_br_delivery/models/sale_order.py:33 +#: model_terms:ir.ui.view,arch_db:l10n_br_delivery.l10n_br_delivery_carrier_vehicle_form +msgid "Transportadora" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_delivery_carrier__vehicle_ids +msgid "Vehicles" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.actions.act_window,name:l10n_br_delivery.action_l10n_br_delivery_carrier_vehicle_form +#: model:ir.ui.menu,name:l10n_br_delivery.menu_l10n_br_delivery_carrier_vehicle_form +#: model_terms:ir.ui.view,arch_db:l10n_br_delivery.l10n_br_delivery_carrier_vehicle_form +#: model_terms:ir.ui.view,arch_db:l10n_br_delivery.l10n_br_delivery_carrier_vehicle_tree +msgid "Veículo" +msgstr "" + +#. module: l10n_br_delivery +#: code:addons/l10n_br_delivery/models/sale_order.py:42 #, python-format msgid "You can add delivery price only on unconfirmed quotations." msgstr "" +#. module: l10n_br_delivery +#: model_terms:ir.ui.view,arch_db:l10n_br_delivery.l10n_br_delivery_carrier_form_view +msgid "[('supplier', '=', True)]" +msgstr "" + From 8d427ffc7df2f4eb6140d4eba2a2cf7614704be7 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Tue, 24 Aug 2021 05:59:56 +0000 Subject: [PATCH 164/223] [UPD] README.rst --- l10n_br_delivery/README.rst | 2 +- l10n_br_delivery/static/description/index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/l10n_br_delivery/README.rst b/l10n_br_delivery/README.rst index 5d979fac0f60..fec225724981 100644 --- a/l10n_br_delivery/README.rst +++ b/l10n_br_delivery/README.rst @@ -84,7 +84,7 @@ Credits Authors ~~~~~~~ -* KMEE +* Akretion Contributors ~~~~~~~~~~~~ diff --git a/l10n_br_delivery/static/description/index.html b/l10n_br_delivery/static/description/index.html index facdc3b68626..d2dd2329dcad 100644 --- a/l10n_br_delivery/static/description/index.html +++ b/l10n_br_delivery/static/description/index.html @@ -431,7 +431,7 @@

Credits

Authors

    -
  • KMEE
  • +
  • Akretion
From d73ce9361d34d56b28583064359d1d5b7e5777d8 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Tue, 24 Aug 2021 09:15:17 -0300 Subject: [PATCH 165/223] [FIX] Standard name to City field. --- l10n_br_delivery/demo/l10n_br_delivery_demo.xml | 4 ++-- l10n_br_delivery/models/vehicle.py | 2 +- l10n_br_delivery/views/l10n_br_delivery_view.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/l10n_br_delivery/demo/l10n_br_delivery_demo.xml b/l10n_br_delivery/demo/l10n_br_delivery_demo.xml index 1d2c891dd8d8..3768680f9851 100644 --- a/l10n_br_delivery/demo/l10n_br_delivery_demo.xml +++ b/l10n_br_delivery/demo/l10n_br_delivery_demo.xml @@ -35,7 +35,7 @@ Teste - Codigo RTNC 1 - + 2000 2001 @@ -51,7 +51,7 @@ Teste - Codigo RTNC 2 - + 2010 2011 diff --git a/l10n_br_delivery/models/vehicle.py b/l10n_br_delivery/models/vehicle.py index 05ecff955ce4..372dff8a90a8 100644 --- a/l10n_br_delivery/models/vehicle.py +++ b/l10n_br_delivery/models/vehicle.py @@ -45,7 +45,7 @@ class CarrierVehicle(models.Model): domain="[('country_id', '=', country_id)]", ) - l10n_br_city_id = fields.Many2one( + city_id = fields.Many2one( comodel_name='res.city', string='City', domain="[('state_id', '=', state_id)]", diff --git a/l10n_br_delivery/views/l10n_br_delivery_view.xml b/l10n_br_delivery/views/l10n_br_delivery_view.xml index 75c4a6756c59..c9286cc9f97a 100644 --- a/l10n_br_delivery/views/l10n_br_delivery_view.xml +++ b/l10n_br_delivery/views/l10n_br_delivery_view.xml @@ -19,7 +19,7 @@ - + From d6b1d96d2fc844d0c5e2eca2c7095ba75a21b78b Mon Sep 17 00:00:00 2001 From: oca-travis Date: Tue, 24 Aug 2021 14:11:55 +0000 Subject: [PATCH 166/223] [UPD] Update l10n_br_delivery.pot --- l10n_br_delivery/i18n/l10n_br_delivery.pot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_delivery/i18n/l10n_br_delivery.pot b/l10n_br_delivery/i18n/l10n_br_delivery.pot index 2680f3138aa3..d1900c8ae737 100644 --- a/l10n_br_delivery/i18n/l10n_br_delivery.pot +++ b/l10n_br_delivery/i18n/l10n_br_delivery.pot @@ -101,7 +101,7 @@ msgid "Carrier Vehicle" msgstr "" #. module: l10n_br_delivery -#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__l10n_br_city_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__city_id msgid "City" msgstr "" From cc946bbc75770c13bdfb6b28b91ca0937fec5309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Sat, 28 Aug 2021 20:22:43 -0300 Subject: [PATCH 167/223] [FIX] incorterm_id in _shadowed_fields in l10n_br_delivery fixes #1596 --- l10n_br_delivery/models/__init__.py | 1 + l10n_br_delivery/models/account_invoice.py | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 l10n_br_delivery/models/account_invoice.py diff --git a/l10n_br_delivery/models/__init__.py b/l10n_br_delivery/models/__init__.py index 8ce15a2bb494..99607573dbb5 100644 --- a/l10n_br_delivery/models/__init__.py +++ b/l10n_br_delivery/models/__init__.py @@ -1,5 +1,6 @@ # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html +from . import account_invoice from . import delivery_carrier from . import vehicle from . import sale_order diff --git a/l10n_br_delivery/models/account_invoice.py b/l10n_br_delivery/models/account_invoice.py new file mode 100644 index 000000000000..aef89cf5a8a1 --- /dev/null +++ b/l10n_br_delivery/models/account_invoice.py @@ -0,0 +1,12 @@ +# Copyright 2019 Akretion (Raphaël Valyi ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, models + + +class AccountInvoice(models.Model): + _inherit = "account.invoice" + + @api.model + def _shadowed_fields(self): + return super()._shadowed_fields() + ["incoterm_id"] From 54c5f92ec9aafe9894cdc8fa9c7a85c98ab76829 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Mon, 30 Aug 2021 00:53:55 +0000 Subject: [PATCH 168/223] [UPD] Update l10n_br_delivery.pot --- l10n_br_delivery/i18n/l10n_br_delivery.pot | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/l10n_br_delivery/i18n/l10n_br_delivery.pot b/l10n_br_delivery/i18n/l10n_br_delivery.pot index d1900c8ae737..2b4487e8f543 100644 --- a/l10n_br_delivery/i18n/l10n_br_delivery.pot +++ b/l10n_br_delivery/i18n/l10n_br_delivery.pot @@ -212,6 +212,11 @@ msgstr "" msgid "International Commercial Terms are a series of predefined commercial terms used in international transactions." msgstr "" +#. module: l10n_br_delivery +#: model:ir.model,name:l10n_br_delivery.model_account_invoice +msgid "Invoice" +msgstr "" + #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle____last_update msgid "Last Modified on" From ac9c6c146223bdb5cb5c219be8af33c202894ff0 Mon Sep 17 00:00:00 2001 From: Neto Date: Sun, 3 Oct 2021 08:49:49 -0300 Subject: [PATCH 169/223] fix demo data --- l10n_br_delivery/demo/l10n_br_delivery_demo.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_delivery/demo/l10n_br_delivery_demo.xml b/l10n_br_delivery/demo/l10n_br_delivery_demo.xml index 3768680f9851..d1955e8ccabf 100644 --- a/l10n_br_delivery/demo/l10n_br_delivery_demo.xml +++ b/l10n_br_delivery/demo/l10n_br_delivery_demo.xml @@ -8,7 +8,7 @@ Transportadora - Teste Transportadora - Teste 21.221.265/0001-90 - Estrada do Caminho Velho + Estrada do Caminho Velho 1 Jardim Nova Cidade From 36782180d611180f6a8e97687d1909a08774116e Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Fri, 31 Dec 2021 16:23:08 -0300 Subject: [PATCH 170/223] [IMP] l10n_br_delivery: pre-commit --- l10n_br_delivery/__manifest__.py | 46 +-- .../data/account_incoterms_data.xml | 2 +- .../data/res_config_settings_data.xml | 8 +- .../demo/l10n_br_delivery_demo.xml | 73 ++-- l10n_br_delivery/demo/sale_order_demo.xml | 50 +-- .../migrations/12.0.1.0.0/pre-migration.py | 7 +- l10n_br_delivery/models/account_incoterms.py | 21 +- l10n_br_delivery/models/delivery_carrier.py | 16 +- .../models/fiscal_document_mixin.py | 18 +- l10n_br_delivery/models/sale_order.py | 33 +- l10n_br_delivery/models/stock_picking.py | 2 +- l10n_br_delivery/models/vehicle.py | 48 +-- l10n_br_delivery/readme/HISTORY.rst | 1 - .../tests/test_delivery_inverse_amount.py | 386 +++++++++++------- .../views/account_incoterms_view.xml | 6 +- .../views/delivery_carrier_views.xml | 7 +- .../views/l10n_br_delivery_view.xml | 47 ++- l10n_br_delivery/views/sale_order_view.xml | 8 +- l10n_br_delivery/views/stock_picking_view.xml | 6 +- 19 files changed, 438 insertions(+), 347 deletions(-) diff --git a/l10n_br_delivery/__manifest__.py b/l10n_br_delivery/__manifest__.py index 240004712185..9ce6cdfbe47d 100644 --- a/l10n_br_delivery/__manifest__.py +++ b/l10n_br_delivery/__manifest__.py @@ -2,36 +2,36 @@ # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html { - 'name': 'Brazilian Localization Delivery', - 'summary': """ + "name": "Brazilian Localization Delivery", + "summary": """ This module changes the delivery model strategy to match brazilian standards.""", - 'license': 'AGPL-3', - 'author': 'Akretion, Odoo Community Association (OCA)', - 'website': 'https://github.com/OCA/l10n-brazil', - 'version': '12.0.3.0.0', - 'depends': [ - 'l10n_br_sale_stock', - 'delivery', - 'delivery_carrier_partner', + "license": "AGPL-3", + "author": "Akretion, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/l10n-brazil", + "version": "12.0.3.0.0", + "depends": [ + "l10n_br_sale_stock", + "delivery", + "delivery_carrier_partner", ], - 'data': [ + "data": [ # Data - 'data/res_config_settings_data.xml', - 'data/account_incoterms_data.xml', + "data/res_config_settings_data.xml", + "data/account_incoterms_data.xml", # View - 'views/delivery_carrier_views.xml', - 'views/l10n_br_delivery_view.xml', - 'views/sale_order_view.xml', + "views/delivery_carrier_views.xml", + "views/l10n_br_delivery_view.xml", + "views/sale_order_view.xml", "views/account_incoterms_view.xml", - 'views/stock_picking_view.xml', + "views/stock_picking_view.xml", # Security - 'security/ir.model.access.csv', + "security/ir.model.access.csv", ], - 'demo': [ - 'demo/l10n_br_delivery_demo.xml', - 'demo/sale_order_demo.xml', + "demo": [ + "demo/l10n_br_delivery_demo.xml", + "demo/sale_order_demo.xml", ], - 'category': 'Localization', - 'installable': True, + "category": "Localization", + "installable": True, } diff --git a/l10n_br_delivery/data/account_incoterms_data.xml b/l10n_br_delivery/data/account_incoterms_data.xml index 931e675ab22a..b0ae17919921 100644 --- a/l10n_br_delivery/data/account_incoterms_data.xml +++ b/l10n_br_delivery/data/account_incoterms_data.xml @@ -1,4 +1,4 @@ - + - + Teste - Veículo da Transportadora 1 Teste - Veículo da Transportadora 1 ABC1234 Teste - Motorista 1 Teste - Codigo RTNC 1 - - - - + + + + 2000 2001 - 2001 bau - + Teste - Veículo da Transportadora 2 Teste - Veículo da Transportadora 2 DEF5678 Teste - Motorista 2 Teste - Codigo RTNC 2 - - - - + + + + 2010 2011 - 2011 bau @@ -65,10 +69,9 @@ 10.0 3 fixed - - + + Teste - Código ANTT - - - - + + + 100 - + - - - + + + 100 - + - + diff --git a/l10n_br_delivery/demo/sale_order_demo.xml b/l10n_br_delivery/demo/sale_order_demo.xml index 0e471aa911a9..49e0f868aafb 100644 --- a/l10n_br_delivery/demo/sale_order_demo.xml +++ b/l10n_br_delivery/demo/sale_order_demo.xml @@ -1,67 +1,67 @@ - + Main l10n_br_delivery - Produtos - - - - - - + + + + + + draft - + TESTE - - - + + + - + Office Chair - + 2 - + 500 out - - + + 10 20 30 - + - + - + Office Lamp - + 2 - + 500 out - - + + 5 10 15 - + - + diff --git a/l10n_br_delivery/migrations/12.0.1.0.0/pre-migration.py b/l10n_br_delivery/migrations/12.0.1.0.0/pre-migration.py index c5927a71ecb1..73cbfca4580a 100644 --- a/l10n_br_delivery/migrations/12.0.1.0.0/pre-migration.py +++ b/l10n_br_delivery/migrations/12.0.1.0.0/pre-migration.py @@ -4,8 +4,8 @@ from openupgradelib import openupgrade _columns_rename = { - 'account_invoice': [ - ('incoterm', 'incoterm_id'), + "account_invoice": [ + ("incoterm", "incoterm_id"), ], } @@ -15,5 +15,4 @@ def migrate(env, version): for table in _columns_rename.keys(): for rename_column in _columns_rename[table]: if openupgrade.column_exists(env.cr, table, rename_column[0]): - openupgrade.rename_columns( - env.cr, {table: [rename_column]}) + openupgrade.rename_columns(env.cr, {table: [rename_column]}) diff --git a/l10n_br_delivery/models/account_incoterms.py b/l10n_br_delivery/models/account_incoterms.py index 0a8be7a117a7..220f486f8ee5 100644 --- a/l10n_br_delivery/models/account_incoterms.py +++ b/l10n_br_delivery/models/account_incoterms.py @@ -6,23 +6,22 @@ # Modalidade do frete MODFRETE_TRANSP = [ - ('0', '0 - Contratação do Frete por conta do Remetente (CIF)'), - ('1', '1 - Contratação do Frete por conta do' - ' destinatário/remetente (FOB)'), - ('2', '2 - Contratação do Frete por conta de terceiros'), - ('3', '3 - Transporte próprio por conta do remetente'), - ('4', '4 - Transporte próprio por conta do destinatário'), - ('9', '9 - Sem Ocorrência de transporte.'), + ("0", "0 - Contratação do Frete por conta do Remetente (CIF)"), + ("1", "1 - Contratação do Frete por conta do" " destinatário/remetente (FOB)"), + ("2", "2 - Contratação do Frete por conta de terceiros"), + ("3", "3 - Transporte próprio por conta do remetente"), + ("4", "4 - Transporte próprio por conta do destinatário"), + ("9", "9 - Sem Ocorrência de transporte."), ] class AccountIncoterms(models.Model): - _inherit = 'account.incoterms' + _inherit = "account.incoterms" freight_responsibility = fields.Selection( selection=MODFRETE_TRANSP, - string='Frete por Conta', - help='Informação usada na emissão de Documentos Fiscais', + string="Frete por Conta", + help="Informação usada na emissão de Documentos Fiscais", required=True, - default='0' + default="0", ) diff --git a/l10n_br_delivery/models/delivery_carrier.py b/l10n_br_delivery/models/delivery_carrier.py index b850b3fe4834..768495d29f37 100644 --- a/l10n_br_delivery/models/delivery_carrier.py +++ b/l10n_br_delivery/models/delivery_carrier.py @@ -5,22 +5,22 @@ class Carrier(models.Model): - _inherit = 'delivery.carrier' + _inherit = "delivery.carrier" antt_code = fields.Char( - string='Codigo ANTT', + string="Codigo ANTT", size=32, ) vehicle_ids = fields.One2many( - comodel_name='l10n_br_delivery.carrier.vehicle', - inverse_name='carrier_id', - string='Vehicles', - ondelete='cascade', + comodel_name="l10n_br_delivery.carrier.vehicle", + inverse_name="carrier_id", + string="Vehicles", + ondelete="cascade", ) def rate_shipment(self, order): - """ Compute the price of the order shipment + """Compute the price of the order shipment :param order: record of sale.order :return dict: {'success': boolean, @@ -37,6 +37,6 @@ def rate_shipment(self, order): # Se o Valor Total de Frete estiver preenchido ele tem # preferencia sobre o valor Calculado. if order.amount_freight_value > 0.0: - res['price'] = order.amount_freight_value + res["price"] = order.amount_freight_value return res diff --git a/l10n_br_delivery/models/fiscal_document_mixin.py b/l10n_br_delivery/models/fiscal_document_mixin.py index cb651a59b109..e526b0a8d3c9 100644 --- a/l10n_br_delivery/models/fiscal_document_mixin.py +++ b/l10n_br_delivery/models/fiscal_document_mixin.py @@ -6,22 +6,22 @@ class FiscalDocumentMixin(models.AbstractModel): - _inherit = 'l10n_br_fiscal.document.mixin' + _inherit = "l10n_br_fiscal.document.mixin" def _get_default_incoterm(self): return self.env.user.company_id.incoterm_id # Esta sendo implementado aqui para existir nos objetos herdados incoterm_id = fields.Many2one( - comodel_name='account.incoterms', - string='Incoterm', - help='International Commercial Terms are a series of' - ' predefined commercial terms used in international' - ' transactions.' + comodel_name="account.incoterms", + string="Incoterm", + help="International Commercial Terms are a series of" + " predefined commercial terms used in international" + " transactions.", ) carrier_id = fields.Many2one( - comodel_name='delivery.carrier', - string='Carrier', - ondelete='cascade', + comodel_name="delivery.carrier", + string="Carrier", + ondelete="cascade", ) diff --git a/l10n_br_delivery/models/sale_order.py b/l10n_br_delivery/models/sale_order.py index 44aa17976776..63cb3bf72e16 100644 --- a/l10n_br_delivery/models/sale_order.py +++ b/l10n_br_delivery/models/sale_order.py @@ -6,7 +6,7 @@ class SaleOrder(models.Model): - _inherit = 'sale.order' + _inherit = "sale.order" # A partir da v9 existe apenas o campo weight, que é referente ao # Peso Bruto/Gross Weight https://github.com/OCA/product-attribute/pull/894 @@ -15,13 +15,11 @@ class SaleOrder(models.Model): # Esse modulo l10n_br_delivery é pensando para ter aderencia com o # product_net_weight (modulo link acima). amount_gross_weight = fields.Float( - string='Amount Gross Weight', - compute='_compute_amount_gross_weight' + string="Amount Gross Weight", compute="_compute_amount_gross_weight" ) amount_volume = fields.Float( - string='Amount Volume', - compute='_compute_amount_volume' + string="Amount Volume", compute="_compute_amount_volume" ) # Devido o campo no sale_order chamar apenas incoterm @@ -29,27 +27,28 @@ class SaleOrder(models.Model): # arquivo não acontece, por isso é preciso fazer o # related abaixo # TODO: Verificar na migração se isso foi alterado - incoterm_id = fields.Many2one( - related='incoterm' - ) + incoterm_id = fields.Many2one(related="incoterm") def set_delivery_line(self): # Remove delivery products from the sales order self._remove_delivery_line() for order in self: - if order.state not in ('draft', 'sent'): - raise UserError(_( - 'You can add delivery price only on unconfirmed ' - 'quotations.')) + if order.state not in ("draft", "sent"): + raise UserError( + _("You can add delivery price only on unconfirmed " "quotations.") + ) elif not order.carrier_id: - raise UserError(_('No carrier set for this order.')) + raise UserError(_("No carrier set for this order.")) elif not order.delivery_rating_success: - raise UserError(_( - 'Please use "Check price" in order to compute a shipping ' - 'price for this quotation.')) + raise UserError( + _( + 'Please use "Check price" in order to compute a shipping ' + "price for this quotation." + ) + ) else: - price_unit = order.carrier_id.rate_shipment(order)['price'] + price_unit = order.carrier_id.rate_shipment(order)["price"] order.amount_freight_value = price_unit return True diff --git a/l10n_br_delivery/models/stock_picking.py b/l10n_br_delivery/models/stock_picking.py index 99c549d30119..2ec714444df8 100644 --- a/l10n_br_delivery/models/stock_picking.py +++ b/l10n_br_delivery/models/stock_picking.py @@ -6,7 +6,7 @@ class StockPicking(models.Model): - _inherit = 'stock.picking' + _inherit = "stock.picking" @api.multi def _add_delivery_cost_to_so(self): diff --git a/l10n_br_delivery/models/vehicle.py b/l10n_br_delivery/models/vehicle.py index 372dff8a90a8..7f1ed2eccfae 100644 --- a/l10n_br_delivery/models/vehicle.py +++ b/l10n_br_delivery/models/vehicle.py @@ -1,78 +1,74 @@ # Copyright (C) 2010 Renato Lima - Akretion # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html -from odoo import models, fields +from odoo import fields, models class CarrierVehicle(models.Model): - _name = 'l10n_br_delivery.carrier.vehicle' - _description = 'Carrier Vehicle' + _name = "l10n_br_delivery.carrier.vehicle" + _description = "Carrier Vehicle" - name = fields.Char( - string='Name', - required=True, - size=32 - ) + name = fields.Char(string="Name", required=True, size=32) description = fields.Char( - string='Description', + string="Description", size=132, ) plate = fields.Char( - string='Placa', + string="Placa", size=7, ) driver = fields.Char( - string='Driver', + string="Driver", size=64, ) rntc_code = fields.Char( - string='ANTT Code', + string="ANTT Code", size=32, ) country_id = fields.Many2one( - comodel_name='res.country', - string='Country', + comodel_name="res.country", + string="Country", ) state_id = fields.Many2one( - comodel_name='res.country.state', - string='State', + comodel_name="res.country.state", + string="State", domain="[('country_id', '=', country_id)]", ) city_id = fields.Many2one( - comodel_name='res.city', - string='City', + comodel_name="res.city", + string="City", domain="[('state_id', '=', state_id)]", ) active = fields.Boolean( - string='Active', + string="Active", ) manufacture_year = fields.Char( - string='Ano de Fabricação', + string="Ano de Fabricação", size=4, ) model_year = fields.Char( - string='Ano do Modelo', + string="Ano do Modelo", size=4, ) type = fields.Selection( - selection=[('bau', 'Caminhão Baú')], - string='Model Type', + selection=[("bau", "Caminhão Baú")], + string="Model Type", ) carrier_id = fields.Many2one( - comodel_name='delivery.carrier', - string='Carrier', + comodel_name="delivery.carrier", + string="Carrier", index=True, - ondelete='cascade', + ondelete="cascade", ) diff --git a/l10n_br_delivery/readme/HISTORY.rst b/l10n_br_delivery/readme/HISTORY.rst index 8b137891791f..e69de29bb2d1 100644 --- a/l10n_br_delivery/readme/HISTORY.rst +++ b/l10n_br_delivery/readme/HISTORY.rst @@ -1 +0,0 @@ - diff --git a/l10n_br_delivery/tests/test_delivery_inverse_amount.py b/l10n_br_delivery/tests/test_delivery_inverse_amount.py index 3390f6953c40..811c4b7b84da 100644 --- a/l10n_br_delivery/tests/test_delivery_inverse_amount.py +++ b/l10n_br_delivery/tests/test_delivery_inverse_amount.py @@ -1,7 +1,7 @@ # @ 2020 KMEE - www.kmee.com.br # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from odoo.tests.common import SavepointCase, Form +from odoo.tests.common import Form, SavepointCase class TestDeliveryInverseAmount(SavepointCase): @@ -9,31 +9,29 @@ class TestDeliveryInverseAmount(SavepointCase): def setUpClass(cls): super().setUpClass() - cls.sale_demo = cls.env.ref('l10n_br_delivery.main_so_delivery_1') + cls.sale_demo = cls.env.ref("l10n_br_delivery.main_so_delivery_1") # Create two sale orders - sale_order_form_total = Form(cls.env['sale.order'], 'sale.view_order_form') - sale_order_form_total.partner_id = cls.env.ref( - 'l10n_br_base.res_partner_kmee') + sale_order_form_total = Form(cls.env["sale.order"], "sale.view_order_form") + sale_order_form_total.partner_id = cls.env.ref("l10n_br_base.res_partner_kmee") cls.sale_order_total_id = sale_order_form_total.save() - sale_order_form_line = Form(cls.env['sale.order'], 'sale.view_order_form') - sale_order_form_line.partner_id = cls.env.ref( - 'l10n_br_base.res_partner_kmee') + sale_order_form_line = Form(cls.env["sale.order"], "sale.view_order_form") + sale_order_form_line.partner_id = cls.env.ref("l10n_br_base.res_partner_kmee") cls.sale_order_line_id = sale_order_form_line.save() # Set 2 different products to the sale orders with Form(cls.sale_order_total_id) as so: with so.order_line.new() as line: - line.product_id = cls.env.ref('product.product_delivery_01') + line.product_id = cls.env.ref("product.product_delivery_01") with so.order_line.new() as line: - line.product_id = cls.env.ref('product.product_delivery_02') + line.product_id = cls.env.ref("product.product_delivery_02") with Form(cls.sale_order_line_id) as so: with so.order_line.new() as line: - line.product_id = cls.env.ref('product.product_delivery_01') + line.product_id = cls.env.ref("product.product_delivery_01") with so.order_line.new() as line: - line.product_id = cls.env.ref('product.product_delivery_02') + line.product_id = cls.env.ref("product.product_delivery_02") # Change freight, insurance and other costs amount from # sale_order_total_id @@ -45,7 +43,7 @@ def setUpClass(cls): # Change freight, insurance and other costs amount from # sale_order_lines_id lines # TODO ?: alterando para permitir edição do campo e não falhar o teste - cls.sale_order_line_id.company_id.delivery_costs = 'line' + cls.sale_order_line_id.company_id.delivery_costs = "line" with Form(cls.sale_order_line_id) as so: with so.order_line.edit(0) as line: line.freight_value = 70.00 @@ -57,7 +55,7 @@ def setUpClass(cls): line.other_value = 10.00 # TODO ?: alterando para permitir edição do campo e não falhar o teste - cls.sale_order_line_id.company_id.delivery_costs = 'total' + cls.sale_order_line_id.company_id.delivery_costs = "total" with Form(cls.sale_order_line_id) as so: so.amount_freight_value = 100.0 so.amount_insurance_value = 100.0 @@ -88,11 +86,17 @@ def setUpClass(cls): for move in picking.move_ids_without_package: move.quantity_done = move.product_uom_qty - wizard_total = cls.env['sale.advance.payment.inv'].with_context( - {'active_ids': cls.sale_order_total_id.ids}).create({}) + wizard_total = ( + cls.env["sale.advance.payment.inv"] + .with_context({"active_ids": cls.sale_order_total_id.ids}) + .create({}) + ) - wizard_line = cls.env['sale.advance.payment.inv'].with_context( - {'active_ids': cls.sale_order_line_id.ids}).create({}) + wizard_line = ( + cls.env["sale.advance.payment.inv"] + .with_context({"active_ids": cls.sale_order_line_id.ids}) + .create({}) + ) wizard_total.create_invoices() wizard_line.create_invoices() @@ -100,79 +104,112 @@ def setUpClass(cls): def test_sale_order_total_amounts(self): """Check sale order total amounts""" self.assertEqual( - self.sale_order_total_id.amount_price_gross, 110.0, - "Unexpected value for the field amount_price_gross from Sale Order") + self.sale_order_total_id.amount_price_gross, + 110.0, + "Unexpected value for the field amount_price_gross from Sale Order", + ) self.assertEqual( - self.sale_order_total_id.amount_untaxed, 110.0, - "Unexpected value for the field amount_untaxed from Sale Order") + self.sale_order_total_id.amount_untaxed, + 110.0, + "Unexpected value for the field amount_untaxed from Sale Order", + ) self.assertEqual( - self.sale_order_total_id.amount_freight_value, 100.0, - "Unexpected value for the field amount_freight from Sale Order") + self.sale_order_total_id.amount_freight_value, + 100.0, + "Unexpected value for the field amount_freight from Sale Order", + ) self.assertEqual( - self.sale_order_total_id.amount_insurance_value, 100.0, - "Unexpected value for the field amount_insurance from Sale Order") + self.sale_order_total_id.amount_insurance_value, + 100.0, + "Unexpected value for the field amount_insurance from Sale Order", + ) self.assertEqual( - self.sale_order_total_id.amount_other_value, 100.0, - "Unexpected value for the field amount_costs from Sale Order") + self.sale_order_total_id.amount_other_value, + 100.0, + "Unexpected value for the field amount_costs from Sale Order", + ) self.assertEqual( - self.sale_order_total_id.amount_tax, 0.0, - "Unexpected value for the field amount_tax from Sale Order") + self.sale_order_total_id.amount_tax, + 0.0, + "Unexpected value for the field amount_tax from Sale Order", + ) def test_sale_order_line_amounts(self): """Check sale order line amounts""" self.assertEqual( - self.sale_order_line_id.amount_price_gross, 110.0, - "Unexpected value for the field amount_price_gross from Sale Order") + self.sale_order_line_id.amount_price_gross, + 110.0, + "Unexpected value for the field amount_price_gross from Sale Order", + ) self.assertEqual( - self.sale_order_line_id.amount_untaxed, 110.0, - "Unexpected value for the field amount_untaxed from Sale Order") + self.sale_order_line_id.amount_untaxed, + 110.0, + "Unexpected value for the field amount_untaxed from Sale Order", + ) self.assertEqual( - self.sale_order_line_id.amount_freight_value, 100.0, - "Unexpected value for the field amount_freight from Sale Order") + self.sale_order_line_id.amount_freight_value, + 100.0, + "Unexpected value for the field amount_freight from Sale Order", + ) self.assertEqual( - self.sale_order_line_id.amount_insurance_value, 100.0, - "Unexpected value for the field amount_insurance from Sale Order") + self.sale_order_line_id.amount_insurance_value, + 100.0, + "Unexpected value for the field amount_insurance from Sale Order", + ) self.assertEqual( - self.sale_order_line_id.amount_other_value, 100.0, - "Unexpected value for the field amount_other from Sale Order") + self.sale_order_line_id.amount_other_value, + 100.0, + "Unexpected value for the field amount_other from Sale Order", + ) self.assertEqual( - self.sale_order_line_id.amount_tax, 0.0, - "Unexpected value for the field amount_tax from Sale Order") + self.sale_order_line_id.amount_tax, + 0.0, + "Unexpected value for the field amount_tax from Sale Order", + ) def test_invoice_amount_tax(self): """Check invoice amount tax""" invoice_tax_total = self.sale_order_total_id.invoice_ids[0].amount_tax self.assertEqual( - invoice_tax_total, 0.0, - "Unexpected value for the field invoice_tax from Invoice") + invoice_tax_total, + 0.0, + "Unexpected value for the field invoice_tax from Invoice", + ) invoice_tax_line = self.sale_order_line_id.invoice_ids[0].amount_tax self.assertEqual( - invoice_tax_line, 0.0, - "Unexpected value for the field invoice_tax from Invoice") + invoice_tax_line, + 0.0, + "Unexpected value for the field invoice_tax from Invoice", + ) def test_inverse_amount_freight_total(self): """Check Fiscal Document freight values for total""" - fiscal_document_id = \ - self.sale_order_total_id.invoice_ids[0].fiscal_document_id + fiscal_document_id = self.sale_order_total_id.invoice_ids[0].fiscal_document_id self.assertEqual( - fiscal_document_id.amount_freight_value, 100, + fiscal_document_id.amount_freight_value, + 100, "Unexpected value for the field amount_freight_value from " - "Fiscal Document") + "Fiscal Document", + ) for line in fiscal_document_id.line_ids: - if line.name == '[FURN_7777] Office Chair': + if line.name == "[FURN_7777] Office Chair": self.assertEqual( - line.freight_value, 63.64, + line.freight_value, + 63.64, "Unexpected value for the field freight_value from " - "Fiscal Document line") - if line.name == '[FURN_8888] Office Lamp': + "Fiscal Document line", + ) + if line.name == "[FURN_8888] Office Lamp": self.assertEqual( - line.freight_value, 36.36, + line.freight_value, + 36.36, "Unexpected value for the field freight_value from " - "Fiscal Document line") + "Fiscal Document line", + ) # TODO ? : O documento fiscal so permite os valores serem informados # por linha, pendente wizard p/ informar total e ratear por linhas @@ -193,24 +230,29 @@ def test_inverse_amount_freight_total(self): def test_inverse_amount_freight_line(self): """Check Fiscal Document freight values for lines""" - fiscal_document_id = \ - self.sale_order_line_id.invoice_ids[0].fiscal_document_id + fiscal_document_id = self.sale_order_line_id.invoice_ids[0].fiscal_document_id self.assertEqual( - fiscal_document_id.amount_freight_value, 100, + fiscal_document_id.amount_freight_value, + 100, "Unexpected value for the field amount_freight_value from " - "Fiscal Document") + "Fiscal Document", + ) for line in fiscal_document_id.line_ids: - if line.name == '[FURN_7777] Office Chair': + if line.name == "[FURN_7777] Office Chair": self.assertEqual( - line.freight_value, 87.5, + line.freight_value, + 87.5, "Unexpected value for the field freight_value from " - "Fiscal Document line") - if line.name == '[FURN_8888] Office Lamp': + "Fiscal Document line", + ) + if line.name == "[FURN_8888] Office Lamp": self.assertEqual( - line.freight_value, 12.5, + line.freight_value, + 12.5, "Unexpected value for the field freight_value from " - "Fiscal Document line") + "Fiscal Document line", + ) # TODO ? : O documento fiscal so permite os valores serem informados # por linha, pendente wizard p/ informar total e ratear por linhas @@ -231,24 +273,29 @@ def test_inverse_amount_freight_line(self): def test_inverse_amount_insurance_total(self): """Check Fiscal Document insurance values for total""" - fiscal_document_id = \ - self.sale_order_total_id.invoice_ids[0].fiscal_document_id + fiscal_document_id = self.sale_order_total_id.invoice_ids[0].fiscal_document_id self.assertEqual( - fiscal_document_id.amount_insurance_value, 100, + fiscal_document_id.amount_insurance_value, + 100, "Unexpected value for the field amount_insurance_value from " - "Fiscal Document") + "Fiscal Document", + ) for line in fiscal_document_id.line_ids: - if line.name == '[FURN_7777] Office Chair': + if line.name == "[FURN_7777] Office Chair": self.assertEqual( - line.insurance_value, 63.64, + line.insurance_value, + 63.64, "Unexpected value for the field insurance_value from " - "Fiscal Document line") - if line.name == '[FURN_8888] Office Lamp': + "Fiscal Document line", + ) + if line.name == "[FURN_8888] Office Lamp": self.assertEqual( - line.insurance_value, 36.36, + line.insurance_value, + 36.36, "Unexpected value for the field insurance_value from " - "Fiscal Document line") + "Fiscal Document line", + ) # TODO ? : O documento fiscal so permite os valores serem informados # por linha, pendente wizard p/ informar total e ratear por linhas @@ -269,24 +316,29 @@ def test_inverse_amount_insurance_total(self): def test_inverse_amount_insurance_line(self): """Check Fiscal Document insurance values for lines""" - fiscal_document_id = \ - self.sale_order_line_id.invoice_ids[0].fiscal_document_id + fiscal_document_id = self.sale_order_line_id.invoice_ids[0].fiscal_document_id self.assertEqual( - fiscal_document_id.amount_insurance_value, 100, + fiscal_document_id.amount_insurance_value, + 100, "Unexpected value for the field amount_insurance_value from " - "Fiscal Document") + "Fiscal Document", + ) for line in fiscal_document_id.line_ids: - if line.name == '[FURN_7777] Office Chair': + if line.name == "[FURN_7777] Office Chair": self.assertEqual( - line.insurance_value, 87.5, + line.insurance_value, + 87.5, "Unexpected value for the field insurance_value from " - "Fiscal Document line") - if line.name == '[FURN_8888] Office Lamp': + "Fiscal Document line", + ) + if line.name == "[FURN_8888] Office Lamp": self.assertEqual( - line.insurance_value, 12.5, + line.insurance_value, + 12.5, "Unexpected value for the field insurance_value from " - "Fiscal Document line") + "Fiscal Document line", + ) # TODO ? : O documento fiscal so permite os valores serem informados # por linha, pendente wizard p/ informar total e ratear por linhas @@ -307,24 +359,28 @@ def test_inverse_amount_insurance_line(self): def test_inverse_amount_other_costs_total(self): """Check Fiscal Document other costs values for total""" - fiscal_document_id = \ - self.sale_order_total_id.invoice_ids[0].fiscal_document_id + fiscal_document_id = self.sale_order_total_id.invoice_ids[0].fiscal_document_id self.assertEqual( - fiscal_document_id.amount_other_value, 100, - "Unexpected value for the field other_value from " - "Fiscal Document") + fiscal_document_id.amount_other_value, + 100, + "Unexpected value for the field other_value from " "Fiscal Document", + ) for line in fiscal_document_id.line_ids: - if line.name == '[FURN_7777] Office Chair': + if line.name == "[FURN_7777] Office Chair": self.assertEqual( - line.other_value, 63.64, + line.other_value, + 63.64, "Unexpected value for the field other_value from " - "Fiscal Document line") - if line.name == '[FURN_8888] Office Lamp': + "Fiscal Document line", + ) + if line.name == "[FURN_8888] Office Lamp": self.assertEqual( - line.other_value, 36.36, + line.other_value, + 36.36, "Unexpected value for the field other_value from " - "Fiscal Document line") + "Fiscal Document line", + ) # TODO ? : O documento fiscal so permite os valores serem informados # por linha, pendente wizard p/ informar total e ratear por linhas @@ -345,24 +401,28 @@ def test_inverse_amount_other_costs_total(self): def test_inverse_amount_other_line(self): """Check Fiscal Document other other values for lines""" - fiscal_document_id = \ - self.sale_order_line_id.invoice_ids[0].fiscal_document_id + fiscal_document_id = self.sale_order_line_id.invoice_ids[0].fiscal_document_id self.assertEqual( - fiscal_document_id.amount_other_value, 100, - "Unexpected value for the field other_value from " - "Fiscal Document") + fiscal_document_id.amount_other_value, + 100, + "Unexpected value for the field other_value from " "Fiscal Document", + ) for line in fiscal_document_id.line_ids: - if line.name == '[FURN_7777] Office Chair': + if line.name == "[FURN_7777] Office Chair": self.assertEqual( - line.other_value, 87.5, + line.other_value, + 87.5, "Unexpected value for the field other_value from " - "Fiscal Document line") - if line.name == '[FURN_8888] Office Lamp': + "Fiscal Document line", + ) + if line.name == "[FURN_8888] Office Lamp": self.assertEqual( - line.other_value, 12.5, + line.other_value, + 12.5, "Unexpected value for the field other_value from " - "Fiscal Document line") + "Fiscal Document line", + ) # TODO ? : O documento fiscal so permite os valores serem informados # por linha, pendente wizard p/ informar total e ratear por linhas @@ -387,30 +447,43 @@ def test_not_cost_ratio_by_lines(self): de Frete, Seguro e Outros Custos, esses valores nas linhas devem ser independentes. """ - self.sale_demo.company_id.delivery_costs = 'line' + self.sale_demo.company_id.delivery_costs = "line" self.sale_demo.action_confirm() self.assertEqual( - self.sale_demo.amount_freight_value, 30.0, - 'Unexpected value for the field amount_freight from Sale Order') + self.sale_demo.amount_freight_value, + 30.0, + "Unexpected value for the field amount_freight from Sale Order", + ) self.assertEqual( - self.sale_demo.amount_insurance_value, 45.0, - 'Unexpected value for the field amount_insurance from Sale Order') + self.sale_demo.amount_insurance_value, + 45.0, + "Unexpected value for the field amount_insurance from Sale Order", + ) self.assertEqual( - self.sale_demo.amount_other_value, 15.0, - 'Unexpected value for the field amount_costs from Sale Order') - for l in self.sale_demo.order_line: + self.sale_demo.amount_other_value, + 15.0, + "Unexpected value for the field amount_costs from Sale Order", + ) + for line in self.sale_demo.order_line: other_line = self.sale_demo.order_line.filtered( - lambda o_l: o_l.id != l.id) + lambda o_l: o_l.id != line.id + ) self.assertNotEqual( - l.freight_value, other_line.freight_value, - 'Value freight_value should not be has same value in lines.') + line.freight_value, + other_line.freight_value, + "Value freight_value should not be has same value in lines.", + ) self.assertNotEqual( - l.insurance_value, other_line.insurance_value, - 'Value insurance_value should not be has same value in lines.') + line.insurance_value, + other_line.insurance_value, + "Value insurance_value should not be has same value in lines.", + ) self.assertNotEqual( - l.other_value, other_line.other_value, - 'Value other_value should not be has same value in lines.') + line.other_value, + other_line.other_value, + "Value other_value should not be has same value in lines.", + ) picking = self.sale_demo.picking_ids # Check product availability @@ -419,50 +492,55 @@ def test_not_cost_ratio_by_lines(self): for move in picking.move_ids_without_package: move.quantity_done = move.product_uom_qty picking.button_validate() - self.assertEqual(picking.state, 'done') + self.assertEqual(picking.state, "done") self.sale_demo.action_invoice_create(final=True) - self.assertEquals( - self.sale_demo.state, 'sale', 'Error to confirm Sale Order.' - ) + self.assertEquals(self.sale_demo.state, "sale", "Error to confirm Sale Order.") invoice = self.sale_demo.invoice_ids[0] invoice.action_invoice_open() - self.assertEquals( - invoice.state, "open", "Invoice should be in state Open" - ) - for l in invoice.invoice_line_ids: + self.assertEquals(invoice.state, "open", "Invoice should be in state Open") + for line in invoice.invoice_line_ids: other_line = invoice.invoice_line_ids.filtered( - lambda o_l: o_l.id != l.id) + lambda o_l: o_l.id != line.id + ) self.assertNotEqual( - l.freight_value, other_line.freight_value, - 'Value freight_value should not be has same value' - ' in invoice lines.') + line.freight_value, + other_line.freight_value, + "Value freight_value should not be has same value" " in invoice lines.", + ) self.assertNotEqual( - l.insurance_value, other_line.insurance_value, - 'Value insurance_value should not be has same value' - ' in invoice lines.') + line.insurance_value, + other_line.insurance_value, + "Value insurance_value should not be has same value" + " in invoice lines.", + ) self.assertNotEqual( - l.other_value, other_line.other_value, - 'Value other_value should not be has same value' - ' in invoice lines.') + line.other_value, + other_line.other_value, + "Value other_value should not be has same value" " in invoice lines.", + ) - fiscal_document_id = \ - self.sale_demo.invoice_ids[0].fiscal_document_id + fiscal_document_id = self.sale_demo.invoice_ids[0].fiscal_document_id - for l in fiscal_document_id.line_ids: + for line in fiscal_document_id.line_ids: other_line = fiscal_document_id.line_ids.filtered( - lambda o_l: o_l.id != l.id) + lambda o_l: o_l.id != line.id + ) self.assertNotEqual( - l.freight_value, other_line.freight_value, - 'Value freight_value should not be has same value' - ' in invoice lines.') + line.freight_value, + other_line.freight_value, + "Value freight_value should not be has same value" " in invoice lines.", + ) self.assertNotEqual( - l.insurance_value, other_line.insurance_value, - 'Value insurance_value should not be has same value' - ' in invoice lines.') + line.insurance_value, + other_line.insurance_value, + "Value insurance_value should not be has same value" + " in invoice lines.", + ) self.assertNotEqual( - l.other_value, other_line.other_value, - 'Value other_value should not be has same value' - ' in invoice lines.') + line.other_value, + other_line.other_value, + "Value other_value should not be has same value" " in invoice lines.", + ) diff --git a/l10n_br_delivery/views/account_incoterms_view.xml b/l10n_br_delivery/views/account_incoterms_view.xml index 12aebc018372..39aaf99ad43f 100644 --- a/l10n_br_delivery/views/account_incoterms_view.xml +++ b/l10n_br_delivery/views/account_incoterms_view.xml @@ -1,14 +1,14 @@ - + account.incoterms.form account.incoterms 10 - + - + diff --git a/l10n_br_delivery/views/delivery_carrier_views.xml b/l10n_br_delivery/views/delivery_carrier_views.xml index 818f4f3f82e5..b1beb0d07744 100644 --- a/l10n_br_delivery/views/delivery_carrier_views.xml +++ b/l10n_br_delivery/views/delivery_carrier_views.xml @@ -1,10 +1,13 @@ - + l10n_br_delivery.carrier.form delivery.carrier - + [('supplier', '=', True)] diff --git a/l10n_br_delivery/views/l10n_br_delivery_view.xml b/l10n_br_delivery/views/l10n_br_delivery_view.xml index c9286cc9f97a..33f4eb141996 100644 --- a/l10n_br_delivery/views/l10n_br_delivery_view.xml +++ b/l10n_br_delivery/views/l10n_br_delivery_view.xml @@ -1,4 +1,4 @@ - + @@ -9,20 +9,20 @@
- + - - - - - - - - - - - - + + + + + + + + + + + +
@@ -33,22 +33,31 @@ tree - + - +
- + Veículo ir.actions.act_window l10n_br_delivery.carrier.vehicle tree,form form - + - +
diff --git a/l10n_br_delivery/views/sale_order_view.xml b/l10n_br_delivery/views/sale_order_view.xml index b5fa1ba4230a..c48ea94aca84 100644 --- a/l10n_br_delivery/views/sale_order_view.xml +++ b/l10n_br_delivery/views/sale_order_view.xml @@ -1,15 +1,15 @@ - + l10n_br_delivery.sale.order.form sale.order - + 99 - - + + diff --git a/l10n_br_delivery/views/stock_picking_view.xml b/l10n_br_delivery/views/stock_picking_view.xml index 493a9d84e055..ea0b095ca1d1 100644 --- a/l10n_br_delivery/views/stock_picking_view.xml +++ b/l10n_br_delivery/views/stock_picking_view.xml @@ -1,14 +1,14 @@ - + l10n_br_delivery.picking.form stock.picking - + 99 - + From c5e310ec12923e7fe2dc9f2fd3cdad21617b9416 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Tue, 4 Jan 2022 15:27:36 +0000 Subject: [PATCH 171/223] [UPD] Update l10n_br_delivery.pot --- l10n_br_delivery/i18n/l10n_br_delivery.pot | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/l10n_br_delivery/i18n/l10n_br_delivery.pot b/l10n_br_delivery/i18n/l10n_br_delivery.pot index 2b4487e8f543..cd89c57d40ab 100644 --- a/l10n_br_delivery/i18n/l10n_br_delivery.pot +++ b/l10n_br_delivery/i18n/l10n_br_delivery.pot @@ -243,7 +243,7 @@ msgid "Name" msgstr "" #. module: l10n_br_delivery -#: code:addons/l10n_br_delivery/models/sale_order.py:46 +#: code:addons/l10n_br_delivery/models/sale_order.py:42 #, python-format msgid "No carrier set for this order." msgstr "" @@ -254,7 +254,7 @@ msgid "Placa" msgstr "" #. module: l10n_br_delivery -#: code:addons/l10n_br_delivery/models/sale_order.py:48 +#: code:addons/l10n_br_delivery/models/sale_order.py:45 #, python-format msgid "Please use \"Check price\" in order to compute a shipping price for this quotation." msgstr "" @@ -298,7 +298,7 @@ msgid "Veículo" msgstr "" #. module: l10n_br_delivery -#: code:addons/l10n_br_delivery/models/sale_order.py:42 +#: code:addons/l10n_br_delivery/models/sale_order.py:39 #, python-format msgid "You can add delivery price only on unconfirmed quotations." msgstr "" From 9c04e9b5ab440569d98aa5ca12e2c6c5b89de7a9 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Tue, 4 Jan 2022 16:07:09 +0000 Subject: [PATCH 172/223] [UPD] README.rst --- l10n_br_delivery/README.rst | 5 ---- .../static/description/index.html | 24 ++++++++----------- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/l10n_br_delivery/README.rst b/l10n_br_delivery/README.rst index fec225724981..680faf69df5b 100644 --- a/l10n_br_delivery/README.rst +++ b/l10n_br_delivery/README.rst @@ -63,11 +63,6 @@ Known issues / Roadmap * TODO! -Changelog -========= - - - Bug Tracker =========== diff --git a/l10n_br_delivery/static/description/index.html b/l10n_br_delivery/static/description/index.html index d2dd2329dcad..4b7e135b63b1 100644 --- a/l10n_br_delivery/static/description/index.html +++ b/l10n_br_delivery/static/description/index.html @@ -378,12 +378,11 @@

Brazilian Localization Delivery

  • Configuration
  • Usage
  • Known issues / Roadmap
  • -
  • Changelog
  • -
  • Bug Tracker
  • -
  • Credits @@ -415,11 +414,8 @@

    Known issues / Roadmap

  • TODO!
  • -
    -

    Bug Tracker

    +

    Bug Tracker

    Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed @@ -427,15 +423,15 @@

    Bug Tracker

    Do not contact contributors directly about support or help with technical issues.

    -

    Credits

    +

    Credits

    -

    Authors

    +

    Authors

    • Akretion
    -

    Maintainers

    +

    Maintainers

    This module is maintained by the OCA.

    Odoo Community Association

    OCA, or the Odoo Community Association, is a nonprofit organization whose From 464c05d5bda25efe3acea1bc6dbf8609b9c176aa Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Mon, 30 May 2022 10:39:59 -0300 Subject: [PATCH 173/223] [IMP] l10n_br_delivery: black, isort, prettier --- l10n_br_delivery/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_delivery/__manifest__.py b/l10n_br_delivery/__manifest__.py index 9ce6cdfbe47d..4a18cd784cef 100644 --- a/l10n_br_delivery/__manifest__.py +++ b/l10n_br_delivery/__manifest__.py @@ -9,7 +9,7 @@ "license": "AGPL-3", "author": "Akretion, Odoo Community Association (OCA)", "website": "https://github.com/OCA/l10n-brazil", - "version": "12.0.3.0.0", + "version": "14.0.1.0.0", "depends": [ "l10n_br_sale_stock", "delivery", From 62af5690c980ace648db780c8547084e109dec04 Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Thu, 14 Jul 2022 15:41:15 -0300 Subject: [PATCH 174/223] [MIG] l10n_br_delivery: Migration to 14.0 --- .../demo/l10n_br_delivery_demo.xml | 3 +- .../migrations/12.0.1.0.0/pre-migration.py | 18 ---------- l10n_br_delivery/models/__init__.py | 2 +- .../{account_invoice.py => account_move.py} | 4 +-- l10n_br_delivery/models/sale_order.py | 30 +++++----------- l10n_br_delivery/models/stock_picking.py | 3 +- .../tests/test_delivery_inverse_amount.py | 36 +++++++++---------- .../views/l10n_br_delivery_view.xml | 1 - 8 files changed, 32 insertions(+), 65 deletions(-) delete mode 100644 l10n_br_delivery/migrations/12.0.1.0.0/pre-migration.py rename l10n_br_delivery/models/{account_invoice.py => account_move.py} (80%) diff --git a/l10n_br_delivery/demo/l10n_br_delivery_demo.xml b/l10n_br_delivery/demo/l10n_br_delivery_demo.xml index b3e100509cdf..d943aa94a813 100644 --- a/l10n_br_delivery/demo/l10n_br_delivery_demo.xml +++ b/l10n_br_delivery/demo/l10n_br_delivery_demo.xml @@ -20,8 +20,6 @@ (11) 9999-9999 teste@teste.com.br 115.106.496.207 - - @@ -84,6 +82,7 @@ Starting Inventory - l10n_br_delivery + confirm diff --git a/l10n_br_delivery/migrations/12.0.1.0.0/pre-migration.py b/l10n_br_delivery/migrations/12.0.1.0.0/pre-migration.py deleted file mode 100644 index 73cbfca4580a..000000000000 --- a/l10n_br_delivery/migrations/12.0.1.0.0/pre-migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright (C) 2021 - TODAY Renato Lima - Akretion -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - -from openupgradelib import openupgrade - -_columns_rename = { - "account_invoice": [ - ("incoterm", "incoterm_id"), - ], -} - - -@openupgrade.migrate(use_env=True) -def migrate(env, version): - for table in _columns_rename.keys(): - for rename_column in _columns_rename[table]: - if openupgrade.column_exists(env.cr, table, rename_column[0]): - openupgrade.rename_columns(env.cr, {table: [rename_column]}) diff --git a/l10n_br_delivery/models/__init__.py b/l10n_br_delivery/models/__init__.py index 99607573dbb5..9e6eb6f41cee 100644 --- a/l10n_br_delivery/models/__init__.py +++ b/l10n_br_delivery/models/__init__.py @@ -1,6 +1,6 @@ # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html -from . import account_invoice +from . import account_move from . import delivery_carrier from . import vehicle from . import sale_order diff --git a/l10n_br_delivery/models/account_invoice.py b/l10n_br_delivery/models/account_move.py similarity index 80% rename from l10n_br_delivery/models/account_invoice.py rename to l10n_br_delivery/models/account_move.py index aef89cf5a8a1..78bbb527b7ae 100644 --- a/l10n_br_delivery/models/account_invoice.py +++ b/l10n_br_delivery/models/account_move.py @@ -4,8 +4,8 @@ from odoo import api, models -class AccountInvoice(models.Model): - _inherit = "account.invoice" +class AccountMove(models.Model): + _inherit = "account.move" @api.model def _shadowed_fields(self): diff --git a/l10n_br_delivery/models/sale_order.py b/l10n_br_delivery/models/sale_order.py index 63cb3bf72e16..4d81f77bcb23 100644 --- a/l10n_br_delivery/models/sale_order.py +++ b/l10n_br_delivery/models/sale_order.py @@ -1,8 +1,7 @@ # Copyright 2020 KMEE INFORMATICA LTDA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import _, fields, models -from odoo.exceptions import UserError +from odoo import api, fields, models class SaleOrder(models.Model): @@ -29,31 +28,21 @@ class SaleOrder(models.Model): # TODO: Verificar na migração se isso foi alterado incoterm_id = fields.Many2one(related="incoterm") - def set_delivery_line(self): + @api.depends("order_line") + def _compute_delivery_state(self): + for order in self: + order.delivery_set = True if order.carrier_id else False + + def set_delivery_line(self, carrier, amount): # Remove delivery products from the sales order self._remove_delivery_line() for order in self: - if order.state not in ("draft", "sent"): - raise UserError( - _("You can add delivery price only on unconfirmed " "quotations.") - ) - elif not order.carrier_id: - raise UserError(_("No carrier set for this order.")) - elif not order.delivery_rating_success: - raise UserError( - _( - 'Please use "Check price" in order to compute a shipping ' - "price for this quotation." - ) - ) - else: - price_unit = order.carrier_id.rate_shipment(order)["price"] - order.amount_freight_value = price_unit + order.carrier_id = carrier.id + order.amount_freight_value = amount return True def _compute_amount_gross_weight(self): - for record in self: amount_gross_weight = 0.0 for line in record.order_line: @@ -61,7 +50,6 @@ def _compute_amount_gross_weight(self): record.amount_gross_weight = amount_gross_weight def _compute_amount_volume(self): - for record in self: amount_volume = 0.0 for line in record.order_line: diff --git a/l10n_br_delivery/models/stock_picking.py b/l10n_br_delivery/models/stock_picking.py index 2ec714444df8..db45611220d5 100644 --- a/l10n_br_delivery/models/stock_picking.py +++ b/l10n_br_delivery/models/stock_picking.py @@ -1,14 +1,13 @@ # Copyright 2020 KMEE INFORMATICA LTDA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import api, models +from odoo import models class StockPicking(models.Model): _inherit = "stock.picking" - @api.multi def _add_delivery_cost_to_so(self): # disable this function since, if called, adds a delivery line to # order -> strategy no longer used, view amount_freight diff --git a/l10n_br_delivery/tests/test_delivery_inverse_amount.py b/l10n_br_delivery/tests/test_delivery_inverse_amount.py index 811c4b7b84da..1dcb804b9efa 100644 --- a/l10n_br_delivery/tests/test_delivery_inverse_amount.py +++ b/l10n_br_delivery/tests/test_delivery_inverse_amount.py @@ -195,7 +195,7 @@ def test_inverse_amount_freight_total(self): "Fiscal Document", ) - for line in fiscal_document_id.line_ids: + for line in fiscal_document_id.fiscal_line_ids: if line.name == "[FURN_7777] Office Chair": self.assertEqual( line.freight_value, @@ -216,7 +216,7 @@ def test_inverse_amount_freight_total(self): # with Form(fiscal_document_id) as doc: # doc.amount_freight_value = 10.0 - # for line in fiscal_document_id.line_ids: + # for line in fiscal_document_id.fiscal_line_ids: # if line.name == '[FURN_7777] Office Chair': # self.assertEqual( # line.freight_value, 6.36, @@ -238,7 +238,7 @@ def test_inverse_amount_freight_line(self): "Fiscal Document", ) - for line in fiscal_document_id.line_ids: + for line in fiscal_document_id.fiscal_line_ids: if line.name == "[FURN_7777] Office Chair": self.assertEqual( line.freight_value, @@ -259,7 +259,7 @@ def test_inverse_amount_freight_line(self): # with Form(fiscal_document_id) as doc: # doc.amount_freight_value = 10.0 - # for line in fiscal_document_id.line_ids: + # for line in fiscal_document_id.fiscal_line_ids: # if line.name == '[FURN_7777] Office Chair': # self.assertEqual( # line.freight_value, 8.75, @@ -281,7 +281,7 @@ def test_inverse_amount_insurance_total(self): "Fiscal Document", ) - for line in fiscal_document_id.line_ids: + for line in fiscal_document_id.fiscal_line_ids: if line.name == "[FURN_7777] Office Chair": self.assertEqual( line.insurance_value, @@ -302,7 +302,7 @@ def test_inverse_amount_insurance_total(self): # with Form(fiscal_document_id) as doc: # doc.amount_insurance_value = 10.0 - # for line in fiscal_document_id.line_ids: + # for line in fiscal_document_id.fiscal_line_ids: # if line.name == '[FURN_7777] Office Chair': # self.assertEqual( # line.insurance_value, 6.36, @@ -324,7 +324,7 @@ def test_inverse_amount_insurance_line(self): "Fiscal Document", ) - for line in fiscal_document_id.line_ids: + for line in fiscal_document_id.fiscal_line_ids: if line.name == "[FURN_7777] Office Chair": self.assertEqual( line.insurance_value, @@ -345,7 +345,7 @@ def test_inverse_amount_insurance_line(self): # with Form(fiscal_document_id) as doc: # doc.amount_insurance_value = 10.0 - # for line in fiscal_document_id.line_ids: + # for line in fiscal_document_id.fiscal_line_ids: # if line.name == '[FURN_7777] Office Chair': # self.assertEqual( # line.insurance_value, 8.75, @@ -366,7 +366,7 @@ def test_inverse_amount_other_costs_total(self): "Unexpected value for the field other_value from " "Fiscal Document", ) - for line in fiscal_document_id.line_ids: + for line in fiscal_document_id.fiscal_line_ids: if line.name == "[FURN_7777] Office Chair": self.assertEqual( line.other_value, @@ -387,7 +387,7 @@ def test_inverse_amount_other_costs_total(self): # with Form(fiscal_document_id) as doc: # doc.amount_other_value = 10.0 - # for line in fiscal_document_id.line_ids: + # for line in fiscal_document_id.fiscal_line_ids: # if line.name == '[FURN_7777] Office Chair': # self.assertEqual( # line.other_value, 6.36, @@ -408,7 +408,7 @@ def test_inverse_amount_other_line(self): "Unexpected value for the field other_value from " "Fiscal Document", ) - for line in fiscal_document_id.line_ids: + for line in fiscal_document_id.fiscal_line_ids: if line.name == "[FURN_7777] Office Chair": self.assertEqual( line.other_value, @@ -429,7 +429,7 @@ def test_inverse_amount_other_line(self): # with Form(fiscal_document_id) as doc: # doc.amount_other_value = 10.0 - # for line in fiscal_document_id.line_ids: + # for line in fiscal_document_id.fiscal_line_ids: # if line.name == '[FURN_7777] Office Chair': # self.assertEqual( # line.other_value, 8.75, @@ -494,13 +494,13 @@ def test_not_cost_ratio_by_lines(self): picking.button_validate() self.assertEqual(picking.state, "done") - self.sale_demo.action_invoice_create(final=True) + self.sale_demo._create_invoices(final=True) - self.assertEquals(self.sale_demo.state, "sale", "Error to confirm Sale Order.") + self.assertEqual(self.sale_demo.state, "sale", "Error to confirm Sale Order.") invoice = self.sale_demo.invoice_ids[0] - invoice.action_invoice_open() - self.assertEquals(invoice.state, "open", "Invoice should be in state Open") + invoice.action_post() + self.assertEqual(invoice.state, "posted", "Invoice should be in state Posted") for line in invoice.invoice_line_ids: other_line = invoice.invoice_line_ids.filtered( lambda o_l: o_l.id != line.id @@ -524,8 +524,8 @@ def test_not_cost_ratio_by_lines(self): fiscal_document_id = self.sale_demo.invoice_ids[0].fiscal_document_id - for line in fiscal_document_id.line_ids: - other_line = fiscal_document_id.line_ids.filtered( + for line in fiscal_document_id.fiscal_line_ids: + other_line = fiscal_document_id.fiscal_line_ids.filtered( lambda o_l: o_l.id != line.id ) self.assertNotEqual( diff --git a/l10n_br_delivery/views/l10n_br_delivery_view.xml b/l10n_br_delivery/views/l10n_br_delivery_view.xml index 33f4eb141996..f236947f516a 100644 --- a/l10n_br_delivery/views/l10n_br_delivery_view.xml +++ b/l10n_br_delivery/views/l10n_br_delivery_view.xml @@ -48,7 +48,6 @@ ir.actions.act_window l10n_br_delivery.carrier.vehicle tree,form - form From 99c12cda875fff8e89b108905e21fd4862b3d514 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Thu, 29 Sep 2022 17:11:23 -0300 Subject: [PATCH 175/223] [MIG] l10n_br_delivery: Demo Data and Tests. --- l10n_br_delivery/demo/sale_order_demo.xml | 8 ++ .../tests/test_delivery_inverse_amount.py | 114 ++---------------- 2 files changed, 15 insertions(+), 107 deletions(-) diff --git a/l10n_br_delivery/demo/sale_order_demo.xml b/l10n_br_delivery/demo/sale_order_demo.xml index 49e0f868aafb..a3394462ed11 100644 --- a/l10n_br_delivery/demo/sale_order_demo.xml +++ b/l10n_br_delivery/demo/sale_order_demo.xml @@ -33,6 +33,10 @@ 30 + + + + @@ -56,6 +60,10 @@ 15 + + + + diff --git a/l10n_br_delivery/tests/test_delivery_inverse_amount.py b/l10n_br_delivery/tests/test_delivery_inverse_amount.py index 1dcb804b9efa..03a1a2b3c967 100644 --- a/l10n_br_delivery/tests/test_delivery_inverse_amount.py +++ b/l10n_br_delivery/tests/test_delivery_inverse_amount.py @@ -1,4 +1,6 @@ # @ 2020 KMEE - www.kmee.com.br +# Copyright (C) 2022-Today - Akretion (). +# @author Magno Costa # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo.tests.common import Form, SavepointCase @@ -33,17 +35,17 @@ def setUpClass(cls): with so.order_line.new() as line: line.product_id = cls.env.ref("product.product_delivery_02") - # Change freight, insurance and other costs amount from - # sale_order_total_id + # Alteração para permitir do teste + cls.sale_order_line_id.company_id.delivery_costs = "total" + # Change freight, insurance and other costs amount by Total values with Form(cls.sale_order_total_id) as so: so.amount_freight_value = 100.0 so.amount_insurance_value = 100.0 so.amount_other_value = 100.0 - # Change freight, insurance and other costs amount from - # sale_order_lines_id lines - # TODO ?: alterando para permitir edição do campo e não falhar o teste + # Alteração para permitir do teste cls.sale_order_line_id.company_id.delivery_costs = "line" + # Change freight, insurance and other costs amount by Lines values with Form(cls.sale_order_line_id) as so: with so.order_line.edit(0) as line: line.freight_value = 70.00 @@ -211,23 +213,6 @@ def test_inverse_amount_freight_total(self): "Fiscal Document line", ) - # TODO ? : O documento fiscal so permite os valores serem informados - # por linha, pendente wizard p/ informar total e ratear por linhas - # with Form(fiscal_document_id) as doc: - # doc.amount_freight_value = 10.0 - - # for line in fiscal_document_id.fiscal_line_ids: - # if line.name == '[FURN_7777] Office Chair': - # self.assertEqual( - # line.freight_value, 6.36, - # "Unexpected value for the field freight_value from " - # "Fiscal Document line") - # if line.name == '[FURN_8888] Office Lamp': - # self.assertEqual( - # line.freight_value, 3.64, - # "Unexpected value for the field freight_value from " - # "Fiscal Document line") - def test_inverse_amount_freight_line(self): """Check Fiscal Document freight values for lines""" fiscal_document_id = self.sale_order_line_id.invoice_ids[0].fiscal_document_id @@ -254,23 +239,6 @@ def test_inverse_amount_freight_line(self): "Fiscal Document line", ) - # TODO ? : O documento fiscal so permite os valores serem informados - # por linha, pendente wizard p/ informar total e ratear por linhas - # with Form(fiscal_document_id) as doc: - # doc.amount_freight_value = 10.0 - - # for line in fiscal_document_id.fiscal_line_ids: - # if line.name == '[FURN_7777] Office Chair': - # self.assertEqual( - # line.freight_value, 8.75, - # "Unexpected value for the field freight_value from " - # "Fiscal Document line") - # if line.name == '[FURN_8888] Office Lamp': - # self.assertEqual( - # line.freight_value, 1.25, - # "Unexpected value for the field freight_value from " - # "Fiscal Document line") - def test_inverse_amount_insurance_total(self): """Check Fiscal Document insurance values for total""" fiscal_document_id = self.sale_order_total_id.invoice_ids[0].fiscal_document_id @@ -297,23 +265,6 @@ def test_inverse_amount_insurance_total(self): "Fiscal Document line", ) - # TODO ? : O documento fiscal so permite os valores serem informados - # por linha, pendente wizard p/ informar total e ratear por linhas - # with Form(fiscal_document_id) as doc: - # doc.amount_insurance_value = 10.0 - - # for line in fiscal_document_id.fiscal_line_ids: - # if line.name == '[FURN_7777] Office Chair': - # self.assertEqual( - # line.insurance_value, 6.36, - # "Unexpected value for the field insurance_value from " - # "Fiscal Document line") - # if line.name == '[FURN_8888] Office Lamp': - # self.assertEqual( - # line.insurance_value, 3.64, - # "Unexpected value for the field insurance_value from " - # "Fiscal Document line") - def test_inverse_amount_insurance_line(self): """Check Fiscal Document insurance values for lines""" fiscal_document_id = self.sale_order_line_id.invoice_ids[0].fiscal_document_id @@ -340,23 +291,6 @@ def test_inverse_amount_insurance_line(self): "Fiscal Document line", ) - # TODO ? : O documento fiscal so permite os valores serem informados - # por linha, pendente wizard p/ informar total e ratear por linhas - # with Form(fiscal_document_id) as doc: - # doc.amount_insurance_value = 10.0 - - # for line in fiscal_document_id.fiscal_line_ids: - # if line.name == '[FURN_7777] Office Chair': - # self.assertEqual( - # line.insurance_value, 8.75, - # "Unexpected value for the field insurance_value from " - # "Fiscal Document line") - # if line.name == '[FURN_8888] Office Lamp': - # self.assertEqual( - # line.insurance_value, 1.25, - # "Unexpected value for the field insurance_value from " - # "Fiscal Document line") - def test_inverse_amount_other_costs_total(self): """Check Fiscal Document other costs values for total""" fiscal_document_id = self.sale_order_total_id.invoice_ids[0].fiscal_document_id @@ -382,23 +316,6 @@ def test_inverse_amount_other_costs_total(self): "Fiscal Document line", ) - # TODO ? : O documento fiscal so permite os valores serem informados - # por linha, pendente wizard p/ informar total e ratear por linhas - # with Form(fiscal_document_id) as doc: - # doc.amount_other_value = 10.0 - - # for line in fiscal_document_id.fiscal_line_ids: - # if line.name == '[FURN_7777] Office Chair': - # self.assertEqual( - # line.other_value, 6.36, - # "Unexpected value for the field other_value from " - # "Fiscal Document line") - # if line.name == '[FURN_8888] Office Lamp': - # self.assertEqual( - # line.other_value, 3.64, - # "Unexpected value for the field other_value from " - # "Fiscal Document line") - def test_inverse_amount_other_line(self): """Check Fiscal Document other other values for lines""" fiscal_document_id = self.sale_order_line_id.invoice_ids[0].fiscal_document_id @@ -424,23 +341,6 @@ def test_inverse_amount_other_line(self): "Fiscal Document line", ) - # TODO ? : O documento fiscal so permite os valores serem informados - # por linha, pendente wizard p/ informar total e ratear por linhas - # with Form(fiscal_document_id) as doc: - # doc.amount_other_value = 10.0 - - # for line in fiscal_document_id.fiscal_line_ids: - # if line.name == '[FURN_7777] Office Chair': - # self.assertEqual( - # line.other_value, 8.75, - # "Unexpected value for the field other_value from " - # "Fiscal Document line") - # if line.name == '[FURN_8888] Office Lamp': - # self.assertEqual( - # line.other_value, 1.25, - # "Unexpected value for the field other_value from " - # "Fiscal Document line") - def test_not_cost_ratio_by_lines(self): """ Teste quando não deve acontecer divisão proporcional entre os valores, From 757604b919348c1302130154d35de8a37afc9074 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Thu, 29 Sep 2022 17:15:42 -0300 Subject: [PATCH 176/223] [MIG] l10n_br_delivery: Show field Carrier to user can choose the Transportation and make invisible Wizard to Delivery because there is not integration in localization yet. --- l10n_br_delivery/views/sale_order_view.xml | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/l10n_br_delivery/views/sale_order_view.xml b/l10n_br_delivery/views/sale_order_view.xml index c48ea94aca84..a2d8936b2f9c 100644 --- a/l10n_br_delivery/views/sale_order_view.xml +++ b/l10n_br_delivery/views/sale_order_view.xml @@ -11,6 +11,37 @@ + + + +

    +
    + +
    +
    + +
    +
    + + + + + From 73f897dff31ac6cc311f661518c207eec7cea91d Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Thu, 29 Sep 2022 17:30:55 -0300 Subject: [PATCH 177/223] [UPD] l10n_br_delivery: Update README files. --- l10n_br_delivery/readme/CONTRIBUTORS.rst | 1 + l10n_br_delivery/readme/HISTORY.rst | 4 ++++ l10n_br_delivery/readme/INSTALL.rst | 6 +++++- l10n_br_delivery/readme/ROADMAP.rst | 2 +- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/l10n_br_delivery/readme/CONTRIBUTORS.rst b/l10n_br_delivery/readme/CONTRIBUTORS.rst index 201c7451ce5a..1c21441f35eb 100644 --- a/l10n_br_delivery/readme/CONTRIBUTORS.rst +++ b/l10n_br_delivery/readme/CONTRIBUTORS.rst @@ -2,3 +2,4 @@ * Diego Paradeda * Gabriel Cardoso de Faria * Luis Otavio Malta Conceição +* Magno Costa diff --git a/l10n_br_delivery/readme/HISTORY.rst b/l10n_br_delivery/readme/HISTORY.rst index e69de29bb2d1..5d44a6c3136e 100644 --- a/l10n_br_delivery/readme/HISTORY.rst +++ b/l10n_br_delivery/readme/HISTORY.rst @@ -0,0 +1,4 @@ +14.0.1.0.0 (2022-09-29) +~~~~~~~~~~~~~~~~~~~~~~~ + +* Migration. diff --git a/l10n_br_delivery/readme/INSTALL.rst b/l10n_br_delivery/readme/INSTALL.rst index 75f244311185..ae8a1908cf0c 100644 --- a/l10n_br_delivery/readme/INSTALL.rst +++ b/l10n_br_delivery/readme/INSTALL.rst @@ -1 +1,5 @@ -To install this module, you need to do nothing +This module depends on: + +* l10n_br_sale_stock +* delivery +* delivery_carrier_partner diff --git a/l10n_br_delivery/readme/ROADMAP.rst b/l10n_br_delivery/readme/ROADMAP.rst index 4d2ece5d5b4b..154a79b22cd9 100644 --- a/l10n_br_delivery/readme/ROADMAP.rst +++ b/l10n_br_delivery/readme/ROADMAP.rst @@ -1 +1 @@ -* TODO! +* Integrar o modulo com os metódos de calculo automáticos do modulo delivery, hoje o usuário deve informar a Transportadora e o valor do Frete é informado manualmente. From a086aff7d1e7848711ee653f328e5c6f65010e2c Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Fri, 30 Sep 2022 15:04:09 -0300 Subject: [PATCH 178/223] [REF] l10n_br_delivery: Remove unnecessary parameter. --- l10n_br_delivery/models/delivery_carrier.py | 1 - 1 file changed, 1 deletion(-) diff --git a/l10n_br_delivery/models/delivery_carrier.py b/l10n_br_delivery/models/delivery_carrier.py index 768495d29f37..16822d6b5faa 100644 --- a/l10n_br_delivery/models/delivery_carrier.py +++ b/l10n_br_delivery/models/delivery_carrier.py @@ -16,7 +16,6 @@ class Carrier(models.Model): comodel_name="l10n_br_delivery.carrier.vehicle", inverse_name="carrier_id", string="Vehicles", - ondelete="cascade", ) def rate_shipment(self, order): From 74f3f908ff70f9d4142e9e6b59734fc0722da455 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Mon, 10 Oct 2022 14:27:23 -0300 Subject: [PATCH 179/223] [REF] l10n_br_delivery: Vehicle View. --- .../views/l10n_br_delivery_view.xml | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/l10n_br_delivery/views/l10n_br_delivery_view.xml b/l10n_br_delivery/views/l10n_br_delivery_view.xml index f236947f516a..81c7d7bbfcc1 100644 --- a/l10n_br_delivery/views/l10n_br_delivery_view.xml +++ b/l10n_br_delivery/views/l10n_br_delivery_view.xml @@ -7,22 +7,26 @@ l10n_br_delivery.carrier.vehicle form -
    - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + @@ -32,7 +36,7 @@ l10n_br_delivery.carrier.vehicle tree - + @@ -44,7 +48,7 @@ model="ir.actions.act_window" id="action_l10n_br_delivery_carrier_vehicle_form" > - Veículo + Vehicle ir.actions.act_window l10n_br_delivery.carrier.vehicle tree,form @@ -52,7 +56,7 @@ Date: Mon, 10 Oct 2022 14:28:48 -0300 Subject: [PATCH 180/223] [UPD] l10n_br_delivery: Readme files. --- l10n_br_delivery/__manifest__.py | 6 ++---- l10n_br_delivery/readme/CONFIGURE.rst | 8 +++++++- l10n_br_delivery/readme/CONTRIBUTORS.rst | 15 ++++++++++----- l10n_br_delivery/readme/DESCRIPTION.rst | 13 ++++++++++--- l10n_br_delivery/readme/HISTORY.rst | 10 ++++++++++ l10n_br_delivery/readme/USAGE.rst | 11 ++--------- 6 files changed, 41 insertions(+), 22 deletions(-) diff --git a/l10n_br_delivery/__manifest__.py b/l10n_br_delivery/__manifest__.py index 4a18cd784cef..30d296cab7f0 100644 --- a/l10n_br_delivery/__manifest__.py +++ b/l10n_br_delivery/__manifest__.py @@ -2,12 +2,10 @@ # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html { - "name": "Brazilian Localization Delivery", - "summary": """ - This module changes the delivery model strategy to match brazilian - standards.""", + "name": "delivery module Brazilian Localization", "license": "AGPL-3", "author": "Akretion, Odoo Community Association (OCA)", + "maintainers": ["renatonlima", "mbcosta"], "website": "https://github.com/OCA/l10n-brazil", "version": "14.0.1.0.0", "depends": [ diff --git a/l10n_br_delivery/readme/CONFIGURE.rst b/l10n_br_delivery/readme/CONFIGURE.rst index 307962dcecec..89f8c3d0d9f9 100644 --- a/l10n_br_delivery/readme/CONFIGURE.rst +++ b/l10n_br_delivery/readme/CONFIGURE.rst @@ -1 +1,7 @@ -No additional configuration is required to use this module +Cadastre os Métodos de Envio que poderão ser selecionados nos Pedidos de Vendas, em: + + * Inventário > Configuração > Entrega > Métodos de Envio + +Veja que cada método é referente a uma Transportadora, também é possível cadastrar os Veículos da Transportadora em: + + * Inventário > Configuração > Entrega > Veículo diff --git a/l10n_br_delivery/readme/CONTRIBUTORS.rst b/l10n_br_delivery/readme/CONTRIBUTORS.rst index 1c21441f35eb..7d1713d055a4 100644 --- a/l10n_br_delivery/readme/CONTRIBUTORS.rst +++ b/l10n_br_delivery/readme/CONTRIBUTORS.rst @@ -1,5 +1,10 @@ -* Renato Lima -* Diego Paradeda -* Gabriel Cardoso de Faria -* Luis Otavio Malta Conceição -* Magno Costa +* `Akretion `_: + + * Renato Lima + * Magno Costa + +* `KMEE `_: + + * Diego Paradeda + * Gabriel Cardoso de Faria + * Luis Otavio Malta Conceição diff --git a/l10n_br_delivery/readme/DESCRIPTION.rst b/l10n_br_delivery/readme/DESCRIPTION.rst index 14ac460b87bf..40a4f9767952 100644 --- a/l10n_br_delivery/readme/DESCRIPTION.rst +++ b/l10n_br_delivery/readme/DESCRIPTION.rst @@ -1,3 +1,10 @@ -This module was written to extend the functionality of delivery to support the -adequacy of Brazilian delivery standards -and allows you to apportion the value of freight, insurance and other costs. +*(summary: extends the delivery module to comply with the fiscal documents requirements)* + +Esse módulo localiza o módulo *delivery* para adequar as necessidades do Brasil. Em especial ele: + + * acrescenta informações para os Documentos Fiscais: Transportadora, responsabilidade do frete, volume e peso bruto. + * acrescenta na Transportadora o código ANTT e a lista de veículos. + * cria um modelo simples de veículo com os campos fiscais (placa, código ANTT, modelo, ano de fabricação...) + * desativa o método *_add_delivery_cost_to_so* da Expedição, pois o frete já esta corretamente informado no pedido. + * vale a pena notar que o rateamento do frete, seguro e outros custos já esta sendo feito pelo módulo l10n_br_fiscal, tanto para notas de saída como de entrada. + * se você for emitir NF-e, você precisa do módulo *l10n_br_delivery_nfe* que faz a integração deste módulo com o módulo *l10n_br_nfe*. diff --git a/l10n_br_delivery/readme/HISTORY.rst b/l10n_br_delivery/readme/HISTORY.rst index 5d44a6c3136e..eb0ffa7156d7 100644 --- a/l10n_br_delivery/readme/HISTORY.rst +++ b/l10n_br_delivery/readme/HISTORY.rst @@ -2,3 +2,13 @@ ~~~~~~~~~~~~~~~~~~~~~~~ * Migration. + +12.0.1.0.0 (2021-08-28) +~~~~~~~~~~~~~~~~~~~~~~~ + +* Migration + +8.0.1.0.0 (2021-01-06) +~~~~~~~~~~~~~~~~~~~~~~ + +* 1st version diff --git a/l10n_br_delivery/readme/USAGE.rst b/l10n_br_delivery/readme/USAGE.rst index 921e19dbfad5..cac8c934791e 100644 --- a/l10n_br_delivery/readme/USAGE.rst +++ b/l10n_br_delivery/readme/USAGE.rst @@ -1,10 +1,3 @@ -To use this module, you need to: +Para usar esse modulo você precisa: -* Create a quote and enter freight, insurance and other costs for each product line -* Check the total values of the quotation being updated according to the sum of the values of the product lines - -Alternatively: - -* Change only the total freight, insurance and other quote costs - -* Check that each of the previous values for each product line has been set proportionally to the value of the product +* Criar um Pedido de Venda informar o Método de Entrega e o valor do Frete, se necessário os valores de Seguro e Outros Custos. From bb45ce4a6d5d3cf286a8a94f8e99e0fd96e57fdc Mon Sep 17 00:00:00 2001 From: oca-ci Date: Tue, 11 Oct 2022 09:01:32 +0000 Subject: [PATCH 181/223] [UPD] Update l10n_br_delivery.pot --- l10n_br_delivery/i18n/l10n_br_delivery.pot | 108 +++++++++++---------- 1 file changed, 57 insertions(+), 51 deletions(-) diff --git a/l10n_br_delivery/i18n/l10n_br_delivery.pot b/l10n_br_delivery/i18n/l10n_br_delivery.pot index cd89c57d40ab..7e02d6802329 100644 --- a/l10n_br_delivery/i18n/l10n_br_delivery.pot +++ b/l10n_br_delivery/i18n/l10n_br_delivery.pot @@ -1,12 +1,12 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * l10n_br_delivery +# * l10n_br_delivery # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 12.0\n" +"Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: <>\n" +"Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -14,32 +14,32 @@ msgstr "" "Plural-Forms: \n" #. module: l10n_br_delivery -#: selection:account.incoterms,freight_responsibility:0 +#: model:ir.model.fields.selection,name:l10n_br_delivery.selection__account_incoterms__freight_responsibility__0 msgid "0 - Contratação do Frete por conta do Remetente (CIF)" msgstr "" #. module: l10n_br_delivery -#: selection:account.incoterms,freight_responsibility:0 +#: model:ir.model.fields.selection,name:l10n_br_delivery.selection__account_incoterms__freight_responsibility__1 msgid "1 - Contratação do Frete por conta do destinatário/remetente (FOB)" msgstr "" #. module: l10n_br_delivery -#: selection:account.incoterms,freight_responsibility:0 +#: model:ir.model.fields.selection,name:l10n_br_delivery.selection__account_incoterms__freight_responsibility__2 msgid "2 - Contratação do Frete por conta de terceiros" msgstr "" #. module: l10n_br_delivery -#: selection:account.incoterms,freight_responsibility:0 +#: model:ir.model.fields.selection,name:l10n_br_delivery.selection__account_incoterms__freight_responsibility__3 msgid "3 - Transporte próprio por conta do remetente" msgstr "" #. module: l10n_br_delivery -#: selection:account.incoterms,freight_responsibility:0 +#: model:ir.model.fields.selection,name:l10n_br_delivery.selection__account_incoterms__freight_responsibility__4 msgid "4 - Transporte próprio por conta do destinatário" msgstr "" #. module: l10n_br_delivery -#: selection:account.incoterms,freight_responsibility:0 +#: model:ir.model.fields.selection,name:l10n_br_delivery.selection__account_incoterms__freight_responsibility__9 msgid "9 - Sem Ocorrência de transporte." msgstr "" @@ -79,18 +79,19 @@ msgid "Brazil" msgstr "" #. module: l10n_br_delivery -#: selection:l10n_br_delivery.carrier.vehicle,type:0 +#: model:ir.model.fields.selection,name:l10n_br_delivery.selection__l10n_br_delivery_carrier_vehicle__type__bau msgid "Caminhão Baú" msgstr "" #. module: l10n_br_delivery -#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_invoice__carrier_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_bank_statement_line__carrier_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_move__carrier_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_payment__carrier_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_contract_contract__carrier_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__carrier_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__carrier_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__carrier_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_purchase_order__carrier_id -#: model:ir.model.fields,field_description:l10n_br_delivery.field_repair_order__carrier_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_stock_picking__carrier_id msgid "Carrier" msgstr "" @@ -125,28 +126,24 @@ msgstr "" msgid "Created on" msgstr "" -#. module: l10n_br_delivery -#: model_terms:ir.ui.view,arch_db:l10n_br_delivery.l10n_br_delivery_carrier_vehicle_form -msgid "Dados do Veículo" -msgstr "" - #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__carrier_id msgid "Delivery Method" msgstr "" -#. module: l10n_br_delivery -#: model:ir.model,name:l10n_br_delivery.model_delivery_carrier -msgid "Delivery Methods" -msgstr "" - #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__description msgid "Description" msgstr "" #. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_incoterms__display_name +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_move__display_name +#: model:ir.model.fields,field_description:l10n_br_delivery.field_delivery_carrier__display_name #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__display_name +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__display_name +#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__display_name +#: model:ir.model.fields,field_description:l10n_br_delivery.field_stock_picking__display_name msgid "Display Name" msgstr "" @@ -176,16 +173,24 @@ msgid "Guarulhos" msgstr "" #. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_incoterms__id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_move__id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_delivery_carrier__id #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_stock_picking__id msgid "ID" msgstr "" #. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_bank_statement_line__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_move__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_payment__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_contract_contract__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_purchase_order__incoterm_id -#: model:ir.model.fields,field_description:l10n_br_delivery.field_repair_order__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_stock_picking__incoterm_id msgid "Incoterm" @@ -202,23 +207,33 @@ msgid "Informação usada na emissão de Documentos Fiscais" msgstr "" #. module: l10n_br_delivery +#: model:ir.model.fields,help:l10n_br_delivery.field_account_bank_statement_line__incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_account_move__incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_account_payment__incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_contract_contract__incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_l10n_br_fiscal_document__incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_purchase_order__incoterm_id -#: model:ir.model.fields,help:l10n_br_delivery.field_repair_order__incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_sale_order__incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_stock_picking__incoterm_id -msgid "International Commercial Terms are a series of predefined commercial terms used in international transactions." +msgid "" +"International Commercial Terms are a series of predefined commercial terms " +"used in international transactions." msgstr "" #. module: l10n_br_delivery -#: model:ir.model,name:l10n_br_delivery.model_account_invoice -msgid "Invoice" +#: model:ir.model,name:l10n_br_delivery.model_account_move +msgid "Journal Entry" msgstr "" #. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_incoterms____last_update +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_move____last_update +#: model:ir.model.fields,field_description:l10n_br_delivery.field_delivery_carrier____last_update #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle____last_update +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document_mixin____last_update +#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order____last_update +#: model:ir.model.fields,field_description:l10n_br_delivery.field_stock_picking____last_update msgid "Last Modified on" msgstr "" @@ -243,25 +258,23 @@ msgid "Name" msgstr "" #. module: l10n_br_delivery -#: code:addons/l10n_br_delivery/models/sale_order.py:42 -#, python-format -msgid "No carrier set for this order." +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__plate +msgid "Placa" msgstr "" #. module: l10n_br_delivery -#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__plate -msgid "Placa" +#: model:ir.model,name:l10n_br_delivery.model_sale_order +msgid "Sales Order" msgstr "" #. module: l10n_br_delivery -#: code:addons/l10n_br_delivery/models/sale_order.py:45 -#, python-format -msgid "Please use \"Check price\" in order to compute a shipping price for this quotation." +#: model_terms:ir.ui.view,arch_db:l10n_br_delivery.l10n_br_delivery_carrier_vehicle_form +msgid "Shipping Company" msgstr "" #. module: l10n_br_delivery -#: model:ir.model,name:l10n_br_delivery.model_sale_order -msgid "Sale Order" +#: model:ir.model,name:l10n_br_delivery.model_delivery_carrier +msgid "Shipping Methods" msgstr "" #. module: l10n_br_delivery @@ -280,31 +293,24 @@ msgid "Transfer" msgstr "" #. module: l10n_br_delivery +#: model:ir.actions.act_window,name:l10n_br_delivery.action_l10n_br_delivery_carrier_vehicle_form +#: model:ir.ui.menu,name:l10n_br_delivery.menu_l10n_br_delivery_carrier_vehicle_form #: model_terms:ir.ui.view,arch_db:l10n_br_delivery.l10n_br_delivery_carrier_vehicle_form -msgid "Transportadora" -msgstr "" - -#. module: l10n_br_delivery -#: model:ir.model.fields,field_description:l10n_br_delivery.field_delivery_carrier__vehicle_ids -msgid "Vehicles" +#: model_terms:ir.ui.view,arch_db:l10n_br_delivery.l10n_br_delivery_carrier_vehicle_tree +msgid "Vehicle" msgstr "" #. module: l10n_br_delivery -#: model:ir.actions.act_window,name:l10n_br_delivery.action_l10n_br_delivery_carrier_vehicle_form -#: model:ir.ui.menu,name:l10n_br_delivery.menu_l10n_br_delivery_carrier_vehicle_form #: model_terms:ir.ui.view,arch_db:l10n_br_delivery.l10n_br_delivery_carrier_vehicle_form -#: model_terms:ir.ui.view,arch_db:l10n_br_delivery.l10n_br_delivery_carrier_vehicle_tree -msgid "Veículo" +msgid "Vehicle Data" msgstr "" #. module: l10n_br_delivery -#: code:addons/l10n_br_delivery/models/sale_order.py:39 -#, python-format -msgid "You can add delivery price only on unconfirmed quotations." +#: model:ir.model.fields,field_description:l10n_br_delivery.field_delivery_carrier__vehicle_ids +msgid "Vehicles" msgstr "" #. module: l10n_br_delivery #: model_terms:ir.ui.view,arch_db:l10n_br_delivery.l10n_br_delivery_carrier_form_view msgid "[('supplier', '=', True)]" msgstr "" - From bb9cc0e2df78b06217ac22edb9c4914886632a49 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Tue, 11 Oct 2022 09:14:34 +0000 Subject: [PATCH 182/223] [UPD] README.rst --- l10n_br_delivery/README.rst | 97 +++++++++---- .../static/description/index.html | 129 +++++++++++++----- 2 files changed, 163 insertions(+), 63 deletions(-) diff --git a/l10n_br_delivery/README.rst b/l10n_br_delivery/README.rst index 680faf69df5b..81f141e0db67 100644 --- a/l10n_br_delivery/README.rst +++ b/l10n_br_delivery/README.rst @@ -1,6 +1,6 @@ -=============================== -Brazilian Localization Delivery -=============================== +====================================== +delivery module Brazilian Localization +====================================== .. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! @@ -14,20 +14,27 @@ Brazilian Localization Delivery :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--brazil-lightgray.png?logo=github - :target: https://github.com/OCA/l10n-brazil/tree/12.0/l10n_br_delivery + :target: https://github.com/OCA/l10n-brazil/tree/14.0/l10n_br_delivery :alt: OCA/l10n-brazil .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/l10n-brazil-12-0/l10n-brazil-12-0-l10n_br_delivery + :target: https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_delivery :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/124/12.0 + :target: https://runbot.odoo-community.org/runbot/124/14.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| -This module was written to extend the functionality of delivery to support the -adequacy of Brazilian delivery standards -and allows you to apportion the value of freight, insurance and other costs. +*(summary: extends the delivery module to comply with the fiscal documents requirements)* + +Esse módulo localiza o módulo *delivery* para adequar as necessidades do Brasil. Em especial ele: + + * acrescenta informações para os Documentos Fiscais: Transportadora, responsabilidade do frete, volume e peso bruto. + * acrescenta na Transportadora o código ANTT e a lista de veículos. + * cria um modelo simples de veículo com os campos fiscais (placa, código ANTT, modelo, ano de fabricação...) + * desativa o método *_add_delivery_cost_to_so* da Expedição, pois o frete já esta corretamente informado no pedido. + * vale a pena notar que o rateamento do frete, seguro e outros custos já esta sendo feito pelo módulo l10n_br_fiscal, tanto para notas de saída como de entrada. + * se você for emitir NF-e, você precisa do módulo *l10n_br_delivery_nfe* que faz a integração deste módulo com o módulo *l10n_br_nfe*. **Table of contents** @@ -37,31 +44,52 @@ and allows you to apportion the value of freight, insurance and other costs. Installation ============ -To install this module, you need to do nothing +This module depends on: + +* l10n_br_sale_stock +* delivery +* delivery_carrier_partner Configuration ============= -No additional configuration is required to use this module +Cadastre os Métodos de Envio que poderão ser selecionados nos Pedidos de Vendas, em: -Usage -===== + * Inventário > Configuração > Entrega > Métodos de Envio -To use this module, you need to: +Veja que cada método é referente a uma Transportadora, também é possível cadastrar os Veículos da Transportadora em: -* Create a quote and enter freight, insurance and other costs for each product line -* Check the total values of the quotation being updated according to the sum of the values of the product lines + * Inventário > Configuração > Entrega > Veículo -Alternatively: +Usage +===== -* Change only the total freight, insurance and other quote costs +Para usar esse modulo você precisa: -* Check that each of the previous values for each product line has been set proportionally to the value of the product +* Criar um Pedido de Venda informar o Método de Entrega e o valor do Frete, se necessário os valores de Seguro e Outros Custos. Known issues / Roadmap ====================== -* TODO! +* Integrar o modulo com os metódos de calculo automáticos do modulo delivery, hoje o usuário deve informar a Transportadora e o valor do Frete é informado manualmente. + +Changelog +========= + +14.0.1.0.0 (2022-09-29) +~~~~~~~~~~~~~~~~~~~~~~~ + +* Migration. + +12.0.1.0.0 (2021-08-28) +~~~~~~~~~~~~~~~~~~~~~~~ + +* Migration + +8.0.1.0.0 (2021-01-06) +~~~~~~~~~~~~~~~~~~~~~~ + +* 1st version Bug Tracker =========== @@ -69,7 +97,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -84,10 +112,16 @@ Authors Contributors ~~~~~~~~~~~~ -* Renato Lima -* Diego Paradeda -* Gabriel Cardoso de Faria -* Luis Otavio Malta Conceição +* `Akretion `_: + + * Renato Lima + * Magno Costa + +* `KMEE `_: + + * Diego Paradeda + * Gabriel Cardoso de Faria + * Luis Otavio Malta Conceição Maintainers ~~~~~~~~~~~ @@ -102,6 +136,17 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/l10n-brazil `_ project on GitHub. +.. |maintainer-renatonlima| image:: https://github.com/renatonlima.png?size=40px + :target: https://github.com/renatonlima + :alt: renatonlima +.. |maintainer-mbcosta| image:: https://github.com/mbcosta.png?size=40px + :target: https://github.com/mbcosta + :alt: mbcosta + +Current `maintainers `__: + +|maintainer-renatonlima| |maintainer-mbcosta| + +This module is part of the `OCA/l10n-brazil `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/l10n_br_delivery/static/description/index.html b/l10n_br_delivery/static/description/index.html index 4b7e135b63b1..7bc3fc5f22a2 100644 --- a/l10n_br_delivery/static/description/index.html +++ b/l10n_br_delivery/static/description/index.html @@ -4,7 +4,7 @@ -Brazilian Localization Delivery +delivery module Brazilian Localization -
    -

    Brazilian Localization Delivery

    +
    +

    delivery module Brazilian Localization

    -

    Beta License: AGPL-3 OCA/l10n-brazil Translate me on Weblate Try me on Runbot

    -

    This module was written to extend the functionality of delivery to support the -adequacy of Brazilian delivery standards -and allows you to apportion the value of freight, insurance and other costs.

    +

    Beta License: AGPL-3 OCA/l10n-brazil Translate me on Weblate Try me on Runbot

    +

    (summary: extends the delivery module to comply with the fiscal documents requirements)

    +

    Esse módulo localiza o módulo delivery para adequar as necessidades do Brasil. Em especial ele:

    +
    +
      +
    • acrescenta informações para os Documentos Fiscais: Transportadora, responsabilidade do frete, volume e peso bruto.
    • +
    • acrescenta na Transportadora o código ANTT e a lista de veículos.
    • +
    • cria um modelo simples de veículo com os campos fiscais (placa, código ANTT, modelo, ano de fabricação…)
    • +
    • desativa o método _add_delivery_cost_to_so da Expedição, pois o frete já esta corretamente informado no pedido.
    • +
    • vale a pena notar que o rateamento do frete, seguro e outros custos já esta sendo feito pelo módulo l10n_br_fiscal, tanto para notas de saída como de entrada.
    • +
    • se você for emitir NF-e, você precisa do módulo l10n_br_delivery_nfe que faz a integração deste módulo com o módulo l10n_br_nfe.
    • +
    +

    Table of contents

    -

    Installation

    -

    To install this module, you need to do nothing

    +

    Installation

    +

    This module depends on:

    +
      +
    • l10n_br_sale_stock
    • +
    • delivery
    • +
    • delivery_carrier_partner
    • +
    -

    Configuration

    -

    No additional configuration is required to use this module

    +

    Configuration

    +

    Cadastre os Métodos de Envio que poderão ser selecionados nos Pedidos de Vendas, em:

    +
    +
      +
    • Inventário > Configuração > Entrega > Métodos de Envio
    • +
    +
    +

    Veja que cada método é referente a uma Transportadora, também é possível cadastrar os Veículos da Transportadora em:

    +
    +
      +
    • Inventário > Configuração > Entrega > Veículo
    • +
    +
    -

    Usage

    -

    To use this module, you need to:

    +

    Usage

    +

    Para usar esse modulo você precisa:

    +
      +
    • Criar um Pedido de Venda informar o Método de Entrega e o valor do Frete, se necessário os valores de Seguro e Outros Custos.
    • +
    +
    +
    +

    Known issues / Roadmap

      -
    • Create a quote and enter freight, insurance and other costs for each product line
    • -
    • Check the total values of the quotation being updated according to the sum of the values of the product lines
    • +
    • Integrar o modulo com os metódos de calculo automáticos do modulo delivery, hoje o usuário deve informar a Transportadora e o valor do Frete é informado manualmente.
    -

    Alternatively:

    +
    +
    +

    Changelog

    +
    +

    14.0.1.0.0 (2022-09-29)

      -
    • Change only the total freight, insurance and other quote costs
    • -
    • Check that each of the previous values for each product line has been set proportionally to the value of the product
    • +
    • Migration.
    -
    -

    Known issues / Roadmap

    +
    +

    12.0.1.0.0 (2021-08-28)

    +
      +
    • Migration
    • +
    +
    +
    +

    8.0.1.0.0 (2021-01-06)

      -
    • TODO!
    • +
    • 1st version
    +
    -

    Bug Tracker

    +

    Bug Tracker

    Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -feedback.

    +feedback.

    Do not contact contributors directly about support or help with technical issues.

    -

    Credits

    +

    Credits

    -

    Authors

    +

    Authors

    • Akretion
    -

    Contributors

    +

    Contributors

    -

    Maintainers

    +

    Maintainers

    This module is maintained by the OCA.

    Odoo Community Association

    OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

    -

    This module is part of the OCA/l10n-brazil project on GitHub.

    +

    Current maintainers:

    +

    renatonlima mbcosta

    +

    This module is part of the OCA/l10n-brazil project on GitHub.

    You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

    From 9fed9161bef16f0d82fd8fec616acbcf7b629f62 Mon Sep 17 00:00:00 2001 From: oca-ci Date: Tue, 18 Oct 2022 19:42:41 +0000 Subject: [PATCH 183/223] [UPD] Update l10n_br_delivery.pot --- l10n_br_delivery/i18n/l10n_br_delivery.pot | 3 +++ 1 file changed, 3 insertions(+) diff --git a/l10n_br_delivery/i18n/l10n_br_delivery.pot b/l10n_br_delivery/i18n/l10n_br_delivery.pot index 7e02d6802329..b0bb72db94b2 100644 --- a/l10n_br_delivery/i18n/l10n_br_delivery.pot +++ b/l10n_br_delivery/i18n/l10n_br_delivery.pot @@ -92,6 +92,7 @@ msgstr "" #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__carrier_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__carrier_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_purchase_order__carrier_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_repair_order__carrier_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_stock_picking__carrier_id msgid "Carrier" msgstr "" @@ -191,6 +192,7 @@ msgstr "" #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_purchase_order__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_repair_order__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_stock_picking__incoterm_id msgid "Incoterm" @@ -214,6 +216,7 @@ msgstr "" #: model:ir.model.fields,help:l10n_br_delivery.field_l10n_br_fiscal_document__incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_purchase_order__incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_repair_order__incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_sale_order__incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_stock_picking__incoterm_id msgid "" From 3226cfca4da2f41a5ad982cd84bdf031330c5c89 Mon Sep 17 00:00:00 2001 From: Weblate Date: Tue, 18 Oct 2022 19:57:50 +0000 Subject: [PATCH 184/223] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: l10n-brazil-14.0/l10n-brazil-14.0-l10n_br_delivery Translate-URL: https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_delivery/ --- l10n_br_delivery/i18n/pt_BR.po | 354 +++++++++++++++++++++++++++++---- 1 file changed, 316 insertions(+), 38 deletions(-) diff --git a/l10n_br_delivery/i18n/pt_BR.po b/l10n_br_delivery/i18n/pt_BR.po index 174e6b90f0b3..285a0591273b 100644 --- a/l10n_br_delivery/i18n/pt_BR.po +++ b/l10n_br_delivery/i18n/pt_BR.po @@ -1,6 +1,6 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * l10n_br_delivery +# * l10n_br_delivery # msgid "" msgstr "" @@ -17,57 +17,281 @@ msgstr "" "X-Generator: Weblate 4.3.2\n" #. module: l10n_br_delivery -#: model:ir.model,name:l10n_br_delivery.model_l10n_br_fiscal_document -msgid "Fiscal Document" -msgstr "Documento Fiscal" +#: model:ir.model.fields.selection,name:l10n_br_delivery.selection__account_incoterms__freight_responsibility__0 +msgid "0 - Contratação do Frete por conta do Remetente (CIF)" +msgstr "" #. module: l10n_br_delivery -#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__amount_freight -msgid "Freight" -msgstr "Frete" +#: model:ir.model.fields.selection,name:l10n_br_delivery.selection__account_incoterms__freight_responsibility__1 +msgid "1 - Contratação do Frete por conta do destinatário/remetente (FOB)" +msgstr "" #. module: l10n_br_delivery -#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_invoice__amount_freight_value -#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__amount_freight_value -msgid "Freight Value" -msgstr "Valor do Frete" +#: model:ir.model.fields.selection,name:l10n_br_delivery.selection__account_incoterms__freight_responsibility__2 +msgid "2 - Contratação do Frete por conta de terceiros" +msgstr "" #. module: l10n_br_delivery -#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__amount_insurance -msgid "Insurance" -msgstr "Seguros" +#: model:ir.model.fields.selection,name:l10n_br_delivery.selection__account_incoterms__freight_responsibility__3 +msgid "3 - Transporte próprio por conta do remetente" +msgstr "" #. module: l10n_br_delivery -#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_invoice__amount_insurance_value -#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__amount_insurance_value -msgid "Insurance Value" -msgstr "Valor do Seguro" +#: model:ir.model.fields.selection,name:l10n_br_delivery.selection__account_incoterms__freight_responsibility__4 +msgid "4 - Transporte próprio por conta do destinatário" +msgstr "" #. module: l10n_br_delivery -#: code:addons/l10n_br_delivery/models/sale_order.py:36 -#, python-format -msgid "No carrier set for this order." -msgstr "Nenhum operadora definida para esta ordem." +#: model:ir.model.fields.selection,name:l10n_br_delivery.selection__account_incoterms__freight_responsibility__9 +msgid "9 - Sem Ocorrência de transporte." +msgstr "" #. module: l10n_br_delivery -#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_invoice__amount_other_costs_value -#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__amount_other_costs_value -#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__amount_costs -msgid "Other Costs" -msgstr "Outros Custos" +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__rntc_code +msgid "ANTT Code" +msgstr "" #. module: l10n_br_delivery -#: code:addons/l10n_br_delivery/models/sale_order.py:38 -#, python-format -msgid "Please use \"Check price\" in order to compute a shipping price for this quotation." +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__active +msgid "Active" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__amount_gross_weight +msgid "Amount Gross Weight" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__amount_volume +msgid "Amount Volume" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__manufacture_year +msgid "Ano de Fabricação" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__model_year +msgid "Ano do Modelo" +msgstr "" + +#. module: l10n_br_delivery +#: model:res.partner,nfe40_xPais:l10n_br_delivery.test_carrier +msgid "Brazil" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields.selection,name:l10n_br_delivery.selection__l10n_br_delivery_carrier_vehicle__type__bau +msgid "Caminhão Baú" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_bank_statement_line__carrier_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_move__carrier_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_payment__carrier_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_contract_contract__carrier_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__carrier_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__carrier_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__carrier_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_purchase_order__carrier_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_repair_order__carrier_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_stock_picking__carrier_id +msgid "Carrier" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model,name:l10n_br_delivery.model_l10n_br_delivery_carrier_vehicle +msgid "Carrier Vehicle" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__city_id +msgid "City" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_delivery_carrier__antt_code +msgid "Codigo ANTT" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__country_id +msgid "Country" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__create_uid +msgid "Created by" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__create_date +msgid "Created on" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__carrier_id +msgid "Delivery Method" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__description +msgid "Description" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_incoterms__display_name +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_move__display_name +#: model:ir.model.fields,field_description:l10n_br_delivery.field_delivery_carrier__display_name +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__display_name +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__display_name +#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__display_name +#: model:ir.model.fields,field_description:l10n_br_delivery.field_stock_picking__display_name +msgid "Display Name" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model,name:l10n_br_delivery.model_l10n_br_fiscal_document_mixin +msgid "Document Fiscal Mixin" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__driver +msgid "Driver" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,help:l10n_br_delivery.field_sale_order__carrier_id +msgid "Fill this field if you plan to invoice the shipping based on picking." +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_incoterms__freight_responsibility +msgid "Frete por Conta" +msgstr "" + +#. module: l10n_br_delivery +#: model:res.partner,nfe40_xMun:l10n_br_delivery.test_carrier +msgid "Guarulhos" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_incoterms__id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_move__id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_delivery_carrier__id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_stock_picking__id +msgid "ID" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_bank_statement_line__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_move__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_payment__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_contract_contract__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_purchase_order__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_repair_order__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_stock_picking__incoterm_id +msgid "Incoterm" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model,name:l10n_br_delivery.model_account_incoterms +msgid "Incoterms" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,help:l10n_br_delivery.field_account_incoterms__freight_responsibility +msgid "Informação usada na emissão de Documentos Fiscais" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,help:l10n_br_delivery.field_account_bank_statement_line__incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_account_move__incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_account_payment__incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_contract_contract__incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_l10n_br_fiscal_document__incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_purchase_order__incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_repair_order__incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_sale_order__incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_stock_picking__incoterm_id +msgid "" +"International Commercial Terms are a series of predefined commercial terms " +"used in international transactions." +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model,name:l10n_br_delivery.model_account_move +msgid "Journal Entry" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_incoterms____last_update +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_move____last_update +#: model:ir.model.fields,field_description:l10n_br_delivery.field_delivery_carrier____last_update +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle____last_update +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document_mixin____last_update +#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order____last_update +#: model:ir.model.fields,field_description:l10n_br_delivery.field_stock_picking____last_update +msgid "Last Modified on" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__write_date +msgid "Last Updated on" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__type +msgid "Model Type" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__name +msgid "Name" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__plate +msgid "Placa" msgstr "" -"Por favor, use \"Verificar preço\" para calcular um preço de envio para esta " -"cotação." #. module: l10n_br_delivery #: model:ir.model,name:l10n_br_delivery.model_sale_order -msgid "Sale Order" -msgstr "Pedido de Venda" +msgid "Sales Order" +msgstr "" + +#. module: l10n_br_delivery +#: model_terms:ir.ui.view,arch_db:l10n_br_delivery.l10n_br_delivery_carrier_vehicle_form +msgid "Shipping Company" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model,name:l10n_br_delivery.model_delivery_carrier +msgid "Shipping Methods" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__state_id +msgid "State" +msgstr "" + +#. module: l10n_br_delivery +#: model:delivery.carrier,name:l10n_br_delivery.test_br_delivery_carrier +msgid "Teste - l10n_br_delivery" +msgstr "" #. module: l10n_br_delivery #: model:ir.model,name:l10n_br_delivery.model_stock_picking @@ -75,8 +299,62 @@ msgid "Transfer" msgstr "Transferir" #. module: l10n_br_delivery -#: code:addons/l10n_br_delivery/models/sale_order.py:32 -#, python-format -msgid "You can add delivery price only on unconfirmed quotations." +#: model:ir.actions.act_window,name:l10n_br_delivery.action_l10n_br_delivery_carrier_vehicle_form +#: model:ir.ui.menu,name:l10n_br_delivery.menu_l10n_br_delivery_carrier_vehicle_form +#: model_terms:ir.ui.view,arch_db:l10n_br_delivery.l10n_br_delivery_carrier_vehicle_form +#: model_terms:ir.ui.view,arch_db:l10n_br_delivery.l10n_br_delivery_carrier_vehicle_tree +msgid "Vehicle" +msgstr "" + +#. module: l10n_br_delivery +#: model_terms:ir.ui.view,arch_db:l10n_br_delivery.l10n_br_delivery_carrier_vehicle_form +msgid "Vehicle Data" +msgstr "" + +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_delivery_carrier__vehicle_ids +msgid "Vehicles" +msgstr "" + +#. module: l10n_br_delivery +#: model_terms:ir.ui.view,arch_db:l10n_br_delivery.l10n_br_delivery_carrier_form_view +msgid "[('supplier', '=', True)]" msgstr "" -"Você pode adicionar preço de entrega apenas em cotações não confirmadas." + +#~ msgid "Fiscal Document" +#~ msgstr "Documento Fiscal" + +#~ msgid "Freight" +#~ msgstr "Frete" + +#~ msgid "Freight Value" +#~ msgstr "Valor do Frete" + +#~ msgid "Insurance" +#~ msgstr "Seguros" + +#~ msgid "Insurance Value" +#~ msgstr "Valor do Seguro" + +#, python-format +#~ msgid "No carrier set for this order." +#~ msgstr "Nenhum operadora definida para esta ordem." + +#~ msgid "Other Costs" +#~ msgstr "Outros Custos" + +#, python-format +#~ msgid "" +#~ "Please use \"Check price\" in order to compute a shipping price for this " +#~ "quotation." +#~ msgstr "" +#~ "Por favor, use \"Verificar preço\" para calcular um preço de envio para " +#~ "esta cotação." + +#~ msgid "Sale Order" +#~ msgstr "Pedido de Venda" + +#, python-format +#~ msgid "You can add delivery price only on unconfirmed quotations." +#~ msgstr "" +#~ "Você pode adicionar preço de entrega apenas em cotações não confirmadas." From 74cef22e4594f9829cc649df0b70c04358967fa6 Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Fri, 14 Oct 2022 15:27:06 -0300 Subject: [PATCH 185/223] [IMP] l10n_br_delivery: force the distribution of the freight value on the lines when it is calculated --- l10n_br_delivery/models/delivery_carrier.py | 22 --------------------- l10n_br_delivery/models/sale_order.py | 4 ++++ l10n_br_delivery/views/sale_order_view.xml | 7 ------- 3 files changed, 4 insertions(+), 29 deletions(-) diff --git a/l10n_br_delivery/models/delivery_carrier.py b/l10n_br_delivery/models/delivery_carrier.py index 16822d6b5faa..f783c639ff02 100644 --- a/l10n_br_delivery/models/delivery_carrier.py +++ b/l10n_br_delivery/models/delivery_carrier.py @@ -17,25 +17,3 @@ class Carrier(models.Model): inverse_name="carrier_id", string="Vehicles", ) - - def rate_shipment(self, order): - """Compute the price of the order shipment - - :param order: record of sale.order - :return dict: {'success': boolean, - 'price': a float, - 'error_message': a string containing an error message, - 'warning_message': a string containing a warning message} - # TODO maybe the currency code? - """ - self.ensure_one() - res = super().rate_shipment(order) - # TODO: Localização deveria ter uma maior aderencia - # aos metodos do core, mapear melhor os processos, - # com dados de demo e testes. - # Se o Valor Total de Frete estiver preenchido ele tem - # preferencia sobre o valor Calculado. - if order.amount_freight_value > 0.0: - res["price"] = order.amount_freight_value - - return res diff --git a/l10n_br_delivery/models/sale_order.py b/l10n_br_delivery/models/sale_order.py index 4d81f77bcb23..2f2106f5caca 100644 --- a/l10n_br_delivery/models/sale_order.py +++ b/l10n_br_delivery/models/sale_order.py @@ -40,6 +40,10 @@ def set_delivery_line(self, carrier, amount): for order in self: order.carrier_id = carrier.id order.amount_freight_value = amount + if order.delivery_costs == "line": + order.delivery_costs = "total" + order.amount_freight_value = amount + order.delivery_costs = "line" return True def _compute_amount_gross_weight(self): diff --git a/l10n_br_delivery/views/sale_order_view.xml b/l10n_br_delivery/views/sale_order_view.xml index a2d8936b2f9c..bd093b8c92a7 100644 --- a/l10n_br_delivery/views/sale_order_view.xml +++ b/l10n_br_delivery/views/sale_order_view.xml @@ -35,13 +35,6 @@
    - - - From 900fbe046aa6e0d2aca698e2ed9d7db744eaba03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Felipe=20Mil=C3=A9o?= Date: Fri, 21 Oct 2022 06:02:35 -0300 Subject: [PATCH 186/223] [REF] Context better using kwargs l10n_br_delivery --- l10n_br_delivery/tests/test_delivery_inverse_amount.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/l10n_br_delivery/tests/test_delivery_inverse_amount.py b/l10n_br_delivery/tests/test_delivery_inverse_amount.py index 03a1a2b3c967..a7cbaa66de05 100644 --- a/l10n_br_delivery/tests/test_delivery_inverse_amount.py +++ b/l10n_br_delivery/tests/test_delivery_inverse_amount.py @@ -90,13 +90,13 @@ def setUpClass(cls): wizard_total = ( cls.env["sale.advance.payment.inv"] - .with_context({"active_ids": cls.sale_order_total_id.ids}) + .with_context(active_ids=cls.sale_order_total_id.ids) .create({}) ) wizard_line = ( cls.env["sale.advance.payment.inv"] - .with_context({"active_ids": cls.sale_order_line_id.ids}) + .with_context(active_ids=cls.sale_order_line_id.ids) .create({}) ) From 1b07dd3785191b459fd2af8c6808b62df7c65bdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Felipe=20Mil=C3=A9o?= Date: Fri, 21 Oct 2022 08:07:38 -0300 Subject: [PATCH 187/223] [REF] attribute-string-redundant l10n_br_delivery --- l10n_br_delivery/models/sale_order.py | 8 ++------ l10n_br_delivery/models/vehicle.py | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/l10n_br_delivery/models/sale_order.py b/l10n_br_delivery/models/sale_order.py index 2f2106f5caca..44905b47c35f 100644 --- a/l10n_br_delivery/models/sale_order.py +++ b/l10n_br_delivery/models/sale_order.py @@ -13,13 +13,9 @@ class SaleOrder(models.Model): # cosiderado. # Esse modulo l10n_br_delivery é pensando para ter aderencia com o # product_net_weight (modulo link acima). - amount_gross_weight = fields.Float( - string="Amount Gross Weight", compute="_compute_amount_gross_weight" - ) + amount_gross_weight = fields.Float(compute="_compute_amount_gross_weight") - amount_volume = fields.Float( - string="Amount Volume", compute="_compute_amount_volume" - ) + amount_volume = fields.Float(compute="_compute_amount_volume") # Devido o campo no sale_order chamar apenas incoterm # ao inves de incoterm_id como o padrão, a copia do diff --git a/l10n_br_delivery/models/vehicle.py b/l10n_br_delivery/models/vehicle.py index 7f1ed2eccfae..e5a39d819fa8 100644 --- a/l10n_br_delivery/models/vehicle.py +++ b/l10n_br_delivery/models/vehicle.py @@ -8,10 +8,9 @@ class CarrierVehicle(models.Model): _name = "l10n_br_delivery.carrier.vehicle" _description = "Carrier Vehicle" - name = fields.Char(string="Name", required=True, size=32) + name = fields.Char(required=True, size=32) description = fields.Char( - string="Description", size=132, ) @@ -21,7 +20,6 @@ class CarrierVehicle(models.Model): ) driver = fields.Char( - string="Driver", size=64, ) @@ -47,9 +45,7 @@ class CarrierVehicle(models.Model): domain="[('state_id', '=', state_id)]", ) - active = fields.Boolean( - string="Active", - ) + active = fields.Boolean() manufacture_year = fields.Char( string="Ano de Fabricação", From e3d2ebf117b77ae42af1493a5d21ed6bb92355ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Felipe=20Mil=C3=A9o?= Date: Fri, 21 Oct 2022 08:31:36 -0300 Subject: [PATCH 188/223] [REF] xml-deprecated-tree-attribute l10n_br_delivery --- l10n_br_delivery/views/l10n_br_delivery_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_delivery/views/l10n_br_delivery_view.xml b/l10n_br_delivery/views/l10n_br_delivery_view.xml index 81c7d7bbfcc1..9beaf6d9de95 100644 --- a/l10n_br_delivery/views/l10n_br_delivery_view.xml +++ b/l10n_br_delivery/views/l10n_br_delivery_view.xml @@ -36,7 +36,7 @@ l10n_br_delivery.carrier.vehicle tree - + From 7fec3d39230d15842401e343aec61480820408f9 Mon Sep 17 00:00:00 2001 From: oca-ci Date: Sat, 22 Oct 2022 10:57:47 +0000 Subject: [PATCH 189/223] [UPD] Update l10n_br_delivery.pot --- l10n_br_delivery/i18n/l10n_br_delivery.pot | 1 - 1 file changed, 1 deletion(-) diff --git a/l10n_br_delivery/i18n/l10n_br_delivery.pot b/l10n_br_delivery/i18n/l10n_br_delivery.pot index b0bb72db94b2..32168aa8e042 100644 --- a/l10n_br_delivery/i18n/l10n_br_delivery.pot +++ b/l10n_br_delivery/i18n/l10n_br_delivery.pot @@ -299,7 +299,6 @@ msgstr "" #: model:ir.actions.act_window,name:l10n_br_delivery.action_l10n_br_delivery_carrier_vehicle_form #: model:ir.ui.menu,name:l10n_br_delivery.menu_l10n_br_delivery_carrier_vehicle_form #: model_terms:ir.ui.view,arch_db:l10n_br_delivery.l10n_br_delivery_carrier_vehicle_form -#: model_terms:ir.ui.view,arch_db:l10n_br_delivery.l10n_br_delivery_carrier_vehicle_tree msgid "Vehicle" msgstr "" From 562408b4610a709bade1eee3effe1c8dd248ceb3 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Sat, 22 Oct 2022 11:09:35 +0000 Subject: [PATCH 190/223] l10n_br_delivery 14.0.1.0.1 --- l10n_br_delivery/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_delivery/__manifest__.py b/l10n_br_delivery/__manifest__.py index 30d296cab7f0..e26bc4f44163 100644 --- a/l10n_br_delivery/__manifest__.py +++ b/l10n_br_delivery/__manifest__.py @@ -7,7 +7,7 @@ "author": "Akretion, Odoo Community Association (OCA)", "maintainers": ["renatonlima", "mbcosta"], "website": "https://github.com/OCA/l10n-brazil", - "version": "14.0.1.0.0", + "version": "14.0.1.0.1", "depends": [ "l10n_br_sale_stock", "delivery", From b3303a4e37c5a1fa5e62a0e4d291300c84b4420e Mon Sep 17 00:00:00 2001 From: Weblate Date: Sat, 22 Oct 2022 11:09:51 +0000 Subject: [PATCH 191/223] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: l10n-brazil-14.0/l10n-brazil-14.0-l10n_br_delivery Translate-URL: https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_delivery/ --- l10n_br_delivery/i18n/pt_BR.po | 1 - 1 file changed, 1 deletion(-) diff --git a/l10n_br_delivery/i18n/pt_BR.po b/l10n_br_delivery/i18n/pt_BR.po index 285a0591273b..1eeea9a2cb88 100644 --- a/l10n_br_delivery/i18n/pt_BR.po +++ b/l10n_br_delivery/i18n/pt_BR.po @@ -302,7 +302,6 @@ msgstr "Transferir" #: model:ir.actions.act_window,name:l10n_br_delivery.action_l10n_br_delivery_carrier_vehicle_form #: model:ir.ui.menu,name:l10n_br_delivery.menu_l10n_br_delivery_carrier_vehicle_form #: model_terms:ir.ui.view,arch_db:l10n_br_delivery.l10n_br_delivery_carrier_vehicle_form -#: model_terms:ir.ui.view,arch_db:l10n_br_delivery.l10n_br_delivery_carrier_vehicle_tree msgid "Vehicle" msgstr "" From 9ac8e4cf758a0ff83dfc5db479cca49235d4c011 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Douglas=20Cust=C3=B3dio?= Date: Wed, 23 Nov 2022 18:37:50 +0000 Subject: [PATCH 192/223] Translated using Weblate (Portuguese (Brazil)) Currently translated at 23.5% (12 of 51 strings) Translation: l10n-brazil-14.0/l10n-brazil-14.0-l10n_br_delivery Translate-URL: https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_delivery/pt_BR/ --- l10n_br_delivery/i18n/pt_BR.po | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/l10n_br_delivery/i18n/pt_BR.po b/l10n_br_delivery/i18n/pt_BR.po index 1eeea9a2cb88..9a9e0459b8e1 100644 --- a/l10n_br_delivery/i18n/pt_BR.po +++ b/l10n_br_delivery/i18n/pt_BR.po @@ -6,15 +6,15 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2020-12-18 21:45+0000\n" -"Last-Translator: Marcel Savegnago \n" +"PO-Revision-Date: 2022-11-23 20:44+0000\n" +"Last-Translator: Douglas Custódio \n" "Language-Team: none\n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.3.2\n" +"X-Generator: Weblate 4.14.1\n" #. module: l10n_br_delivery #: model:ir.model.fields.selection,name:l10n_br_delivery.selection__account_incoterms__freight_responsibility__0 @@ -98,17 +98,17 @@ msgstr "" #: model:ir.model.fields,field_description:l10n_br_delivery.field_repair_order__carrier_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_stock_picking__carrier_id msgid "Carrier" -msgstr "" +msgstr "Transportadora" #. module: l10n_br_delivery #: model:ir.model,name:l10n_br_delivery.model_l10n_br_delivery_carrier_vehicle msgid "Carrier Vehicle" -msgstr "" +msgstr "Veículo da Transportadora" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__city_id msgid "City" -msgstr "" +msgstr "Cidade" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_delivery_carrier__antt_code @@ -118,27 +118,27 @@ msgstr "" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__country_id msgid "Country" -msgstr "" +msgstr "País" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__create_uid msgid "Created by" -msgstr "" +msgstr "Criado Por" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__create_date msgid "Created on" -msgstr "" +msgstr "Criado Em" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__carrier_id msgid "Delivery Method" -msgstr "" +msgstr "Método de Entrega" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__description msgid "Description" -msgstr "" +msgstr "Descrição" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_account_incoterms__display_name @@ -149,17 +149,17 @@ msgstr "" #: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__display_name #: model:ir.model.fields,field_description:l10n_br_delivery.field_stock_picking__display_name msgid "Display Name" -msgstr "" +msgstr "Nome Exibido" #. module: l10n_br_delivery #: model:ir.model,name:l10n_br_delivery.model_l10n_br_fiscal_document_mixin msgid "Document Fiscal Mixin" -msgstr "" +msgstr "Mixin Fiscal de Documentos" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__driver msgid "Driver" -msgstr "" +msgstr "Motorista" #. module: l10n_br_delivery #: model:ir.model.fields,help:l10n_br_delivery.field_sale_order__carrier_id From 2fc6d769e7783683112ede69c1ec12ad87235b4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Douglas=20Cust=C3=B3dio?= Date: Wed, 7 Dec 2022 17:17:02 +0000 Subject: [PATCH 193/223] Translated using Weblate (Portuguese (Brazil)) Currently translated at 72.5% (37 of 51 strings) Translation: l10n-brazil-14.0/l10n-brazil-14.0-l10n_br_delivery Translate-URL: https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_delivery/pt_BR/ --- l10n_br_delivery/i18n/pt_BR.po | 93 ++++++++++++++++++++-------------- 1 file changed, 55 insertions(+), 38 deletions(-) diff --git a/l10n_br_delivery/i18n/pt_BR.po b/l10n_br_delivery/i18n/pt_BR.po index 9a9e0459b8e1..4e8d12ebc4d4 100644 --- a/l10n_br_delivery/i18n/pt_BR.po +++ b/l10n_br_delivery/i18n/pt_BR.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2022-11-23 20:44+0000\n" +"PO-Revision-Date: 2022-12-07 19:44+0000\n" "Last-Translator: Douglas Custódio \n" "Language-Team: none\n" "Language: pt_BR\n" @@ -19,72 +19,77 @@ msgstr "" #. module: l10n_br_delivery #: model:ir.model.fields.selection,name:l10n_br_delivery.selection__account_incoterms__freight_responsibility__0 msgid "0 - Contratação do Frete por conta do Remetente (CIF)" -msgstr "" +msgstr "0 - Contratação do Frete por conta do Remetente (CIF)" #. module: l10n_br_delivery #: model:ir.model.fields.selection,name:l10n_br_delivery.selection__account_incoterms__freight_responsibility__1 msgid "1 - Contratação do Frete por conta do destinatário/remetente (FOB)" -msgstr "" +msgstr "1 - Contratação do Frete por conta do destinatário/remetente (FOB)" #. module: l10n_br_delivery #: model:ir.model.fields.selection,name:l10n_br_delivery.selection__account_incoterms__freight_responsibility__2 msgid "2 - Contratação do Frete por conta de terceiros" -msgstr "" +msgstr "2 - Contratação do Frete por conta de terceiros" #. module: l10n_br_delivery #: model:ir.model.fields.selection,name:l10n_br_delivery.selection__account_incoterms__freight_responsibility__3 msgid "3 - Transporte próprio por conta do remetente" -msgstr "" +msgstr "3 - Transporte próprio por conta do remetente" #. module: l10n_br_delivery #: model:ir.model.fields.selection,name:l10n_br_delivery.selection__account_incoterms__freight_responsibility__4 +#, fuzzy msgid "4 - Transporte próprio por conta do destinatário" -msgstr "" +msgstr "4 - Transporte próprio por conta do destinatário" #. module: l10n_br_delivery #: model:ir.model.fields.selection,name:l10n_br_delivery.selection__account_incoterms__freight_responsibility__9 +#, fuzzy msgid "9 - Sem Ocorrência de transporte." -msgstr "" +msgstr "9 - Sem Ocorrência de transporte." #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__rntc_code msgid "ANTT Code" -msgstr "" +msgstr "Código ANTT" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__active msgid "Active" -msgstr "" +msgstr "Ativo" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__amount_gross_weight msgid "Amount Gross Weight" -msgstr "" +msgstr "Valor Peso Bruto" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__amount_volume msgid "Amount Volume" -msgstr "" +msgstr "Valor do Volume" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__manufacture_year +#, fuzzy msgid "Ano de Fabricação" -msgstr "" +msgstr "Ano de Fabricação" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__model_year +#, fuzzy msgid "Ano do Modelo" -msgstr "" +msgstr "Ano do Modelo" #. module: l10n_br_delivery #: model:res.partner,nfe40_xPais:l10n_br_delivery.test_carrier msgid "Brazil" -msgstr "" +msgstr "Brasil" #. module: l10n_br_delivery #: model:ir.model.fields.selection,name:l10n_br_delivery.selection__l10n_br_delivery_carrier_vehicle__type__bau +#, fuzzy msgid "Caminhão Baú" -msgstr "" +msgstr "Caminhão Baú" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_account_bank_statement_line__carrier_id @@ -113,7 +118,7 @@ msgstr "Cidade" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_delivery_carrier__antt_code msgid "Codigo ANTT" -msgstr "" +msgstr "Código ANTT" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__country_id @@ -165,16 +170,19 @@ msgstr "Motorista" #: model:ir.model.fields,help:l10n_br_delivery.field_sale_order__carrier_id msgid "Fill this field if you plan to invoice the shipping based on picking." msgstr "" +"Preencha este campo se você planeja faturar a entrega baseada no picking." #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_account_incoterms__freight_responsibility +#, fuzzy msgid "Frete por Conta" -msgstr "" +msgstr "Frete por Conta" #. module: l10n_br_delivery #: model:res.partner,nfe40_xMun:l10n_br_delivery.test_carrier +#, fuzzy msgid "Guarulhos" -msgstr "" +msgstr "Guarulhos" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_account_incoterms__id @@ -184,8 +192,9 @@ msgstr "" #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__id #: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__id #: model:ir.model.fields,field_description:l10n_br_delivery.field_stock_picking__id +#, fuzzy msgid "ID" -msgstr "" +msgstr "ID" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_account_bank_statement_line__incoterm_id @@ -198,18 +207,21 @@ msgstr "" #: model:ir.model.fields,field_description:l10n_br_delivery.field_repair_order__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_stock_picking__incoterm_id +#, fuzzy msgid "Incoterm" -msgstr "" +msgstr "Incoterm" #. module: l10n_br_delivery #: model:ir.model,name:l10n_br_delivery.model_account_incoterms +#, fuzzy msgid "Incoterms" -msgstr "" +msgstr "Incoterms" #. module: l10n_br_delivery #: model:ir.model.fields,help:l10n_br_delivery.field_account_incoterms__freight_responsibility +#, fuzzy msgid "Informação usada na emissão de Documentos Fiscais" -msgstr "" +msgstr "Informação usada na emissão de Documentos Fiscais" #. module: l10n_br_delivery #: model:ir.model.fields,help:l10n_br_delivery.field_account_bank_statement_line__incoterm_id @@ -226,11 +238,13 @@ msgid "" "International Commercial Terms are a series of predefined commercial terms " "used in international transactions." msgstr "" +"International Commercial Terms são uma série de termos comerciais pré " +"definidos usados em transações internacionais." #. module: l10n_br_delivery #: model:ir.model,name:l10n_br_delivery.model_account_move msgid "Journal Entry" -msgstr "" +msgstr "Lançamento de Diário" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_account_incoterms____last_update @@ -241,57 +255,59 @@ msgstr "" #: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order____last_update #: model:ir.model.fields,field_description:l10n_br_delivery.field_stock_picking____last_update msgid "Last Modified on" -msgstr "" +msgstr "Última modificação em" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__write_uid msgid "Last Updated by" -msgstr "" +msgstr "Última atualização por" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__write_date msgid "Last Updated on" -msgstr "" +msgstr "Última atualização em" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__type msgid "Model Type" -msgstr "" +msgstr "Tipo de Modelo" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__name msgid "Name" -msgstr "" +msgstr "Nome" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__plate +#, fuzzy msgid "Placa" -msgstr "" +msgstr "Placa" #. module: l10n_br_delivery #: model:ir.model,name:l10n_br_delivery.model_sale_order msgid "Sales Order" -msgstr "" +msgstr "Pedido de Vendas" #. module: l10n_br_delivery #: model_terms:ir.ui.view,arch_db:l10n_br_delivery.l10n_br_delivery_carrier_vehicle_form msgid "Shipping Company" -msgstr "" +msgstr "Empresa de Transporte" #. module: l10n_br_delivery #: model:ir.model,name:l10n_br_delivery.model_delivery_carrier msgid "Shipping Methods" -msgstr "" +msgstr "Métodos de Transporte" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__state_id msgid "State" -msgstr "" +msgstr "Estado" #. module: l10n_br_delivery #: model:delivery.carrier,name:l10n_br_delivery.test_br_delivery_carrier +#, fuzzy msgid "Teste - l10n_br_delivery" -msgstr "" +msgstr "Teste - l10n_br_delivery" #. module: l10n_br_delivery #: model:ir.model,name:l10n_br_delivery.model_stock_picking @@ -303,22 +319,23 @@ msgstr "Transferir" #: model:ir.ui.menu,name:l10n_br_delivery.menu_l10n_br_delivery_carrier_vehicle_form #: model_terms:ir.ui.view,arch_db:l10n_br_delivery.l10n_br_delivery_carrier_vehicle_form msgid "Vehicle" -msgstr "" +msgstr "Veículo" #. module: l10n_br_delivery #: model_terms:ir.ui.view,arch_db:l10n_br_delivery.l10n_br_delivery_carrier_vehicle_form msgid "Vehicle Data" -msgstr "" +msgstr "Dados do Veículo" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_delivery_carrier__vehicle_ids msgid "Vehicles" -msgstr "" +msgstr "Veículos" #. module: l10n_br_delivery #: model_terms:ir.ui.view,arch_db:l10n_br_delivery.l10n_br_delivery_carrier_form_view +#, fuzzy msgid "[('supplier', '=', True)]" -msgstr "" +msgstr "[('supplier', '=', True)]" #~ msgid "Fiscal Document" #~ msgstr "Documento Fiscal" From 87e2cbbb3e15325fd8dd42ec99aa396c31e2c66a Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Sat, 7 Jan 2023 20:38:34 +0000 Subject: [PATCH 194/223] Translated using Weblate (Portuguese (Brazil)) Currently translated at 72.5% (37 of 51 strings) Translation: l10n-brazil-14.0/l10n-brazil-14.0-l10n_br_delivery Translate-URL: https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_delivery/pt_BR/ --- l10n_br_delivery/i18n/pt_BR.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/l10n_br_delivery/i18n/pt_BR.po b/l10n_br_delivery/i18n/pt_BR.po index 4e8d12ebc4d4..602663eb1b95 100644 --- a/l10n_br_delivery/i18n/pt_BR.po +++ b/l10n_br_delivery/i18n/pt_BR.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2022-12-07 19:44+0000\n" -"Last-Translator: Douglas Custódio \n" +"PO-Revision-Date: 2023-01-07 20:39+0000\n" +"Last-Translator: Marcel Savegnago \n" "Language-Team: none\n" "Language: pt_BR\n" "MIME-Version: 1.0\n" @@ -255,7 +255,7 @@ msgstr "Lançamento de Diário" #: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order____last_update #: model:ir.model.fields,field_description:l10n_br_delivery.field_stock_picking____last_update msgid "Last Modified on" -msgstr "Última modificação em" +msgstr "Última Modificação em" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__write_uid From 8ecd21f736cb79ba8f4089fa9449faedc6d7c5bd Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Sat, 7 Jan 2023 20:58:42 +0000 Subject: [PATCH 195/223] Translated using Weblate (Portuguese (Brazil)) Currently translated at 72.5% (37 of 51 strings) Translation: l10n-brazil-14.0/l10n-brazil-14.0-l10n_br_delivery Translate-URL: https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_delivery/pt_BR/ --- l10n_br_delivery/i18n/pt_BR.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/l10n_br_delivery/i18n/pt_BR.po b/l10n_br_delivery/i18n/pt_BR.po index 602663eb1b95..1e05bae8ff85 100644 --- a/l10n_br_delivery/i18n/pt_BR.po +++ b/l10n_br_delivery/i18n/pt_BR.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2023-01-07 20:39+0000\n" +"PO-Revision-Date: 2023-01-07 21:47+0000\n" "Last-Translator: Marcel Savegnago \n" "Language-Team: none\n" "Language: pt_BR\n" @@ -128,12 +128,12 @@ msgstr "País" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__create_uid msgid "Created by" -msgstr "Criado Por" +msgstr "Criado por" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__create_date msgid "Created on" -msgstr "Criado Em" +msgstr "Criado em" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__carrier_id @@ -260,12 +260,12 @@ msgstr "Última Modificação em" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__write_uid msgid "Last Updated by" -msgstr "Última atualização por" +msgstr "Última Atualização por" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__write_date msgid "Last Updated on" -msgstr "Última atualização em" +msgstr "Última Atualização em" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__type From a970c7825d59fe7bd2dcd23b35e0d6c906166e35 Mon Sep 17 00:00:00 2001 From: oca-ci Date: Sat, 4 Feb 2023 02:03:12 +0000 Subject: [PATCH 196/223] [UPD] Update l10n_br_delivery.pot --- l10n_br_delivery/i18n/l10n_br_delivery.pot | 3 +++ 1 file changed, 3 insertions(+) diff --git a/l10n_br_delivery/i18n/l10n_br_delivery.pot b/l10n_br_delivery/i18n/l10n_br_delivery.pot index 32168aa8e042..17a2aba28642 100644 --- a/l10n_br_delivery/i18n/l10n_br_delivery.pot +++ b/l10n_br_delivery/i18n/l10n_br_delivery.pot @@ -91,6 +91,7 @@ msgstr "" #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__carrier_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__carrier_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__carrier_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_pos_order__carrier_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_purchase_order__carrier_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_repair_order__carrier_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_stock_picking__carrier_id @@ -191,6 +192,7 @@ msgstr "" #: model:ir.model.fields,field_description:l10n_br_delivery.field_contract_contract__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_pos_order__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_purchase_order__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_repair_order__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__incoterm_id @@ -215,6 +217,7 @@ msgstr "" #: model:ir.model.fields,help:l10n_br_delivery.field_contract_contract__incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_l10n_br_fiscal_document__incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_pos_order__incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_purchase_order__incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_repair_order__incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_sale_order__incoterm_id From d51b1190ee6fb11b202ae225cc7894b2df4bd3fe Mon Sep 17 00:00:00 2001 From: Weblate Date: Sat, 4 Feb 2023 05:59:17 +0000 Subject: [PATCH 197/223] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: l10n-brazil-14.0/l10n-brazil-14.0-l10n_br_delivery Translate-URL: https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_delivery/ --- l10n_br_delivery/i18n/pt_BR.po | 3 +++ 1 file changed, 3 insertions(+) diff --git a/l10n_br_delivery/i18n/pt_BR.po b/l10n_br_delivery/i18n/pt_BR.po index 1e05bae8ff85..be52c04610e3 100644 --- a/l10n_br_delivery/i18n/pt_BR.po +++ b/l10n_br_delivery/i18n/pt_BR.po @@ -99,6 +99,7 @@ msgstr "Caminhão Baú" #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_delivery_carrier_vehicle__carrier_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__carrier_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__carrier_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_pos_order__carrier_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_purchase_order__carrier_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_repair_order__carrier_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_stock_picking__carrier_id @@ -203,6 +204,7 @@ msgstr "ID" #: model:ir.model.fields,field_description:l10n_br_delivery.field_contract_contract__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_pos_order__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_purchase_order__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_repair_order__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__incoterm_id @@ -230,6 +232,7 @@ msgstr "Informação usada na emissão de Documentos Fiscais" #: model:ir.model.fields,help:l10n_br_delivery.field_contract_contract__incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_l10n_br_fiscal_document__incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_pos_order__incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_purchase_order__incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_repair_order__incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_sale_order__incoterm_id From ec8cb98aa78c780a9f9b9c44547a9022f170ac48 Mon Sep 17 00:00:00 2001 From: oca-ci Date: Wed, 1 Mar 2023 22:17:01 +0000 Subject: [PATCH 198/223] [UPD] Update l10n_br_delivery.pot --- l10n_br_delivery/i18n/l10n_br_delivery.pot | 6 ------ 1 file changed, 6 deletions(-) diff --git a/l10n_br_delivery/i18n/l10n_br_delivery.pot b/l10n_br_delivery/i18n/l10n_br_delivery.pot index 17a2aba28642..c3a1b4e89a7b 100644 --- a/l10n_br_delivery/i18n/l10n_br_delivery.pot +++ b/l10n_br_delivery/i18n/l10n_br_delivery.pot @@ -186,9 +186,6 @@ msgid "ID" msgstr "" #. module: l10n_br_delivery -#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_bank_statement_line__incoterm_id -#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_move__incoterm_id -#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_payment__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_contract_contract__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__incoterm_id @@ -211,9 +208,6 @@ msgid "Informação usada na emissão de Documentos Fiscais" msgstr "" #. module: l10n_br_delivery -#: model:ir.model.fields,help:l10n_br_delivery.field_account_bank_statement_line__incoterm_id -#: model:ir.model.fields,help:l10n_br_delivery.field_account_move__incoterm_id -#: model:ir.model.fields,help:l10n_br_delivery.field_account_payment__incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_contract_contract__incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_l10n_br_fiscal_document__incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__incoterm_id From 85cae84a7a090aff5f90fbf2733608fdc2156b8c Mon Sep 17 00:00:00 2001 From: Weblate Date: Wed, 1 Mar 2023 22:32:54 +0000 Subject: [PATCH 199/223] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: l10n-brazil-14.0/l10n-brazil-14.0-l10n_br_delivery Translate-URL: https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_delivery/ --- l10n_br_delivery/i18n/pt_BR.po | 6 ------ 1 file changed, 6 deletions(-) diff --git a/l10n_br_delivery/i18n/pt_BR.po b/l10n_br_delivery/i18n/pt_BR.po index be52c04610e3..63eb35e40477 100644 --- a/l10n_br_delivery/i18n/pt_BR.po +++ b/l10n_br_delivery/i18n/pt_BR.po @@ -198,9 +198,6 @@ msgid "ID" msgstr "ID" #. module: l10n_br_delivery -#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_bank_statement_line__incoterm_id -#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_move__incoterm_id -#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_payment__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_contract_contract__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__incoterm_id @@ -226,9 +223,6 @@ msgid "Informação usada na emissão de Documentos Fiscais" msgstr "Informação usada na emissão de Documentos Fiscais" #. module: l10n_br_delivery -#: model:ir.model.fields,help:l10n_br_delivery.field_account_bank_statement_line__incoterm_id -#: model:ir.model.fields,help:l10n_br_delivery.field_account_move__incoterm_id -#: model:ir.model.fields,help:l10n_br_delivery.field_account_payment__incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_contract_contract__incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_l10n_br_fiscal_document__incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__incoterm_id From e425cbe02c00a611284936d6ed7a7092156ac173 Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Wed, 29 Mar 2023 18:49:22 +0000 Subject: [PATCH 200/223] Translated using Weblate (Portuguese (Brazil)) Currently translated at 72.5% (37 of 51 strings) Translation: l10n-brazil-14.0/l10n-brazil-14.0-l10n_br_delivery Translate-URL: https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_delivery/pt_BR/ --- l10n_br_delivery/i18n/pt_BR.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/l10n_br_delivery/i18n/pt_BR.po b/l10n_br_delivery/i18n/pt_BR.po index 63eb35e40477..7bcf5c2b1729 100644 --- a/l10n_br_delivery/i18n/pt_BR.po +++ b/l10n_br_delivery/i18n/pt_BR.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2023-01-07 21:47+0000\n" +"PO-Revision-Date: 2023-03-29 18:54+0000\n" "Last-Translator: Marcel Savegnago \n" "Language-Team: none\n" "Language: pt_BR\n" @@ -235,8 +235,8 @@ msgid "" "International Commercial Terms are a series of predefined commercial terms " "used in international transactions." msgstr "" -"International Commercial Terms são uma série de termos comerciais pré " -"definidos usados em transações internacionais." +"International Commercial Terms são uma série de termos comerciais " +"predefinidos utilizados em transações internacionais." #. module: l10n_br_delivery #: model:ir.model,name:l10n_br_delivery.model_account_move From b992bfa2381f3b547e53bcddd0831f66ead7b0ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Sun, 21 May 2023 14:00:57 -0300 Subject: [PATCH 201/223] [IMP] added proxy field for _inject_shadowed_fields --- l10n_br_delivery/models/fiscal_document_mixin.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/l10n_br_delivery/models/fiscal_document_mixin.py b/l10n_br_delivery/models/fiscal_document_mixin.py index e526b0a8d3c9..9a2268c44e08 100644 --- a/l10n_br_delivery/models/fiscal_document_mixin.py +++ b/l10n_br_delivery/models/fiscal_document_mixin.py @@ -20,6 +20,8 @@ def _get_default_incoterm(self): " transactions.", ) + fiscal_incoterm_id = fields.Many2one(related="incoterm_id") + carrier_id = fields.Many2one( comodel_name="delivery.carrier", string="Carrier", From 5efe70c3d34a3f32cf7e17a7f97a11168c71af33 Mon Sep 17 00:00:00 2001 From: oca-ci Date: Sat, 3 Jun 2023 13:52:32 +0000 Subject: [PATCH 202/223] [UPD] Update l10n_br_delivery.pot --- l10n_br_delivery/i18n/l10n_br_delivery.pot | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/l10n_br_delivery/i18n/l10n_br_delivery.pot b/l10n_br_delivery/i18n/l10n_br_delivery.pot index c3a1b4e89a7b..9fc90e79f27a 100644 --- a/l10n_br_delivery/i18n/l10n_br_delivery.pot +++ b/l10n_br_delivery/i18n/l10n_br_delivery.pot @@ -186,13 +186,24 @@ msgid "ID" msgstr "" #. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_bank_statement_line__fiscal_incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_move__fiscal_incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_payment__fiscal_incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_contract_contract__fiscal_incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_contract_contract__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__fiscal_incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__fiscal_incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_pos_order__fiscal_incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_pos_order__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_purchase_order__fiscal_incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_purchase_order__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_repair_order__fiscal_incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_repair_order__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__fiscal_incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_stock_picking__fiscal_incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_stock_picking__incoterm_id msgid "Incoterm" msgstr "" @@ -208,13 +219,24 @@ msgid "Informação usada na emissão de Documentos Fiscais" msgstr "" #. module: l10n_br_delivery +#: model:ir.model.fields,help:l10n_br_delivery.field_account_bank_statement_line__fiscal_incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_account_move__fiscal_incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_account_payment__fiscal_incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_contract_contract__fiscal_incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_contract_contract__incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_l10n_br_fiscal_document__fiscal_incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_l10n_br_fiscal_document__incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__fiscal_incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_pos_order__fiscal_incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_pos_order__incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_purchase_order__fiscal_incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_purchase_order__incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_repair_order__fiscal_incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_repair_order__incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_sale_order__fiscal_incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_sale_order__incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_stock_picking__fiscal_incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_stock_picking__incoterm_id msgid "" "International Commercial Terms are a series of predefined commercial terms " From e557196472a2d75800f9a0cc8f6c9ae6359f3902 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Sat, 3 Jun 2023 14:11:42 +0000 Subject: [PATCH 203/223] l10n_br_delivery 14.0.1.1.0 --- l10n_br_delivery/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_delivery/__manifest__.py b/l10n_br_delivery/__manifest__.py index e26bc4f44163..4626a72d6234 100644 --- a/l10n_br_delivery/__manifest__.py +++ b/l10n_br_delivery/__manifest__.py @@ -7,7 +7,7 @@ "author": "Akretion, Odoo Community Association (OCA)", "maintainers": ["renatonlima", "mbcosta"], "website": "https://github.com/OCA/l10n-brazil", - "version": "14.0.1.0.1", + "version": "14.0.1.1.0", "depends": [ "l10n_br_sale_stock", "delivery", From d2f9919f43d9ad337f2fed222b4e63aa36c96b7b Mon Sep 17 00:00:00 2001 From: Weblate Date: Sat, 3 Jun 2023 14:12:00 +0000 Subject: [PATCH 204/223] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: l10n-brazil-14.0/l10n-brazil-14.0-l10n_br_delivery Translate-URL: https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_delivery/ --- l10n_br_delivery/i18n/pt_BR.po | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/l10n_br_delivery/i18n/pt_BR.po b/l10n_br_delivery/i18n/pt_BR.po index 7bcf5c2b1729..f7b79d376ddd 100644 --- a/l10n_br_delivery/i18n/pt_BR.po +++ b/l10n_br_delivery/i18n/pt_BR.po @@ -198,13 +198,24 @@ msgid "ID" msgstr "ID" #. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_bank_statement_line__fiscal_incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_move__fiscal_incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_payment__fiscal_incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_contract_contract__fiscal_incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_contract_contract__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__fiscal_incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__fiscal_incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_pos_order__fiscal_incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_pos_order__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_purchase_order__fiscal_incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_purchase_order__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_repair_order__fiscal_incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_repair_order__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__fiscal_incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_sale_order__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_stock_picking__fiscal_incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_stock_picking__incoterm_id #, fuzzy msgid "Incoterm" @@ -223,13 +234,24 @@ msgid "Informação usada na emissão de Documentos Fiscais" msgstr "Informação usada na emissão de Documentos Fiscais" #. module: l10n_br_delivery +#: model:ir.model.fields,help:l10n_br_delivery.field_account_bank_statement_line__fiscal_incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_account_move__fiscal_incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_account_payment__fiscal_incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_contract_contract__fiscal_incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_contract_contract__incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_l10n_br_fiscal_document__fiscal_incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_l10n_br_fiscal_document__incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__fiscal_incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_pos_order__fiscal_incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_pos_order__incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_purchase_order__fiscal_incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_purchase_order__incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_repair_order__fiscal_incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_repair_order__incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_sale_order__fiscal_incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_sale_order__incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_stock_picking__fiscal_incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_stock_picking__incoterm_id msgid "" "International Commercial Terms are a series of predefined commercial terms " From 4344e35c43143570e836e26fa63df8b1a080c0b7 Mon Sep 17 00:00:00 2001 From: oca-ci Date: Fri, 16 Jun 2023 08:13:08 +0000 Subject: [PATCH 205/223] [UPD] Update l10n_br_delivery.pot --- l10n_br_delivery/i18n/l10n_br_delivery.pot | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/l10n_br_delivery/i18n/l10n_br_delivery.pot b/l10n_br_delivery/i18n/l10n_br_delivery.pot index 9fc90e79f27a..3c9ada9ec4aa 100644 --- a/l10n_br_delivery/i18n/l10n_br_delivery.pot +++ b/l10n_br_delivery/i18n/l10n_br_delivery.pot @@ -187,8 +187,11 @@ msgstr "" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_account_bank_statement_line__fiscal_incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_bank_statement_line__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_account_move__fiscal_incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_move__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_account_payment__fiscal_incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_payment__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_contract_contract__fiscal_incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_contract_contract__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__fiscal_incoterm_id @@ -220,8 +223,11 @@ msgstr "" #. module: l10n_br_delivery #: model:ir.model.fields,help:l10n_br_delivery.field_account_bank_statement_line__fiscal_incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_account_bank_statement_line__incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_account_move__fiscal_incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_account_move__incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_account_payment__fiscal_incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_account_payment__incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_contract_contract__fiscal_incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_contract_contract__incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_l10n_br_fiscal_document__fiscal_incoterm_id From cd9e87f444ba2a0fec5f31683b194e03c73fa8d8 Mon Sep 17 00:00:00 2001 From: Weblate Date: Fri, 16 Jun 2023 08:28:22 +0000 Subject: [PATCH 206/223] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: l10n-brazil-14.0/l10n-brazil-14.0-l10n_br_delivery Translate-URL: https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_delivery/ --- l10n_br_delivery/i18n/pt_BR.po | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/l10n_br_delivery/i18n/pt_BR.po b/l10n_br_delivery/i18n/pt_BR.po index f7b79d376ddd..f7a4860330f2 100644 --- a/l10n_br_delivery/i18n/pt_BR.po +++ b/l10n_br_delivery/i18n/pt_BR.po @@ -199,8 +199,11 @@ msgstr "ID" #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_account_bank_statement_line__fiscal_incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_bank_statement_line__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_account_move__fiscal_incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_move__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_account_payment__fiscal_incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_payment__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_contract_contract__fiscal_incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_contract_contract__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__fiscal_incoterm_id @@ -235,8 +238,11 @@ msgstr "Informação usada na emissão de Documentos Fiscais" #. module: l10n_br_delivery #: model:ir.model.fields,help:l10n_br_delivery.field_account_bank_statement_line__fiscal_incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_account_bank_statement_line__incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_account_move__fiscal_incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_account_move__incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_account_payment__fiscal_incoterm_id +#: model:ir.model.fields,help:l10n_br_delivery.field_account_payment__incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_contract_contract__fiscal_incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_contract_contract__incoterm_id #: model:ir.model.fields,help:l10n_br_delivery.field_l10n_br_fiscal_document__fiscal_incoterm_id From b46d28769cf6c87e886c14f47be250932e19c217 Mon Sep 17 00:00:00 2001 From: oca-ci Date: Thu, 10 Aug 2023 18:41:45 +0000 Subject: [PATCH 207/223] [UPD] Update l10n_br_delivery.pot --- l10n_br_delivery/i18n/l10n_br_delivery.pot | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/l10n_br_delivery/i18n/l10n_br_delivery.pot b/l10n_br_delivery/i18n/l10n_br_delivery.pot index 3c9ada9ec4aa..ee451e5e502c 100644 --- a/l10n_br_delivery/i18n/l10n_br_delivery.pot +++ b/l10n_br_delivery/i18n/l10n_br_delivery.pot @@ -73,11 +73,6 @@ msgstr "" msgid "Ano do Modelo" msgstr "" -#. module: l10n_br_delivery -#: model:res.partner,nfe40_xPais:l10n_br_delivery.test_carrier -msgid "Brazil" -msgstr "" - #. module: l10n_br_delivery #: model:ir.model.fields.selection,name:l10n_br_delivery.selection__l10n_br_delivery_carrier_vehicle__type__bau msgid "Caminhão Baú" @@ -169,11 +164,6 @@ msgstr "" msgid "Frete por Conta" msgstr "" -#. module: l10n_br_delivery -#: model:res.partner,nfe40_xMun:l10n_br_delivery.test_carrier -msgid "Guarulhos" -msgstr "" - #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_account_incoterms__id #: model:ir.model.fields,field_description:l10n_br_delivery.field_account_move__id From b9fd25d0da4af4367cc8a83e85b64693df908c71 Mon Sep 17 00:00:00 2001 From: Weblate Date: Thu, 10 Aug 2023 19:13:27 +0000 Subject: [PATCH 208/223] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: l10n-brazil-14.0/l10n-brazil-14.0-l10n_br_delivery Translate-URL: https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_delivery/ --- l10n_br_delivery/i18n/pt_BR.po | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/l10n_br_delivery/i18n/pt_BR.po b/l10n_br_delivery/i18n/pt_BR.po index f7a4860330f2..7389140d1e7d 100644 --- a/l10n_br_delivery/i18n/pt_BR.po +++ b/l10n_br_delivery/i18n/pt_BR.po @@ -80,11 +80,6 @@ msgstr "Ano de Fabricação" msgid "Ano do Modelo" msgstr "Ano do Modelo" -#. module: l10n_br_delivery -#: model:res.partner,nfe40_xPais:l10n_br_delivery.test_carrier -msgid "Brazil" -msgstr "Brasil" - #. module: l10n_br_delivery #: model:ir.model.fields.selection,name:l10n_br_delivery.selection__l10n_br_delivery_carrier_vehicle__type__bau #, fuzzy @@ -179,12 +174,6 @@ msgstr "" msgid "Frete por Conta" msgstr "Frete por Conta" -#. module: l10n_br_delivery -#: model:res.partner,nfe40_xMun:l10n_br_delivery.test_carrier -#, fuzzy -msgid "Guarulhos" -msgstr "Guarulhos" - #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_account_incoterms__id #: model:ir.model.fields,field_description:l10n_br_delivery.field_account_move__id @@ -362,6 +351,13 @@ msgstr "Veículos" msgid "[('supplier', '=', True)]" msgstr "[('supplier', '=', True)]" +#~ msgid "Brazil" +#~ msgstr "Brasil" + +#, fuzzy +#~ msgid "Guarulhos" +#~ msgstr "Guarulhos" + #~ msgid "Fiscal Document" #~ msgstr "Documento Fiscal" From e5e83b7f3733e93c87bc0c276fd2d11b1b53b977 Mon Sep 17 00:00:00 2001 From: oca-ci Date: Fri, 11 Aug 2023 07:20:11 +0000 Subject: [PATCH 209/223] [UPD] Update l10n_br_delivery.pot --- l10n_br_delivery/i18n/l10n_br_delivery.pot | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/l10n_br_delivery/i18n/l10n_br_delivery.pot b/l10n_br_delivery/i18n/l10n_br_delivery.pot index ee451e5e502c..810cce2032f4 100644 --- a/l10n_br_delivery/i18n/l10n_br_delivery.pot +++ b/l10n_br_delivery/i18n/l10n_br_delivery.pot @@ -159,6 +159,18 @@ msgstr "" msgid "Fill this field if you plan to invoice the shipping based on picking." msgstr "" +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_bank_statement_line__fiscal_incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_bank_statement_line__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_move__fiscal_incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_move__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_payment__fiscal_incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_payment__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__fiscal_incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__incoterm_id +msgid "Fiscal Inconterm" +msgstr "" + #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_account_incoterms__freight_responsibility msgid "Frete por Conta" @@ -176,16 +188,8 @@ msgid "ID" msgstr "" #. module: l10n_br_delivery -#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_bank_statement_line__fiscal_incoterm_id -#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_bank_statement_line__incoterm_id -#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_move__fiscal_incoterm_id -#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_move__incoterm_id -#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_payment__fiscal_incoterm_id -#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_payment__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_contract_contract__fiscal_incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_contract_contract__incoterm_id -#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__fiscal_incoterm_id -#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__fiscal_incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_pos_order__fiscal_incoterm_id From 4cfcf0b92b3a71e4ba7572896a5fea3123cff459 Mon Sep 17 00:00:00 2001 From: Weblate Date: Fri, 11 Aug 2023 07:44:14 +0000 Subject: [PATCH 210/223] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: l10n-brazil-14.0/l10n-brazil-14.0-l10n_br_delivery Translate-URL: https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_delivery/ --- l10n_br_delivery/i18n/pt_BR.po | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/l10n_br_delivery/i18n/pt_BR.po b/l10n_br_delivery/i18n/pt_BR.po index 7389140d1e7d..1e630b0bda26 100644 --- a/l10n_br_delivery/i18n/pt_BR.po +++ b/l10n_br_delivery/i18n/pt_BR.po @@ -168,6 +168,18 @@ msgid "Fill this field if you plan to invoice the shipping based on picking." msgstr "" "Preencha este campo se você planeja faturar a entrega baseada no picking." +#. module: l10n_br_delivery +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_bank_statement_line__fiscal_incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_bank_statement_line__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_move__fiscal_incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_move__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_payment__fiscal_incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_payment__incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__fiscal_incoterm_id +#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__incoterm_id +msgid "Fiscal Inconterm" +msgstr "" + #. module: l10n_br_delivery #: model:ir.model.fields,field_description:l10n_br_delivery.field_account_incoterms__freight_responsibility #, fuzzy @@ -187,16 +199,8 @@ msgid "ID" msgstr "ID" #. module: l10n_br_delivery -#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_bank_statement_line__fiscal_incoterm_id -#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_bank_statement_line__incoterm_id -#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_move__fiscal_incoterm_id -#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_move__incoterm_id -#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_payment__fiscal_incoterm_id -#: model:ir.model.fields,field_description:l10n_br_delivery.field_account_payment__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_contract_contract__fiscal_incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_contract_contract__incoterm_id -#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__fiscal_incoterm_id -#: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__fiscal_incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_l10n_br_fiscal_document_mixin__incoterm_id #: model:ir.model.fields,field_description:l10n_br_delivery.field_pos_order__fiscal_incoterm_id From 3b80b4f4be7541b893f8566a5eed7a80fe78cdb8 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 17 Aug 2023 17:48:54 -0300 Subject: [PATCH 211/223] [FIX] Removed wrong ondelete attribute for carrier_id --- l10n_br_delivery/models/fiscal_document_mixin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_delivery/models/fiscal_document_mixin.py b/l10n_br_delivery/models/fiscal_document_mixin.py index 9a2268c44e08..e71bacef928c 100644 --- a/l10n_br_delivery/models/fiscal_document_mixin.py +++ b/l10n_br_delivery/models/fiscal_document_mixin.py @@ -25,5 +25,5 @@ def _get_default_incoterm(self): carrier_id = fields.Many2one( comodel_name="delivery.carrier", string="Carrier", - ondelete="cascade", + ondelete="restrict", ) From f4ea7be5e8968a6c6bd07132cc9f1f2a5b1e8958 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Fri, 18 Aug 2023 16:14:24 +0000 Subject: [PATCH 212/223] l10n_br_delivery 14.0.1.2.0 --- l10n_br_delivery/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_delivery/__manifest__.py b/l10n_br_delivery/__manifest__.py index 4626a72d6234..dfb24ea4f8e6 100644 --- a/l10n_br_delivery/__manifest__.py +++ b/l10n_br_delivery/__manifest__.py @@ -7,7 +7,7 @@ "author": "Akretion, Odoo Community Association (OCA)", "maintainers": ["renatonlima", "mbcosta"], "website": "https://github.com/OCA/l10n-brazil", - "version": "14.0.1.1.0", + "version": "14.0.1.2.0", "depends": [ "l10n_br_sale_stock", "delivery", From 7e80d34d87bfd5a9abd06bd993103b0948329387 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Sun, 3 Sep 2023 13:24:58 +0000 Subject: [PATCH 213/223] [UPD] README.rst --- l10n_br_delivery/README.rst | 15 ++-- .../static/description/index.html | 74 ++++++++++--------- 2 files changed, 47 insertions(+), 42 deletions(-) diff --git a/l10n_br_delivery/README.rst b/l10n_br_delivery/README.rst index 81f141e0db67..fc9e68e845ef 100644 --- a/l10n_br_delivery/README.rst +++ b/l10n_br_delivery/README.rst @@ -2,10 +2,13 @@ delivery module Brazilian Localization ====================================== -.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:a90c0eac791be01301284b938b5e48e863615b98ee88a3d4ac9ad637c07aff6e + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png :target: https://odoo-community.org/page/development-status @@ -19,11 +22,11 @@ delivery module Brazilian Localization .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png :target: https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_delivery :alt: Translate me on Weblate -.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/124/14.0 - :alt: Try me on Runbot +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-brazil&target_branch=14.0 + :alt: Try me on Runboat -|badge1| |badge2| |badge3| |badge4| |badge5| +|badge1| |badge2| |badge3| |badge4| |badge5| *(summary: extends the delivery module to comply with the fiscal documents requirements)* @@ -96,7 +99,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. -If you spotted it first, help us smashing it by providing a detailed and welcomed +If you spotted it first, help us to smash it by providing a detailed and welcomed `feedback `_. Do not contact contributors directly about support or help with technical issues. diff --git a/l10n_br_delivery/static/description/index.html b/l10n_br_delivery/static/description/index.html index 7bc3fc5f22a2..66a4e7458ae2 100644 --- a/l10n_br_delivery/static/description/index.html +++ b/l10n_br_delivery/static/description/index.html @@ -1,20 +1,20 @@ - + - + delivery module Brazilian Localization