Code Monkey home page Code Monkey logo

Comments (1)

guillermm avatar guillermm commented on August 15, 2024

Originally posted by @pedrobaeza in #410 (comment)

Hola, @pedrobaeza como te va?

Te escribo para ver si puedes colaborarme con una duda, tengo una gran inquietud con un desarrollo que estoy haciendo para Odoo 10 versión OCA, yo cree la siguiente clase rescribiendo un método para pasar por parametro el precio_unit en la sección Pedidos de Compra:

`class PurchaseOrderLine(models.Model):

_inherit = "purchase.order.line"

def _prepare_stock_moves(self, picking):

    res = super(PurchaseOrderLine,self)._prepare_stock_moves(picking)

    diccionary_add = {
        'price_unit_without_costs': self.env['res.currency.rate']._currency_date_rate(self.order_id.date_order, self.order_id.currency_id, self.order_id.company_id.currency_id, self.price_unit, True),
    }

    res[0]['price_unit'] = self._landing_costs_price_unit_with_costs()
    res[0].update(diccionary_add)

    return res`

Reescribí la función original def _prepare_stock_moves(self, picking) y le paso el precio_unit, para cuando confirme el pedido, este se me refleje el precio nuevo que lo estoy generando con la funcion _landing_costs_price_unit_with_costs(), me lo muestra muy bien en la sección de Stock Move como te muestro a continuación:

invetario_013

El problema se refleja es cuando le doy a Validar, este pone el precio original y no el precio nuevo que estoy calculando.

Gracias por tu valioso tiempo,

from odoomrp-wip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.