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

[14.0][ADD] added new module purchase_reference_name #36

Open
wants to merge 1 commit into
base: 14.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions purchase_reference_name/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
10 changes: 10 additions & 0 deletions purchase_reference_name/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "Purchase Reference Name",
"summary": """
Concatenate Purchase Order Partner Reference with name""",
"author": "José López, OPTIC",
"website": "https://optic.gob.do",
"version": "14.0.0.0.1",
"depends": ["purchase_stock"],
"data": ["views/purchase_views.xml"],
}
23 changes: 23 additions & 0 deletions purchase_reference_name/i18n/es_DO.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_reference_name
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-03-01 20:18+0000\n"
"PO-Revision-Date: 2022-03-01 15:18-0500\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es_DO\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Poedit 3.0.1\n"

#. module: purchase_reference_name
#: model_terms:ir.ui.view,arch_db:purchase_reference_name.purchase_order_tree_inherited
msgid "DGCP Reference"
msgstr "No. Referencia DGCP"
1 change: 1 addition & 0 deletions purchase_reference_name/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import purchase
10 changes: 10 additions & 0 deletions purchase_reference_name/models/purchase.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from odoo import models


class PurchaseOrder(models.Model):
_inherit = "purchase.order"

def _prepare_picking(self):
result = super(PurchaseOrder, self)._prepare_picking()
result["origin"] = self.partner_ref or self.name
return result
15 changes: 15 additions & 0 deletions purchase_reference_name/views/purchase_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>

<record id="purchase_order_tree_inherited" model="ir.ui.view">
<field name="name">purchase.order.tree.inherited</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_tree"/>
<field name="arch" type="xml">
<field name="partner_ref" position="replace">
<field name="partner_ref" string="DGCP Reference"/>
</field>
</field>
</record>

</odoo>