mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
Update to the new data-model decided during the Open Days 2014.
Add demo data.
This commit is contained in:
committed by
Artem Kostyuk
parent
c153ccfa7e
commit
1f21a3739d
@@ -25,13 +25,13 @@
|
||||
'version': '1.0',
|
||||
'category': 'Banking addons',
|
||||
'license': 'AGPL-3',
|
||||
'summary': "Adds Bank Account and Payment Type on Sale Orders",
|
||||
'summary': "Adds Payment Mode on Sale Orders",
|
||||
'description': """
|
||||
Account Payment Sale
|
||||
====================
|
||||
|
||||
This modules adds 2 fields on sale orders : *Bank Account* and *Payment Type*.
|
||||
These fields are copied from partner to sale order and then from sale order to
|
||||
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
|
||||
|
||||
@@ -6,8 +6,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: OpenERP Server 7.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-02-24 23:07+0000\n"
|
||||
"PO-Revision-Date: 2014-02-24 23:07+0000\n"
|
||||
"POT-Creation-Date: 2014-06-09 23:24+0000\n"
|
||||
"PO-Revision-Date: 2014-06-09 23:24+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -16,8 +16,8 @@ msgstr ""
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: account_payment_sale
|
||||
#: field:sale.order,payment_mode_type:0
|
||||
msgid "Payment Type"
|
||||
#: field:sale.order,payment_mode_id:0
|
||||
msgid "Payment Mode"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_payment_sale
|
||||
@@ -25,13 +25,3 @@ msgstr ""
|
||||
msgid "Sales Order"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_payment_sale
|
||||
#: help:sale.order,partner_bank_receivable:0
|
||||
msgid "Select the bank account of your company on which the customer should pay. This field is copied from the partner and will be copied to the customer invoice."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_payment_sale
|
||||
#: field:sale.order,partner_bank_receivable:0
|
||||
msgid "Receivable Bank Account"
|
||||
msgstr ""
|
||||
|
||||
|
||||
@@ -27,13 +27,8 @@ class sale_order(orm.Model):
|
||||
_inherit = "sale.order"
|
||||
|
||||
_columns = {
|
||||
'partner_bank_receivable': fields.many2one(
|
||||
'res.partner.bank', 'Receivable Bank Account',
|
||||
help="Select the bank account of your company on which the "
|
||||
"customer should pay. This field is copied from the partner "
|
||||
"and will be copied to the customer invoice."),
|
||||
'payment_mode_type': fields.many2one(
|
||||
'payment.mode.type', 'Payment Type'),
|
||||
'payment_mode_id': fields.many2one(
|
||||
'payment.mode', 'Payment Mode'),
|
||||
}
|
||||
|
||||
def onchange_partner_id(self, cr, uid, ids, part, context=None):
|
||||
@@ -42,17 +37,10 @@ class sale_order(orm.Model):
|
||||
if part:
|
||||
partner = self.pool['res.partner'].browse(
|
||||
cr, uid, part, context=context)
|
||||
res['value'].update({
|
||||
'partner_bank_receivable':
|
||||
partner.partner_bank_receivable.id or False,
|
||||
'payment_mode_type':
|
||||
partner.customer_payment_mode_type.id or False,
|
||||
})
|
||||
res['value']['payment_mode_id'] = \
|
||||
partner.customer_payment_mode.id or False,
|
||||
else:
|
||||
res['value'].update({
|
||||
'partner_bank_receivable': False,
|
||||
'payment_mode_type': False,
|
||||
})
|
||||
res['value']['payment_mode_id'] = False
|
||||
return res
|
||||
|
||||
def _prepare_invoice(self, cr, uid, order, lines, context=None):
|
||||
@@ -60,7 +48,7 @@ class sale_order(orm.Model):
|
||||
invoice_vals = super(sale_order, self)._prepare_invoice(
|
||||
cr, uid, order, lines, context=context)
|
||||
invoice_vals.update({
|
||||
'partner_bank_id': order.partner_bank_receivable.id or False,
|
||||
'payment_mode_type': order.payment_mode_type.id or False,
|
||||
'payment_mode_id': order.payment_mode_id.id or False,
|
||||
'partner_bank_id': order.payment_mode_id.bank_id.id or False,
|
||||
})
|
||||
return invoice_vals
|
||||
|
||||
@@ -15,11 +15,7 @@
|
||||
<field name="inherit_id" ref="sale.view_order_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="payment_term" position="after">
|
||||
<field name="payment_mode_type"/>
|
||||
<field name="partner_bank_receivable"
|
||||
domain="[('partner_id.ref_companies', 'in', [company_id])]" />
|
||||
<!-- I can't add widget=selection,
|
||||
because it will break the domain instruction -->
|
||||
<field name="payment_mode_id"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
Reference in New Issue
Block a user