[FIX] account_payment_sale_stock: Split for removing stock dependency on sale

[DEL] Remove old translations templates
[IMP] More reorder on folder structure
This commit is contained in:
Pedro M. Baeza
2014-10-31 23:54:24 +01:00
committed by Artem Kostyuk
parent 84b4a20520
commit cec503cbe7
5 changed files with 7 additions and 75 deletions

View File

@@ -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 <pedro.baeza@serviciosbaeza.com>'],
'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,
}

View File

@@ -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 <alexis.delattre@akretion.com>
#
# 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

View File

@@ -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):

View File

@@ -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 <alexis.delattre@akretion.com>
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
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)

View File

@@ -1,24 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2014 Akretion (http://www.akretion.com/)
@author Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
-->
<openerp>
<data>
<record id="view_order_form" model="ir.ui.view">
<field name="name">account_payment_sale.sale_order.form</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<field name="payment_term" position="after">
<field name="payment_mode_id"/>
</field>
</field>
</record>
</data>
</openerp>