diff --git a/account_payment_sale/__openerp__.py b/account_payment_sale/__openerp__.py index 99266a10a..84d1c9d96 100644 --- a/account_payment_sale/__openerp__.py +++ b/account_payment_sale/__openerp__.py @@ -25,18 +25,18 @@ 'version': '1.0', 'category': 'Banking addons', 'license': 'AGPL-3', - 'summary': "Adds Payment Mode on Sale Orders", + 'summary': "Adds payment mode on sale orders", 'description': """ Account Payment Sale ==================== -This modules adds one field on sale orders : *Payment Mode*. +This modules adds one field on sale orders: *Payment Mode*. This field is copied from partner to sale order and then from sale order to customer invoice. -This module is similar to the *sale_payment* module ; the main difference is +This module is similar to the *sale_payment* module; the main difference is that it doesn't depend on the *account_payment_extension* module (it's not the -only module to conflict with *account_payment_extension* ; all the SEPA +only module to conflict with *account_payment_extension*; all the SEPA modules in the banking addons conflict with *account_payment_extension*. """, 'author': 'Akretion', @@ -44,7 +44,6 @@ modules in the banking addons conflict with *account_payment_extension*. 'contributors': ['Pedro M. Baeza '], 'depends': [ 'sale', - 'stock_account', 'account_payment_partner' ], 'conflicts': ['sale_payment'], @@ -52,4 +51,5 @@ modules in the banking addons conflict with *account_payment_extension*. 'views/sale_order_view.xml', ], 'installable': True, + 'auto_install': True, } diff --git a/account_payment_sale/models/__init__.py b/account_payment_sale/models/__init__.py index 9de52dd65..814479106 100644 --- a/account_payment_sale/models/__init__.py +++ b/account_payment_sale/models/__init__.py @@ -1,10 +1,6 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# Account Payment Sale module for OpenERP -# Copyright (C) 2014 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# # 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 @@ -21,4 +17,3 @@ ############################################################################## from . import sale_order -from . import stock_picking diff --git a/account_payment_sale/models/sale_order.py b/account_payment_sale/models/sale_order.py index 0906beae0..e1b6a4aad 100644 --- a/account_payment_sale/models/sale_order.py +++ b/account_payment_sale/models/sale_order.py @@ -28,7 +28,8 @@ class SaleOrder(models.Model): payment_mode_id = fields.Many2one( 'payment.mode', string='Payment Mode', - domain="[('payment_order_type', '=', 'debit')]") + domain="['|', ('payment_order_type', '=', 'debit'), " + "('payment_order_type', '=', 'both')]") @api.multi def onchange_partner_id(self, partner_id): diff --git a/account_payment_sale/models/stock_picking.py b/account_payment_sale/models/stock_picking.py deleted file mode 100644 index 320952ac5..000000000 --- a/account_payment_sale/models/stock_picking.py +++ /dev/null @@ -1,40 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Account Payment Purchase module for OpenERP -# Copyright (C) 2014 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# 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, api - - -class StockPicking(models.Model): - _inherit = "stock.picking" - - @api.model - def _create_invoice_from_picking(self, picking, vals): - if picking: - # Search if this picking comes from a sale order - sale_order_obj = self.env['sale.order'] - sale_order = sale_order_obj.search( - [('picking_ids', 'in', picking.id)], limit=1) - if sale_order and sale_order.payment_mode_id: - vals['partner_bank_id'] = sale_order.payment_mode_id.bank_id.id - vals['payment_mode_id'] = sale_order.payment_mode_id.id - return super(StockPicking, self)._create_invoice_from_picking(picking, - vals) diff --git a/account_payment_sale/view/sale.xml b/account_payment_sale/view/sale.xml deleted file mode 100644 index 016598e09..000000000 --- a/account_payment_sale/view/sale.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - account_payment_sale.sale_order.form - sale.order - - - - - - - - - -