From 26210b23b1641eb978c98bb05399769516996fab Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Tue, 31 Aug 2010 17:48:16 -0300 Subject: [PATCH 001/239] =?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 bc19a040de322c7efc832c35ce90e5d7e2c13f39 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Tue, 31 Aug 2010 19:14:38 -0300 Subject: [PATCH 002/239] 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 8996aea4145e7338738799e44353ac894e834d1d Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 8 Sep 2010 15:46:28 -0300 Subject: [PATCH 003/239] 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 880c3382b203091c4537b85c82c0396303d00e28 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Tue, 28 Sep 2010 19:51:17 -0300 Subject: [PATCH 004/239] =?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 9e76ba1639d9e4c0daf366591895707a1373323e Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 14 Oct 2010 02:00:07 -0300 Subject: [PATCH 005/239] =?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 df2aa78b747fd0c6f432d620cc58ee6b2085ecfb 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/239] [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 4c57f814c6fc8b526e249f6a5a9672325ef874e9 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 27 Oct 2010 23:13:37 -0200 Subject: [PATCH 007/239] =?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 589a0dfd25300bb7ee0dc83308395370763aea3f Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 28 Oct 2010 01:01:38 -0200 Subject: [PATCH 008/239] =?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 31ecc87991365d93088b1af3bcd41a14fbd20811 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Mon, 29 Nov 2010 17:30:15 -0200 Subject: [PATCH 009/239] =?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 0e7a9e226048ac306e5ba08983d7c412bbdbe95d Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Tue, 30 Nov 2010 14:26:32 -0200 Subject: [PATCH 010/239] =?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 98c39505934904a3d0c488cb9aad9fe3cb8edfb4 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Fri, 3 Dec 2010 03:51:25 -0200 Subject: [PATCH 011/239] 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 8b10aa20c99ad60d6024954898d3e212f0134af0 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 9 Dec 2010 05:16:06 -0200 Subject: [PATCH 012/239] =?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 a0ad6a7d545d43a5c850aaadfb0acf4876404a5e Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Mon, 10 Jan 2011 13:32:12 -0200 Subject: [PATCH 013/239] =?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 2e7205cb9decc22c5a4610471274eeebcf4b398e Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Fri, 14 Jan 2011 13:12:37 -0200 Subject: [PATCH 014/239] =?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 0bec4101f39c0cf91231b3711e32cc49c77fee37 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Mon, 24 Jan 2011 13:11:07 -0200 Subject: [PATCH 015/239] =?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 0a15421910943c1195ab9d2e15cfb49d0bc75be3 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 3 Feb 2011 07:57:47 -0200 Subject: [PATCH 016/239] =?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 bde59c3501ff5a87ddf80c0eceb892948c803692 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 3 Feb 2011 23:23:51 -0200 Subject: [PATCH 017/239] 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 f12e623ffe1613bdcd67d9498482e6b2df02c884 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Mon, 28 Feb 2011 20:27:25 -0300 Subject: [PATCH 018/239] =?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 2627d59cca02fea422b6a25b103c56a57096a592 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Tue, 12 Apr 2011 19:52:47 -0300 Subject: [PATCH 019/239] =?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 0503a15f30748c2b79c49e4705306ed1d7a5b9d8 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/239] [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 e5e59fefea33efa56e657f9e7a4a9561ec832683 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Mon, 9 May 2011 16:17:41 -0300 Subject: [PATCH 021/239] =?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 095632c7261b381945ad2292137f4238f57ed0b7 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 11 May 2011 16:39:28 -0300 Subject: [PATCH 022/239] =?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 4892b1a3603ff781167d678a9a2a77c1f6e6a922 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Tue, 17 May 2011 14:24:01 -0300 Subject: [PATCH 023/239] =?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 8ddf1e08eddd712777420c39d909f9ddf79f9242 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Tue, 24 May 2011 20:15:08 -0300 Subject: [PATCH 024/239] =?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 d614640d30e94e8405076aed90dea3fe86f6c026 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 9 Jun 2011 23:02:40 -0300 Subject: [PATCH 025/239] =?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 5d65620d8b28518bb629d2bd1435cfe9427a6e9e Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Mon, 18 Jul 2011 03:12:11 -0300 Subject: [PATCH 026/239] =?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 ddd9518fdbc4100b2888b2277c48708e1c7a987e Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Mon, 18 Jul 2011 04:16:53 -0300 Subject: [PATCH 027/239] =?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 b8a9aa97dc569f708a08ce032b12405486ba096d Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Tue, 27 Sep 2011 19:01:30 -0300 Subject: [PATCH 028/239] =?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 f9d93d0c6f4a7fcc515e4da4fb73c6735d981895 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Mon, 14 Nov 2011 15:46:47 -0200 Subject: [PATCH 029/239] =?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 66715a0813b99758239bbed9dcddd8f8655a4894 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Tue, 15 Nov 2011 00:33:22 -0200 Subject: [PATCH 030/239] =?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 97a2476d3efa20563347146ecb6d0c3dad0f87b8 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 23 Nov 2011 01:31:14 -0200 Subject: [PATCH 031/239] =?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 f074c6bedd1c4e0a8770e24111944a3166af24a7 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 23 Nov 2011 03:02:46 -0200 Subject: [PATCH 032/239] =?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 8201c51a63290fa3406092e1900880156818a4fa Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 23 Nov 2011 03:40:43 -0200 Subject: [PATCH 033/239] =?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 92a47698a294ed2d7e98a25d3a6c850993d0ba9a Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 26 Jan 2012 17:39:51 -0200 Subject: [PATCH 034/239] =?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 05a96be00f46d989cede93236dbfbdcac37a1780 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/239] [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 f05962b43019c6ba7a9732c36bbef2255824cd06 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/239] [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 cea9de41cf85d4acc4ddd97c9e467a0fbca4ffa9 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Tue, 30 Oct 2012 13:04:43 -0200 Subject: [PATCH 037/239] =?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 d7884429365fffffad9d1a5499f5596bcf25e3ab Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 8 Nov 2012 11:42:13 -0200 Subject: [PATCH 038/239] =?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 ea3e16775148593649fde2c3ab4e4df13c8a940a Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 8 Nov 2012 12:33:47 -0200 Subject: [PATCH 039/239] =?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 f8d4da0d7ffea1608d32f2e434f5956b7c0df13a Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Tue, 11 Dec 2012 22:54:20 -0200 Subject: [PATCH 040/239] =?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 d422801c601a355fb662d3b4b67c2920b1ea4f98 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Fri, 14 Dec 2012 09:57:54 -0200 Subject: [PATCH 041/239] =?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 247045f6855cc3ef0d543fd3b0d90776f8f36cf5 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Mon, 17 Dec 2012 22:10:47 -0200 Subject: [PATCH 042/239] [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 58942ca7ce8068ddf24b13f905a5b131d3b37faf Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Tue, 29 Jan 2013 01:08:16 -0200 Subject: [PATCH 043/239] =?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 04e48c484ffa40cac52a4e3213105da7e310982b Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 6 Feb 2013 17:08:18 -0200 Subject: [PATCH 044/239] =?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 c44d7b519c993d2cd0b03479f89db43e974457e3 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Mon, 11 Feb 2013 13:51:01 -0200 Subject: [PATCH 045/239] =?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 be7e740015a8a0c731a529f39cd6ec9a7a948aba Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Tue, 16 Apr 2013 11:55:11 -0300 Subject: [PATCH 046/239] =?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 06be6a8c9b86c4f381f679e5368ba25ed824062b Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Sat, 25 May 2013 16:31:38 -0300 Subject: [PATCH 047/239] =?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 d0c279779ee6854c5aeeb78cfea4ab2114fc7a5f Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Fri, 30 Aug 2013 20:38:35 -0300 Subject: [PATCH 048/239] =?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 c6873ec05cad70990c88d9cfea5064b75e9d8dcc Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 12 Dec 2013 14:02:17 -0200 Subject: [PATCH 049/239] =?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 6fb60786d778f67bf84ad204492c0f92e1801fc6 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 12 Dec 2013 14:38:17 -0200 Subject: [PATCH 050/239] =?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 b734b6b1147409ff02c30567ce4b21bcb757289a Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Fri, 13 Dec 2013 18:07:59 -0200 Subject: [PATCH 051/239] =?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 8aa2e0da44451e8c8034497dfa67090635ec8b3d Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Fri, 13 Dec 2013 18:09:06 -0200 Subject: [PATCH 052/239] =?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 fa14383c5c801ab288a7cd257db4afea84035f80 Mon Sep 17 00:00:00 2001 From: mileo Date: Mon, 20 Jan 2014 10:46:40 -0200 Subject: [PATCH 053/239] =?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 ee720c8a85241537c20b5369b000cf6c495d6d03 Mon Sep 17 00:00:00 2001 From: mileo Date: Mon, 20 Jan 2014 14:27:57 -0200 Subject: [PATCH 054/239] 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 0f1cb09b31616a499f42a2502715c17e05b826eb Mon Sep 17 00:00:00 2001 From: mileo Date: Mon, 20 Jan 2014 15:25:14 -0200 Subject: [PATCH 055/239] [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 2a0d7516673d12d569828c595b407e3b9255582b Mon Sep 17 00:00:00 2001 From: mileo Date: Mon, 20 Jan 2014 15:31:23 -0200 Subject: [PATCH 056/239] [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 4f55ae39bfaa040e85a8df41f964f028c7a7949b Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Sat, 25 Jan 2014 16:51:52 -0200 Subject: [PATCH 057/239] =?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 5e2f42ca5d8596102ccc1724a8a0370dddba7b25 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Sun, 26 Jan 2014 23:51:35 -0200 Subject: [PATCH 058/239] [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 391c42c42bea5eeb667b3437fae76d55699492ed Mon Sep 17 00:00:00 2001 From: Danimar Ribeiro Date: Tue, 11 Mar 2014 22:38:57 -0300 Subject: [PATCH 059/239] =?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 e3087e11fa88217c5eb74b18d78d8846af576a65 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Sat, 15 Mar 2014 01:48:18 -0300 Subject: [PATCH 060/239] =?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 84ce805c3e36a748c50889ea7cf46e8df2b5edfd Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Sat, 15 Mar 2014 01:53:46 -0300 Subject: [PATCH 061/239] =?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 c874903996c496ba8b3f61cd8481f1b7d4eaebea Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Sat, 15 Mar 2014 02:03:20 -0300 Subject: [PATCH 062/239] =?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 1814cf6d1f0f743b5d2fff6f2e41df12460a24d8 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Sat, 15 Mar 2014 02:04:40 -0300 Subject: [PATCH 063/239] =?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 e26223ec4b07b00f721e5696fe2b5efe87f6a3f7 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Sat, 15 Mar 2014 02:11:02 -0300 Subject: [PATCH 064/239] =?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 8b9f888f7f1dd7d276230a2bf75e003a0c17d254 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 22 Oct 2014 17:37:58 -0200 Subject: [PATCH 065/239] =?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 5d458e0b20985712a81f0d5ab439096b78f9071b Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 22 Oct 2014 18:38:38 -0200 Subject: [PATCH 066/239] [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 b35728dbe5d4e617ba920f24a0a97b353b3ae449 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/239] [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 cdcd8ba4a21c9bc6be49529b1a59e1702978780d Mon Sep 17 00:00:00 2001 From: Luis Felipe Mileo Date: Sun, 15 Nov 2015 00:12:07 -0200 Subject: [PATCH 068/239] [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 07aeef675b23957efe7df6db18e3e55cec908ffb Mon Sep 17 00:00:00 2001 From: Luis Felipe Mileo Date: Sun, 15 Nov 2015 00:30:12 -0200 Subject: [PATCH 069/239] [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 68586b8ff3bff936be47038bfd43e6d5d6992246 Mon Sep 17 00:00:00 2001 From: Luis Felipe Mileo Date: Sun, 15 Nov 2015 01:28:21 -0200 Subject: [PATCH 070/239] [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 6cddc2d556fab381eae2a8bd9732e1146b0aefa2 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Mon, 27 Oct 2014 10:45:40 -0200 Subject: [PATCH 071/239] 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 e9c6129236a4184e2bdad10e8343e034317bc235 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Mon, 27 Oct 2014 10:46:53 -0200 Subject: [PATCH 072/239] 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 519b1c41c1f239e0c85e62ed03e651535338ad22 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 30 Oct 2014 18:16:20 -0200 Subject: [PATCH 073/239] 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 a2452c68c6ada1bd3544dc4005246dff050295f4 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 30 Oct 2014 18:19:59 -0200 Subject: [PATCH 074/239] 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 e8cb512bca2bffcd3d9362feba1fdcabcd846665 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 30 Oct 2014 18:20:34 -0200 Subject: [PATCH 075/239] 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 3248125c33178ba01278a27e6a9681619b60483a Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 30 Oct 2014 18:20:43 -0200 Subject: [PATCH 076/239] 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 f0c017d01c9534451c4cf98cff9b55eb5f93ea2d Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 14 Jan 2015 09:27:57 -0200 Subject: [PATCH 077/239] 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 7db8210a1c1832d36480679769f269083f23b9ab Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 14 Jan 2015 09:59:37 -0200 Subject: [PATCH 078/239] [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 7218bda799a31056cb5b10b68428a3374c97ea3c Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 14 Jan 2015 10:33:40 -0200 Subject: [PATCH 079/239] 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 7cab9d28eb550002a55637645a71d54eceed6864 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 14 Jan 2015 13:48:35 -0200 Subject: [PATCH 080/239] 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 bbc8b3af491a92ad228fd7cdb76cd0c2755ae747 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 14 Jan 2015 14:31:05 -0200 Subject: [PATCH 081/239] 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 21d1df251def8335d83cb691e1b381b5baadd9c0 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 14 Jan 2015 14:38:22 -0200 Subject: [PATCH 082/239] 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 b4b2cf8ae0dd9e8927546d99e561f8206ef95614 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 11 Mar 2015 13:08:23 -0300 Subject: [PATCH 083/239] 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 f6bb0556d94611ca98278554a46085e161920f17 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 11 Mar 2015 16:13:16 -0300 Subject: [PATCH 084/239] 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 a6429e4ec2fdf153cb134fc066b9fc88b3e0156a Mon Sep 17 00:00:00 2001 From: Raphael Valyi Date: Wed, 21 Oct 2015 23:06:45 -0200 Subject: [PATCH 085/239] 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 6194e86efe921d4cb2a643b04672a2120e980b44 Mon Sep 17 00:00:00 2001 From: Danimar Ribeiro Date: Fri, 9 Oct 2015 14:47:39 -0300 Subject: [PATCH 086/239] =?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 cc78ffba25e841886e2e4f0cb4034aacd5d6d91c Mon Sep 17 00:00:00 2001 From: Luis Felipe Mileo Date: Thu, 17 Dec 2015 01:09:10 -0200 Subject: [PATCH 087/239] [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 3ccbfe2f8f543bbf8b5a9a1a8bbc74979ad602d9 Mon Sep 17 00:00:00 2001 From: Luis Felipe Mileo Date: Thu, 17 Dec 2015 02:14:52 -0200 Subject: [PATCH 088/239] [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 3cad95937dbe2c5eb4e2c29eb1d181081ff9d7e5 Mon Sep 17 00:00:00 2001 From: Luis Felipe Mileo Date: Thu, 17 Dec 2015 08:33:58 -0200 Subject: [PATCH 089/239] [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 192418d5c74108870e6755fbeeda08826227e8a4 Mon Sep 17 00:00:00 2001 From: Luis Felipe Mileo Date: Sat, 26 Dec 2015 00:55:40 -0200 Subject: [PATCH 090/239] [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 f11e38be344509be69c0cbcf032449f450c2b467 Mon Sep 17 00:00:00 2001 From: renato Date: Thu, 19 May 2016 02:05:30 -0300 Subject: [PATCH 091/239] 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 23198cbe0aa2ae6ca350d583e184b2b322219934 Mon Sep 17 00:00:00 2001 From: renato Date: Thu, 19 May 2016 10:54:50 -0300 Subject: [PATCH 092/239] 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 e050743e5d64b4334bb44ab45d151059e2f1d042 Mon Sep 17 00:00:00 2001 From: renato Date: Thu, 19 May 2016 11:06:33 -0300 Subject: [PATCH 093/239] 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 7b715fc5f2c6da78899ccdddf90a7e18e7801083 Mon Sep 17 00:00:00 2001 From: renato Date: Thu, 19 May 2016 12:02:42 -0300 Subject: [PATCH 094/239] [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 633cab71b39b8a2b10841d277f5c047d75d30e05 Mon Sep 17 00:00:00 2001 From: Luis Felipe Mileo Date: Tue, 19 Jul 2016 11:45:03 -0300 Subject: [PATCH 095/239] [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 91e5901d6d0c43bf640f657e89a6b8ff9a3a317e 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/239] 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 3b16f74484d3afcd4f7607f0b306febe3da3ffc6 Mon Sep 17 00:00:00 2001 From: renato Date: Thu, 25 Aug 2016 03:56:29 -0300 Subject: [PATCH 097/239] [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 774e3376c181f3b326fd06a0c4aea372b6c35029 Mon Sep 17 00:00:00 2001 From: renato Date: Fri, 2 Dec 2016 01:33:20 -0200 Subject: [PATCH 098/239] [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 950b952961c449480c2650813c28afec439d07bc Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Tue, 6 Dec 2016 04:26:45 -0200 Subject: [PATCH 099/239] [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 14c4982c547cce6a4b2ecffd0f17053a34edf850 Mon Sep 17 00:00:00 2001 From: Gabriel Cardoso de Faria Date: Tue, 10 Nov 2020 11:37:18 -0300 Subject: [PATCH 100/239] [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 ccc9d85b79bc25ba342815801999bf61baeca69c Mon Sep 17 00:00:00 2001 From: Diego Paradeda Date: Tue, 10 Nov 2020 12:23:38 -0300 Subject: [PATCH 101/239] [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 56db07645a064a71a01c7fce6ba616908168cf73 Mon Sep 17 00:00:00 2001 From: Diego Paradeda Date: Tue, 10 Nov 2020 12:25:47 -0300 Subject: [PATCH 102/239] [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 ad69a1ccce75e6c4be4772be8533391f1b669fa9 Mon Sep 17 00:00:00 2001 From: Gabriel Cardoso de Faria Date: Tue, 10 Nov 2020 15:31:09 -0300 Subject: [PATCH 103/239] [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 b8e98f073baca4affbd3b4370eaf3bc72aa1f036 Mon Sep 17 00:00:00 2001 From: Diego Paradeda Date: Fri, 4 Dec 2020 11:02:21 -0300 Subject: [PATCH 104/239] [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 8ed7cf1050d56d2c4ed5d546ad25c2c7735903bf Mon Sep 17 00:00:00 2001 From: Diego Paradeda Date: Fri, 4 Dec 2020 11:04:38 -0300 Subject: [PATCH 105/239] [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 6c53e4855bdf5bb6962efcd949bb285c98e0df2e Mon Sep 17 00:00:00 2001 From: Gabriel Cardoso de Faria Date: Tue, 8 Dec 2020 10:27:09 -0300 Subject: [PATCH 106/239] [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 f4c416111a005f270647a012c7c1bc8d4f6b1c7a Mon Sep 17 00:00:00 2001 From: Gabriel Cardoso de Faria Date: Tue, 8 Dec 2020 10:28:42 -0300 Subject: [PATCH 107/239] [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 0f1e7d93cf4d89dcbc8d490b6b16e151a45ab2c5 Mon Sep 17 00:00:00 2001 From: Gabriel Cardoso de Faria Date: Tue, 8 Dec 2020 10:29:22 -0300 Subject: [PATCH 108/239] [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 421b87b7ae8945d1d272a1288a260164b39009e7 Mon Sep 17 00:00:00 2001 From: Luis Malta Date: Tue, 8 Dec 2020 11:29:10 -0300 Subject: [PATCH 109/239] [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 02c0ec4bdac13c29789c33ecd279f830f5b70439 Mon Sep 17 00:00:00 2001 From: Luis Malta Date: Tue, 8 Dec 2020 14:44:47 -0300 Subject: [PATCH 110/239] [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 e9cad94aec65f9bed1fc179d011a4a51ff46672a Mon Sep 17 00:00:00 2001 From: Gabriel Cardoso de Faria Date: Wed, 9 Dec 2020 13:41:06 -0300 Subject: [PATCH 111/239] [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 543bf469d9f9ec7f64f45af85da590b014028cd6 Mon Sep 17 00:00:00 2001 From: Luis Malta Date: Wed, 9 Dec 2020 14:26:42 -0300 Subject: [PATCH 112/239] [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 0656f934de9b2c72efff625ae14945a5554d8233 Mon Sep 17 00:00:00 2001 From: Luis Malta Date: Wed, 9 Dec 2020 14:27:12 -0300 Subject: [PATCH 113/239] [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 0568849f7b3835ad9a357259f8ac71feee631de3 Mon Sep 17 00:00:00 2001 From: Luis Malta Date: Thu, 10 Dec 2020 07:43:00 -0300 Subject: [PATCH 114/239] [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 5bcb5e098de60119bef9fe5e5fa43e0c1442ef82 Mon Sep 17 00:00:00 2001 From: Luis Malta Date: Thu, 10 Dec 2020 13:01:01 -0300 Subject: [PATCH 115/239] [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 1083cfc7e92dc25c298f06bb7abdcda7d3e9bd68 Mon Sep 17 00:00:00 2001 From: Luis Malta Date: Thu, 10 Dec 2020 16:09:13 -0300 Subject: [PATCH 116/239] [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 d60bf8ddf5c729a9b3868d3f1a0d3eb31771e4eb Mon Sep 17 00:00:00 2001 From: oca-travis Date: Mon, 14 Dec 2020 11:01:39 +0000 Subject: [PATCH 117/239] [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 a3c56ff62bef5080fc17b344dc9995c385ee2a9b Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Mon, 14 Dec 2020 11:21:06 +0000 Subject: [PATCH 118/239] [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 b8be60c2a21124b01a9c6c8992fc97422f95e44a Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Mon, 14 Dec 2020 11:21:06 +0000 Subject: [PATCH 119/239] [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 c8bd6f442ec3228230ef41f4655f43d9e2cd1490 Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Thu, 17 Dec 2020 05:25:03 +0000 Subject: [PATCH 120/239] 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 888cc6b2a58980a16c8da0267ece7c8c3ab3bf73 Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Thu, 17 Dec 2020 05:26:37 +0000 Subject: [PATCH 121/239] 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 71ab256ac8cc7827e988ca3331185979cebccc84 Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Fri, 18 Dec 2020 21:41:27 +0000 Subject: [PATCH 122/239] 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 345b079e220aaf0ec68cd9345592dafa18af4c32 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Mon, 22 Feb 2021 12:30:53 +0000 Subject: [PATCH 123/239] [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 b42be9fd7b8ae9429f667bc680f7a64822bf0fb4 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Mon, 8 Mar 2021 17:43:36 -0300 Subject: [PATCH 124/239] [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 ce39a36cc9ba665e1815fa055c63d919628813f2 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 10 Mar 2021 19:00:01 -0300 Subject: [PATCH 125/239] 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 fa714e39d9db6a52277b0af83160269f449d4415 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Fri, 26 Mar 2021 00:57:57 +0000 Subject: [PATCH 126/239] [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 ba241cbea6267edf9e9517357abc75141ed294d9 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Fri, 26 Mar 2021 01:26:12 +0000 Subject: [PATCH 127/239] 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 ad9f88f392b299dd4b8ea61f9e24a34a56d6767e Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 14 Apr 2021 17:51:48 -0300 Subject: [PATCH 128/239] 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 5c99d1285a7339c71efc8861887b99b8cea642b7 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Thu, 15 Apr 2021 16:36:38 +0000 Subject: [PATCH 129/239] 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 4ef22914a49e864ea8962c6a425055e9635b673c Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 26 May 2021 15:16:01 -0300 Subject: [PATCH 130/239] [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 7bdb1446dad0760a333a3040f48dcc688041cb55 Mon Sep 17 00:00:00 2001 From: Luis Felipe Mileo Date: Sun, 30 May 2021 18:00:22 -0300 Subject: [PATCH 131/239] [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 97ac526c422099a29e8c19c01b7a51055b0d983d Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Mon, 4 Jan 2021 15:21:18 -0300 Subject: [PATCH 132/239] [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 4f4bf4e6751aeef82954645b24cbf76989c102e3 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Fri, 16 Apr 2021 16:44:06 -0300 Subject: [PATCH 133/239] [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 f0da71055e29914a305be5331258b8c21d56d2ac Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Mon, 19 Apr 2021 16:59:07 -0300 Subject: [PATCH 134/239] [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 19f5e4a79ef59c1e080cb6ceecd4b596ee4f180f Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Mon, 19 Apr 2021 17:48:07 -0300 Subject: [PATCH 135/239] [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 37d21e49156af4afc03cbaea9316bfa4770d91bd Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Mon, 19 Apr 2021 17:51:06 -0300 Subject: [PATCH 136/239] [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 9181b79fd3548502792624487f1d5d85d73a229f Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Mon, 19 Apr 2021 17:53:17 -0300 Subject: [PATCH 137/239] [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 166cb410a3f8594700d49b363f976c305be6f3fe Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Mon, 19 Apr 2021 19:57:55 -0300 Subject: [PATCH 138/239] [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 678d205f3b04d15c14cc2cd4e377c8c3f1956fe8 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Sat, 24 Apr 2021 17:48:56 -0300 Subject: [PATCH 139/239] [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 9399a8d8839784040e9fdce874a136ccb937e195 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Sat, 24 Apr 2021 18:00:52 -0300 Subject: [PATCH 140/239] [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 276019b510c4efcde09fbadecb1a08dba548047a Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Tue, 27 Apr 2021 17:23:18 -0300 Subject: [PATCH 141/239] [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 432bd0ff45a5e6f55dda42b6a2a379636a011448 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 19 May 2021 12:37:31 -0300 Subject: [PATCH 142/239] [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 dd802a93c5d376b190c8aaced7d8004e6784947f Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 19 May 2021 13:16:54 -0300 Subject: [PATCH 143/239] [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 69ee62a03be1402a068d2943332f2ea9ad2d7583 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 19 May 2021 13:20:07 -0300 Subject: [PATCH 144/239] [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 5affbdfb85a6a31b7fb5f71cf669a5b16dd51030 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 19 May 2021 13:32:24 -0300 Subject: [PATCH 145/239] [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 f58c661c2a7345396c5a3178eb5e20ec24163308 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 19 May 2021 13:34:14 -0300 Subject: [PATCH 146/239] [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 a809f303495c809ded72c4dcee395a921f9dbe1e Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 19 May 2021 13:39:14 -0300 Subject: [PATCH 147/239] [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 689d83a973b7d6d519b841b0ae0a98d100f26567 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 19 May 2021 14:43:19 -0300 Subject: [PATCH 148/239] [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 511cbc961361d6f3f5dec00be5634707ca0670f2 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 19 May 2021 18:05:40 -0300 Subject: [PATCH 149/239] [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 5a3150668eb4bc8ad08b9b3aaa8fd5cdeced043f 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/239] 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 8154cd074569c490764fea4b5cee7ca9dfbf847e Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Fri, 21 May 2021 10:58:50 -0300 Subject: [PATCH 151/239] [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 8dbf520fae5a5a0ae7502ff1e581a6ec4ffaff1e Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Fri, 21 May 2021 11:02:28 -0300 Subject: [PATCH 152/239] [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 7b0776ffb1e75087cf01da032342e5e43fd96a52 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Fri, 21 May 2021 11:04:48 -0300 Subject: [PATCH 153/239] [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 c65b7a3d4b03060da2527d8874e473a0058c0940 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Thu, 10 Jun 2021 16:29:54 -0300 Subject: [PATCH 154/239] [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 0065ba5b8d2cd1454b5503220571005b6d5ffea7 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 18 Aug 2021 13:48:26 -0300 Subject: [PATCH 155/239] [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 48ecb1f4364f61bfa04ab751a067e4b4dc196c36 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Fri, 20 Aug 2021 10:06:07 -0300 Subject: [PATCH 156/239] [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 6e92ad1bf0435c2ffd81f2db79cba7c2d72a3ec8 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Fri, 20 Aug 2021 10:09:56 -0300 Subject: [PATCH 157/239] [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 728eb2b4ff4a02318084898a522361a10312fcec Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Fri, 20 Aug 2021 10:27:23 -0300 Subject: [PATCH 158/239] [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 77c360a88215440b7fbff080e92ac76e54013851 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Mon, 23 Aug 2021 15:49:38 -0300 Subject: [PATCH 159/239] [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 3f99b803dc8b4c99eaaea1e8a62d493b7301de84 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Mon, 23 Aug 2021 17:43:26 -0300 Subject: [PATCH 160/239] [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 35ffe9aa26c76f262e53e19d5b184c6d34955e9b Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Mon, 23 Aug 2021 17:59:21 -0300 Subject: [PATCH 161/239] [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 3fea60c8ad8aeb70d0162bd1f3f7511f0b7cdf1e Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Mon, 23 Aug 2021 18:01:18 -0300 Subject: [PATCH 162/239] [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 87c9a2ef810cd9fe1f1e3915988a1d70247d834e Mon Sep 17 00:00:00 2001 From: oca-travis Date: Tue, 24 Aug 2021 05:26:31 +0000 Subject: [PATCH 163/239] [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 b03427338350fea4e37191a43476ba51a6afdddc Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Tue, 24 Aug 2021 05:59:56 +0000 Subject: [PATCH 164/239] [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 cdd3b6ee4c1398443b5fe13f7c6b954a3daad275 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Tue, 24 Aug 2021 09:15:17 -0300 Subject: [PATCH 165/239] [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 c1d109a1c2d366e347b632a706e99a1f4d9e09f0 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Tue, 24 Aug 2021 14:11:55 +0000 Subject: [PATCH 166/239] [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 c55bb345b1b2093daaf83b4d217fd16737ffca5f 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/239] [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 f5dccf9f7b4cb3e64446a2136d1a0ffb8ef620ad Mon Sep 17 00:00:00 2001 From: oca-travis Date: Mon, 30 Aug 2021 00:53:55 +0000 Subject: [PATCH 168/239] [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 532b5da6a7ff730b2f76a9c0c0ad2f1906126dc2 Mon Sep 17 00:00:00 2001 From: Neto Date: Sun, 3 Oct 2021 08:49:49 -0300 Subject: [PATCH 169/239] 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 9e29214be5e536b14f52005dee236782503251eb Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Fri, 31 Dec 2021 16:23:08 -0300 Subject: [PATCH 170/239] [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 2c53967ee327c2818421c24dd030f01e55953d6f Mon Sep 17 00:00:00 2001 From: oca-travis Date: Tue, 4 Jan 2022 15:27:36 +0000 Subject: [PATCH 171/239] [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 65f4a58ff3b4e3854c00632ea9b8b56fdffc620b Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Tue, 4 Jan 2022 16:07:09 +0000 Subject: [PATCH 172/239] [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 070a95e5c8fec0444ea74115755549a0abdd2a17 Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Mon, 30 May 2022 10:39:59 -0300 Subject: [PATCH 173/239] [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 88dd090d24eff45ef70b6559108d319293a3bf65 Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Thu, 14 Jul 2022 15:41:15 -0300 Subject: [PATCH 174/239] [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 bf239e2b6cc841be5be7ed6f166091e73aba2d9f Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Thu, 29 Sep 2022 17:11:23 -0300 Subject: [PATCH 175/239] [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 edc21fb7dcd72e5fc8b3e223bbebf117fcb7bc67 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Thu, 29 Sep 2022 17:15:42 -0300 Subject: [PATCH 176/239] [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 8a6f957044f66069400762ba0e5df3293b6d9c1d Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Thu, 29 Sep 2022 17:30:55 -0300 Subject: [PATCH 177/239] [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 604c9f5f96d324b88df3f10813408e54c0a95067 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Fri, 30 Sep 2022 15:04:09 -0300 Subject: [PATCH 178/239] [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 81df19d8e7b7c4fa37cfa633baddb3b3fc24da2a Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Mon, 10 Oct 2022 14:27:23 -0300 Subject: [PATCH 179/239] [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/239] [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 6379f8988d30b5a73ed2e3cd33b38b1733a0c764 Mon Sep 17 00:00:00 2001 From: oca-ci Date: Tue, 11 Oct 2022 09:01:32 +0000 Subject: [PATCH 181/239] [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 4b4e34d7ba973cfb783f22ad4f7888ad1b76d988 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Tue, 11 Oct 2022 09:14:34 +0000 Subject: [PATCH 182/239] [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 afbb1ce923c8c1c36836f674821b92ec1efdd399 Mon Sep 17 00:00:00 2001 From: oca-ci Date: Tue, 18 Oct 2022 19:42:41 +0000 Subject: [PATCH 183/239] [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 6fdcbb05e59e3b4206c54691dfdbda31e42c64d0 Mon Sep 17 00:00:00 2001 From: Weblate Date: Tue, 18 Oct 2022 19:57:50 +0000 Subject: [PATCH 184/239] 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 2e787b8526e6145d304ab1f04ccb102d5019b9b2 Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Fri, 14 Oct 2022 15:27:06 -0300 Subject: [PATCH 185/239] [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 c07fc80440bb7ccbf9cc5ddf09fc8c16592e0f01 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/239] [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 3120466cc950283b5938f7e36edcdf795e7325ee 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/239] [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 519df84f96f520c64afa12131424e52102e8c514 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/239] [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 5a747c3bd110082fcabe224fdbc43b31f50de23f Mon Sep 17 00:00:00 2001 From: oca-ci Date: Sat, 22 Oct 2022 10:57:47 +0000 Subject: [PATCH 189/239] [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 9d8c6c213944ab573dbdb232d452b59f48ea66b9 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Sat, 22 Oct 2022 11:09:35 +0000 Subject: [PATCH 190/239] 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 3247ab2f9eb17cc1004ef811a0ff9894b404db2d Mon Sep 17 00:00:00 2001 From: Weblate Date: Sat, 22 Oct 2022 11:09:51 +0000 Subject: [PATCH 191/239] 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 5ba73033d5fd45e270c4f60146531cd5e761f86f 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/239] 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 4600c5abdba37b7ad748fbee2ffa72f47b5699c1 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/239] 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 6de97be295c2a71a8266a467851499ea37915d7c Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Sat, 7 Jan 2023 20:38:34 +0000 Subject: [PATCH 194/239] 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 baad5ebf24715d0eecbe3030d518b0d25c7b0326 Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Sat, 7 Jan 2023 20:58:42 +0000 Subject: [PATCH 195/239] 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 13cf5057153d01f159ae7c278c4cafc441461cee Mon Sep 17 00:00:00 2001 From: oca-ci Date: Sat, 4 Feb 2023 02:03:12 +0000 Subject: [PATCH 196/239] [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 df0755eb05b4f5c61906c191daa3b35a37105fe3 Mon Sep 17 00:00:00 2001 From: Weblate Date: Sat, 4 Feb 2023 05:59:17 +0000 Subject: [PATCH 197/239] 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 84c85881dee48aa148f9e105a2aa4f13c9f7bd83 Mon Sep 17 00:00:00 2001 From: oca-ci Date: Wed, 1 Mar 2023 22:17:01 +0000 Subject: [PATCH 198/239] [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 435b190eb4353660423452695ce71e31f4a9cf3c Mon Sep 17 00:00:00 2001 From: Weblate Date: Wed, 1 Mar 2023 22:32:54 +0000 Subject: [PATCH 199/239] 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 600a08fe18fccacb50ab4d6b82bb0c628b5ca9cb Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Wed, 29 Mar 2023 18:49:22 +0000 Subject: [PATCH 200/239] 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 3df9a3bec0c2261ebdf181e9ab4c34a930fb1100 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/239] [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 a4d042a3f342ab2fb3eee77c50750045150c25c5 Mon Sep 17 00:00:00 2001 From: oca-ci Date: Sat, 3 Jun 2023 13:52:32 +0000 Subject: [PATCH 202/239] [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 185d3cb5b15638582d4c5005e671e2353fd4ddc8 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Sat, 3 Jun 2023 14:11:42 +0000 Subject: [PATCH 203/239] 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 f2adf3ff44d766905a20466b20c535f4af6ad0b0 Mon Sep 17 00:00:00 2001 From: Weblate Date: Sat, 3 Jun 2023 14:12:00 +0000 Subject: [PATCH 204/239] 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 d5630c5e4e783704a5434fce56633383b86b58f5 Mon Sep 17 00:00:00 2001 From: oca-ci Date: Fri, 16 Jun 2023 08:13:08 +0000 Subject: [PATCH 205/239] [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 0aa43ea7ff40057fcd73610febebace9e7fa0a16 Mon Sep 17 00:00:00 2001 From: Weblate Date: Fri, 16 Jun 2023 08:28:22 +0000 Subject: [PATCH 206/239] 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 4bdd4108c726b9229e2456393ce2986d475a1fb3 Mon Sep 17 00:00:00 2001 From: oca-ci Date: Thu, 10 Aug 2023 18:41:45 +0000 Subject: [PATCH 207/239] [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 d048dbd879fb2294a95f4c3f66c6004afb2dd366 Mon Sep 17 00:00:00 2001 From: Weblate Date: Thu, 10 Aug 2023 19:13:27 +0000 Subject: [PATCH 208/239] 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 746a143486c817c5fe1e28419a59f1a1b715f017 Mon Sep 17 00:00:00 2001 From: oca-ci Date: Fri, 11 Aug 2023 07:20:11 +0000 Subject: [PATCH 209/239] [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 d0447745728a2a04d431988494a8a4c668e4981a Mon Sep 17 00:00:00 2001 From: Weblate Date: Fri, 11 Aug 2023 07:44:14 +0000 Subject: [PATCH 210/239] 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 3047f7734afe669394b8f003ae4fb639791bd502 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 17 Aug 2023 17:48:54 -0300 Subject: [PATCH 211/239] [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 601a58b3f35235ff62addc844ba4a57c675a029e Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Fri, 18 Aug 2023 16:14:24 +0000 Subject: [PATCH 212/239] 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 2a992d8617165b8b57565bee19831a67514ad04a Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Sun, 3 Sep 2023 13:24:58 +0000 Subject: [PATCH 213/239] [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