Skip to content

Commit

Permalink
[ADD] added new module purchase_reference_name
Browse files Browse the repository at this point in the history
  • Loading branch information
jose-pcg committed Mar 1, 2022
1 parent 5adada7 commit b42433f
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 0 deletions.
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>

0 comments on commit b42433f

Please sign in to comment.