Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PORT] 9.0 account invoice shipping address #135

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions account_invoice_shipping_address/README.rst
Expand Up @@ -4,6 +4,13 @@ Invoice Shipping Address
This module adds a shipping address field to the invoice, also it fills it in sale and picking invoicing


Usage
=====
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/95/9.0


Bug Tracker
===========

Expand All @@ -22,6 +29,7 @@ Contributors
* Leonardo Pistone <leonardo.pistone@camptocamp.com>
* Andrea Cometa <info@andreacometa.it>
* Anthony Muschang <anthony.muschang@acsone.eu>
* Farid Shahy <fshahy@gmail.com>

Maintainer
----------
Expand Down
4 changes: 1 addition & 3 deletions account_invoice_shipping_address/__init__.py
Expand Up @@ -20,6 +20,4 @@
#
##############################################################################

from . import invoice
from . import sale
from . import stock
from . import models
9 changes: 5 additions & 4 deletions account_invoice_shipping_address/__openerp__.py
Expand Up @@ -23,17 +23,18 @@

{
"name": "Invoice Shipping Address",
'summary': """
'description': """
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't put description. The description is in the README.rst file. This is only summary.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just summary key?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From Odoo v8, the description is automatically binded from the README.rst file, so no need to duplicate it.

Adds a shipping address field to the invoice.""",
"version": "8.0.0.1.1",
"version": "9.0.0.1.1",
'category': 'Generic Modules/Accounting',
"depends": ["account", "sale", "sale_stock"],
"author": "Andrea Cometa, Agile Business Group,"
"Odoo Community Association (OCA)",
'website': 'http://www.andreacometa.it',
'license': 'AGPL-3',
'data': [
'invoice_view.xml',
'views/account_invoice.xml',
],
'installable': False,
'installable': True,
'auto_install': False,
}
43 changes: 43 additions & 0 deletions account_invoice_shipping_address/i18n/fa.po
@@ -0,0 +1,43 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_invoice_shipping_address
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-03-05 21:40+0000\n"
"PO-Revision-Date: 2016-03-06 01:13+0330\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"Language: fa\n"
"X-Generator: Poedit 1.8.4\n"

#. module: account_invoice_shipping_address
#: model:ir.model.fields,help:account_invoice_shipping_address.field_account_invoice_address_shipping_id
msgid "Delivery address for current invoice."
msgstr "آدرس تحویل برای این فاکتور."

#. module: account_invoice_shipping_address
#: model:ir.model,name:account_invoice_shipping_address.model_account_invoice
msgid "Invoice"
msgstr "فاکتور"

#. module: account_invoice_shipping_address
#: model:ir.model,name:account_invoice_shipping_address.model_sale_order
msgid "Sales Order"
msgstr "سفارش فروش"

#. module: account_invoice_shipping_address
#: model:ir.model.fields,field_description:account_invoice_shipping_address.field_account_invoice_address_shipping_id
msgid "Shipping Address"
msgstr "آدرس تحویل"

#. module: account_invoice_shipping_address
#: model:ir.model,name:account_invoice_shipping_address.model_stock_picking
msgid "Transfer"
msgstr "انتقال"
24 changes: 24 additions & 0 deletions account_invoice_shipping_address/models/__init__.py
@@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Odoo, an open source suite of business apps
# This module copyright (C) 2016 Farid Shahy (<fshahy@gmail.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 . import invoice
from . import sale

Expand Up @@ -20,20 +20,19 @@
#
##############################################################################

from openerp.osv import fields, orm
from openerp import fields, models


class account_invoice(orm.Model):
class AccountInvoice(models.Model):

_inherit = "account.invoice"

_columns = {
'address_shipping_id': fields.many2one(
'res.partner',
'Shipping Address',
readonly=True,
states={
'draft': [('readonly', False)],
'sent': [('readonly', False)]
},
help="Delivery address for current invoice."),
}
address_shipping_id = fields.Many2one(
'res.partner',
'Shipping Address',
readonly=True,
states={
'draft': [('readonly', False)],
'sent': [('readonly', False)]
},
help="Delivery address for current invoice.")
Expand Up @@ -20,17 +20,17 @@
#
##############################################################################

from openerp.osv import orm
from openerp import api, models


class sale_order(orm.Model):
class SaleOrder(models.Model):

_inherit = 'sale.order'

def _prepare_invoice(self, cr, uid, order, lines, context=None):
@api.multi
def _prepare_invoice(self, context=None):

res = super(sale_order, self)._prepare_invoice(
cr, uid, order, lines, context=context
)
res.update({
'address_shipping_id': order.partner_shipping_id.id, })
return res
invoice_vals = super(SaleOrder, self)._prepare_invoice()
invoice_vals.update({
'address_shipping_id': self.partner_shipping_id.id, })
return invoice_vals
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 0 additions & 34 deletions account_invoice_shipping_address/stock.py

This file was deleted.

@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<record model="ir.ui.view" id="invoice_form_shipping_address">
<field name="name">account.invoice.form.shipping.address</field>
<record id="invoice_form" model="ir.ui.view">
<field name="name">account.invoice.form</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
<field name="fiscal_position" position="before">
<xpath expr="//field[@name='fiscal_position_id']" position="before">
<field name="address_shipping_id"/>
</field>
</xpath>
</field>
</record>
</data>
Expand Down