Update to the new data-model decided during the Open Days 2014. Add demo data.

This commit is contained in:
Alexis de Lattre
2014-06-10 01:25:34 +02:00
committed by Koen Loodts
parent 345f9cac7b
commit 4119873a82
4 changed files with 26 additions and 26 deletions

View File

@@ -25,13 +25,13 @@
'version': '1.0',
'category': 'Banking addons',
'license': 'AGPL-3',
'summary': "Adds Bank Account and Payment Type on Purchase Orders",
'summary': "Adds Bank Account and Payment Mode on Purchase Orders",
'description': """
Account Payment Purchase
========================
This modules adds 2 fields on purchase orders : *Bank Account* and *Payment
Type*. These fields are copied from partner to purchase order and then from
Mode*. These fields are copied from partner to purchase order and then from
purchase order to supplier invoice.
This module is similar to the *purchase_payment* module ; the main difference

View File

@@ -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:23+0000\n"
"PO-Revision-Date: 2014-06-09 23:23+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -16,8 +16,13 @@ msgstr ""
"Plural-Forms: \n"
#. module: account_payment_purchase
#: field:purchase.order,payment_mode_type:0
msgid "Payment Type"
#: field:purchase.order,payment_mode_id:0
msgid "Payment Mode"
msgstr ""
#. module: account_payment_purchase
#: model:ir.model,name:account_payment_purchase.model_stock_picking
msgid "Picking List"
msgstr ""
#. module: account_payment_purchase
@@ -26,17 +31,12 @@ msgid "Purchase Order"
msgstr ""
#. module: account_payment_purchase
#: help:purchase.order,supplier_partner_bank:0
#: help:purchase.order,supplier_partner_bank_id:0
msgid "Select the bank account of your supplier on which your company should send the payment. This field is copied from the partner and will be copied to the supplier invoice."
msgstr ""
#. module: account_payment_purchase
#: field:purchase.order,supplier_partner_bank:0
#: field:purchase.order,supplier_partner_bank_id:0
msgid "Supplier Bank Account"
msgstr ""
#. module: account_payment_purchase
#: model:ir.model,name:account_payment_purchase.model_stock_picking
msgid "Picking List"
msgstr ""

View File

@@ -27,13 +27,13 @@ class purchase_order(orm.Model):
_inherit = "purchase.order"
_columns = {
'supplier_partner_bank': fields.many2one(
'supplier_partner_bank_id': fields.many2one(
'res.partner.bank', 'Supplier Bank Account',
help="Select the bank account of your supplier on which "
"your company should send the payment. This field is copied "
"from the partner and will be copied to the supplier invoice."),
'payment_mode_type': fields.many2one(
'payment.mode.type', 'Payment Type'),
'payment_mode_id': fields.many2one(
'payment.mode', 'Payment Mode'),
}
def _get_default_supplier_partner_bank(
@@ -51,16 +51,16 @@ class purchase_order(orm.Model):
partner = self.pool['res.partner'].browse(
cr, uid, partner_id)
res['value'].update({
'supplier_partner_bank':
'supplier_partner_bank_id':
self._get_default_supplier_partner_bank(
cr, uid, partner),
'payment_mode_type':
partner.supplier_payment_mode_type.id or False,
'payment_mode_id':
partner.supplier_payment_mode.id or False,
})
else:
res['value'].update({
'supplier_partner_bank': False,
'payment_mode_type': False,
'supplier_partner_bank_id': False,
'payment_mode_id': False,
})
return res
@@ -75,8 +75,8 @@ class purchase_order(orm.Model):
if invoice.state == 'draft':
invoice.write({
'partner_bank_id':
order.supplier_partner_bank.id or False,
'payment_mode_type':
order.payment_mode_type.id or False,
order.supplier_partner_bank_id.id or False,
'payment_mode_id':
order.payment_mode_id.id or False,
}, context=context)
return res

View File

@@ -15,8 +15,8 @@
<field name="inherit_id" ref="purchase.purchase_order_form"/>
<field name="arch" type="xml">
<field name="payment_term_id" position="after">
<field name="payment_mode_type"/>
<field name="supplier_partner_bank"
<field name="payment_mode_id"/>
<field name="supplier_partner_bank_id"
domain="[('partner_id', '=', partner_id)]" />
</field>
</field>